Skip to content

Commit

Permalink
[MIG] website_sale_order_type: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-p-marques committed Oct 26, 2020
1 parent 721de79 commit 280385a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 18 deletions.
22 changes: 17 additions & 5 deletions website_sale_order_type/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Website sale order type
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github
:target: https://github.com/OCA/e-commerce/tree/10.0/website_sale_order_type
:target: https://github.com/OCA/e-commerce/tree/12.0/website_sale_order_type
:alt: OCA/e-commerce
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/e-commerce-10-0/e-commerce-10-0-website_sale_order_type
:target: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_order_type
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/113/10.0
:target: https://runbot.odoo-community.org/runbot/113/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -50,7 +50,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_order_type%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_order_type%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -67,6 +67,10 @@ Contributors

* Simone Rubino <simone.rubino@agilebg.com>

* `Tecnativa <https://www.tecnativa.com>`_:

* João Marques

Maintainers
~~~~~~~~~~~

Expand All @@ -80,6 +84,14 @@ 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.

This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/10.0/website_sale_order_type>`_ project on GitHub.
.. |maintainer-joao-p-marques| image:: https://github.com/joao-p-marques.png?size=40px
:target: https://github.com/joao-p-marques
:alt: joao-p-marques

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

|maintainer-joao-p-marques|

This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/12.0/website_sale_order_type>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 3 additions & 3 deletions website_sale_order_type/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
{
"name": "Website sale order type",
"summary": "This module allows sale_order_type to work with website_sale.",
"version": "11.0.1.0.0",
"version": "12.0.1.0.0",
"development_status": "Beta",
"category": "Website",
"website": "https://github.com/OCA/e-commerce/tree/"
"10.0/website_sale_order_type",
"website": "https://github.com/OCA/e-commerce/",
"maintainers": ["joao-p-marques"],
"author": "Agile Business Group, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
Expand Down
8 changes: 4 additions & 4 deletions website_sale_order_type/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def _cart_update(
res = super(SaleOrder, self)._cart_update(
product_id=product_id, line_id=line_id,
add_qty=add_qty, set_qty=set_qty, attributes=attributes, **kwargs)
if self.partner_id.sale_type:
self.type_id = self.partner_id.sale_type
self.onchange_type_id()
self.match_order_type()
sale_type = (self.partner_id.sale_type or
self.partner_id.commercial_partner_id.sale_type)
if sale_type:
self.type_id = sale_type
return res
18 changes: 14 additions & 4 deletions website_sale_order_type/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Website sale order type</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/e-commerce/tree/10.0/website_sale_order_type"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/e-commerce-10-0/e-commerce-10-0-website_sale_order_type"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/113/10.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/e-commerce/tree/12.0/website_sale_order_type"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_order_type"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/113/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/10.0/sale_order_type">sale_order_type</a> to work with website_sale.</p>
<p>This module is useful for users having a sale order type defined in their Partner form:
when these users buy a product in the e-commerce, the sale order generated will have the same sale order type that is defined in their Partner form.</p>
Expand Down Expand Up @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/e-commerce/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_order_type%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_order_type%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -411,8 +411,16 @@ <h2><a class="toc-backref" href="#id4">Authors</a></h2>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul>
<li><p class="first">Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;agilebg.com">simone.rubino&#64;agilebg.com</a>&gt;</p>
</li>
<li><p class="first"><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:</p>
<blockquote>
<ul class="simple">
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;agilebg.com">simone.rubino&#64;agilebg.com</a>&gt;</li>
<li>João Marques</li>
</ul>
</blockquote>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -422,7 +430,9 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/10.0/website_sale_order_type">OCA/e-commerce</a> project on GitHub.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/joao-p-marques"><img alt="joao-p-marques" src="https://github.com/joao-p-marques.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/12.0/website_sale_order_type">OCA/e-commerce</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>
</div>
Expand Down
4 changes: 2 additions & 2 deletions website_sale_order_type/tests/test_website_sale_order_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def setUp(self):
self.env = api.Environment(self.registry.test_cr, self.uid, {})
self.sale_type_model = self.env['sale.order.type']

self.partner = self.env.ref('base.partner_root')
self.partner = self.env.ref('base.partner_admin')
self.sale_type = self.create_sale_type()

def create_sale_type(self):
Expand All @@ -27,7 +27,7 @@ def create_sale_type(self):
self.immediate_payment = self.env.ref(
'account.account_payment_term_immediate')
self.sale_pricelist = self.env.ref('product.list0')
self.free_carrier = self.env.ref('stock.incoterm_FCA')
self.free_carrier = self.env.ref('account.incoterm_FCA')
return self.sale_type_model.create({
'name': 'Test Sale Order Type',
'sequence_id': self.sequence.id,
Expand Down

0 comments on commit 280385a

Please sign in to comment.