Skip to content

Commit

Permalink
[MIG] sale_report_salesperson_from_partner: Migration to 16.0
Browse files Browse the repository at this point in the history
TT51908
  • Loading branch information
pilarvargas-tecnativa committed Dec 2, 2024
1 parent be087c9 commit 150a098
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion sale_report_salesperson_from_partner/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sale Report Salesperson From Partner",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"author": "Tecnativa," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-reporting",
"category": "Sales",
Expand Down
11 changes: 6 additions & 5 deletions sale_report_salesperson_from_partner/report/sale_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ class SaleReport(models.Model):
readonly=True,
)

def _group_by_sale(self, groupby=""):
res = super()._group_by_sale(groupby)
def _group_by_sale(self):
res = super()._group_by_sale()
res += """,partner.user_id"""
return res

def _select_additional_fields(self, fields):
fields["user_from_partner_id"] = ", partner.user_id as user_from_partner_id"
return super()._select_additional_fields(fields)
def _select_additional_fields(self):
res = super()._select_additional_fields()
res["user_from_partner_id"] = "partner.user_id"
return res
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# Copyright 2024 Tecnativa - Pilar Vargas
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.tests import Form, common, new_test_user

from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT


class SaleReportSalespersonFromPartner(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.salesperson = new_test_user(
cls.env,
Expand Down

0 comments on commit 150a098

Please sign in to comment.