From 3aaa7197a3f4998d615be24482d2a1bb9e7e013c Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Thu, 28 Nov 2024 20:58:53 +0100 Subject: [PATCH] [IMP] sale_report_delivered: Add partner salesperson to sales report from delivery orders TT51908 --- sale_report_delivered/i18n/es.po | 12 +++++++++--- sale_report_delivered/i18n/sale_report_delivered.pot | 8 ++++++++ sale_report_delivered/reports/sale_report.py | 6 ++++++ .../views/sale_report_delivered_views.xml | 6 ++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/sale_report_delivered/i18n/es.po b/sale_report_delivered/i18n/es.po index 6b89f951..7c99b082 100644 --- a/sale_report_delivered/i18n/es.po +++ b/sale_report_delivered/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-16 17:02+0000\n" -"PO-Revision-Date: 2022-02-16 18:13+0100\n" +"POT-Creation-Date: 2024-11-28 20:03+0000\n" +"PO-Revision-Date: 2024-11-28 21:03+0100\n" "Last-Translator: Carlos Dauden \n" "Language-Team: \n" "Language: es\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.3\n" +"X-Generator: Poedit 3.4.2\n" #. module: sale_report_delivered #: model:ir.model.fields,field_description:sale_report_delivered.field_sale_report_delivered__nbr @@ -232,6 +232,12 @@ msgstr "Ventas desde albaranes" msgid "Salesperson" msgstr "Comercial" +#. module: sale_report_delivered +#: model:ir.model.fields,field_description:sale_report_delivered.field_sale_report_delivered__user_from_partner_id +#: model_terms:ir.ui.view,arch_db:sale_report_delivered.view_sale_report_delivered_search +msgid "Salesperson From Partner" +msgstr "Comercial del cliente" + #. module: sale_report_delivered #: model:ir.model.fields,field_description:sale_report_delivered.field_sale_report_delivered__source_id msgid "Source" diff --git a/sale_report_delivered/i18n/sale_report_delivered.pot b/sale_report_delivered/i18n/sale_report_delivered.pot index cbfa867e..7b835bbb 100644 --- a/sale_report_delivered/i18n/sale_report_delivered.pot +++ b/sale_report_delivered/i18n/sale_report_delivered.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-28 20:03+0000\n" +"PO-Revision-Date: 2024-11-28 20:03+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -228,6 +230,12 @@ msgstr "" msgid "Salesperson" msgstr "" +#. module: sale_report_delivered +#: model:ir.model.fields,field_description:sale_report_delivered.field_sale_report_delivered__user_from_partner_id +#: model_terms:ir.ui.view,arch_db:sale_report_delivered.view_sale_report_delivered_search +msgid "Salesperson From Partner" +msgstr "" + #. module: sale_report_delivered #: model:ir.model.fields,field_description:sale_report_delivered.field_sale_report_delivered__source_id msgid "Source" diff --git a/sale_report_delivered/reports/sale_report.py b/sale_report_delivered/reports/sale_report.py index 7cca28ab..8cb46f90 100644 --- a/sale_report_delivered/reports/sale_report.py +++ b/sale_report_delivered/reports/sale_report.py @@ -20,6 +20,9 @@ class SaleReportDeliverd(models.Model): product_uom_qty = fields.Float("Qty", readonly=True) partner_id = fields.Many2one("res.partner", "Customer", readonly=True) company_id = fields.Many2one("res.company", "Company", readonly=True) + user_from_partner_id = fields.Many2one( + "res.users", "Salesperson From Partner", readonly=True + ) user_id = fields.Many2one("res.users", "Salesperson", readonly=True) price_subtotal = fields.Float("Untaxed total delivered", readonly=True) product_tmpl_id = fields.Many2one("product.template", "Product", readonly=True) @@ -71,6 +74,7 @@ def _select(self): sub.date, sub.state, sub.partner_id, + sub.user_from_partner_id, sub.user_id, sub.company_id, sub.campaign_id, @@ -168,6 +172,7 @@ def _sub_select(self): s.analytic_account_id as analytic_account_id, s.team_id as team_id, p.product_tmpl_id, + partner.user_id as user_from_partner_id, partner.country_id as country_id, partner.industry_id as industry_id, partner.commercial_partner_id as commercial_partner_id, @@ -253,6 +258,7 @@ def _group_by(self): sub.order_name, sub.date, sub.partner_id, + sub.user_from_partner_id, sub.user_id, sub.state, sub.company_id, diff --git a/sale_report_delivered/views/sale_report_delivered_views.xml b/sale_report_delivered/views/sale_report_delivered_views.xml index 9e0fbc4c..d0b6de73 100644 --- a/sale_report_delivered/views/sale_report_delivered_views.xml +++ b/sale_report_delivered/views/sale_report_delivered_views.xml @@ -52,6 +52,7 @@ /> + @@ -71,6 +72,11 @@ name="User" context="{'group_by':'user_id'}" /> +