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 5, 2024
1 parent 26d43be commit a7f5e53
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
8 changes: 4 additions & 4 deletions sale_report_salesperson_from_partner/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-pilar-vargas| image:: https://github.com/pilar-vargas.png?size=40px
:target: https://github.com/pilar-vargas
:alt: pilar-vargas
.. |maintainer-pilarvargas-tecnativa| image:: https://github.com/pilarvargas-tecnativa.png?size=40px
:target: https://github.com/pilarvargas-tecnativa
:alt: pilarvargas-tecnativa

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-pilar-vargas|
|maintainer-pilarvargas-tecnativa|

This module is part of the `OCA/sale-reporting <https://github.com/OCA/sale-reporting/tree/16.0/sale_report_salesperson_from_partner>`_ project on GitHub.

Expand Down
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
Expand Up @@ -422,7 +422,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/pilar-vargas"><img alt="pilar-vargas" src="https://github.com/pilar-vargas.png?size=40px" /></a></p>
<p><a class="reference external image-reference" href="https://github.com/pilarvargas-tecnativa"><img alt="pilarvargas-tecnativa" src="https://github.com/pilarvargas-tecnativa.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-reporting/tree/16.0/sale_report_salesperson_from_partner">OCA/sale-reporting</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +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.tests import Form, new_test_user

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

class SaleReportSalespersonFromPartner(common.TransactionCase):

class SaleReportSalespersonFromPartner(BaseCommon):
@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,
login="test_salesperson_from_partner",
Expand Down

0 comments on commit a7f5e53

Please sign in to comment.