Skip to content

Commit

Permalink
[MIG] sale_commercial_partner: Migration to 18.0
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Tran <[email protected]>
  • Loading branch information
BertVGroenendael and Lukas Tran committed Dec 18, 2024
1 parent 256cd2e commit bc5ec59
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 22 deletions.
32 changes: 23 additions & 9 deletions sale_commercial_partner/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ Usage

You can group by *Commercial Entity*:

- in *Sales > Orders > Quotations*,
- in *Sales > Orders > Orders*,
- in *Sales > Reporting > Sales* (it is a native feature in this menu)
- in *Sales > Orders > Quotations*,
- in *Sales > Orders > Orders*,
- in *Sales > Reporting > Sales* (it is a native feature in this menu)

Bug Tracker
===========
Expand All @@ -70,13 +70,27 @@ Authors
Contributors
------------

- Alexis de Lattre <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Rattapong Chokmasermkul <[email protected]>
- Tharathip Chaweewongphan <[email protected]>
- `APSL <https://apsl.tech>`__:
- Alexis de Lattre <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Rattapong Chokmasermkul <[email protected]>
- Tharathip Chaweewongphan <[email protected]>
- `APSL <https://apsl.tech>`__:

- Antoni Marroig <[email protected]>
- Antoni Marroig <[email protected]>

- `Dynapps <https://www.dynapps.eu>`__:

- Bert Van Groenendael <[email protected]>

- `Trobz <https://www.trobz.com>`__:

- Nhan Tran <[email protected]>

Other credits
-------------

The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion sale_commercial_partner/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Sale Commercial Partner",
"summary": "Add stored related field 'Commercial Entity' on sale orders",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"development_status": "Production/Stable",
"author": "Akretion,Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
Expand Down
4 changes: 4 additions & 0 deletions sale_commercial_partner/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
- Tharathip Chaweewongphan \<<[email protected]>\>
- [APSL](https://apsl.tech):
- Antoni Marroig \<<[email protected]>\>
- [Dynapps](https://www.dynapps.eu):
- Bert Van Groenendael \<<[email protected]>\>
- [Trobz](https://www.trobz.com):
- Nhan Tran \<<[email protected]>\>
2 changes: 2 additions & 0 deletions sale_commercial_partner/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp
18 changes: 16 additions & 2 deletions sale_commercial_partner/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ <h1 class="title">Sale Commercial Partner</h1>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-6">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -424,10 +425,23 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Antoni Marroig &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://www.dynapps.eu">Dynapps</a>:<ul>
<li>Bert Van Groenendael &lt;<a class="reference external" href="mailto:bert.vangroenendael&#64;dynapps.eu">bert.vangroenendael&#64;dynapps.eu</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://www.trobz.com">Trobz</a>:<ul>
<li>Nhan Tran &lt;<a class="reference external" href="mailto:nhant&#64;trobz.com">nhant&#64;trobz.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
<p>The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand Down
1 change: 1 addition & 0 deletions sale_commercial_partner/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_sale_commercial_partner
37 changes: 37 additions & 0 deletions sale_commercial_partner/tests/test_sale_commercial_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (C) 2018 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo.tests import Form
from odoo.tests.common import TransactionCase


class TestSaleCommercialPartner(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.commercial_partner = cls.env["res.partner"].create(
{
"is_company": False,
"name": "Commercial Partner",
}
)

cls.partner = cls.env["res.partner"].create(
{
"is_company": False,
"name": "Partner",
"parent_id": cls.commercial_partner.id,
}
)

def test_01_default_commercial_partner_on_sale_order(self):
"""
Test defaulting commercial partner on sale order
:return:
"""
with Form(self.env["sale.order"]) as order_form:
order_form.partner_id = self.partner
order_01 = order_form.save()

self.assertEqual(order_01.partner_id, self.partner)
self.assertEqual(order_01.commercial_partner_id, self.commercial_partner)
10 changes: 0 additions & 10 deletions sale_commercial_partner/views/sale_order.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
<odoo>
<record id="view_order_form" model="ir.ui.view">
<field name="name">commercial.partner.sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<field name="partner_id" position="before">
<field name="commercial_partner_id" invisible="1" />
</field>
</field>
</record>
<record id="view_sales_order_filter" model="ir.ui.view">
<field name="name">commercial.partner.sale.order.search</field>
<field name="model">sale.order</field>
Expand Down

0 comments on commit bc5ec59

Please sign in to comment.