Skip to content

Commit

Permalink
[MIG] website_sale_vat_required: Migration to 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernesto Tejeda committed Oct 3, 2020
1 parent e9b6ad0 commit 860396e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 34 deletions.
10 changes: 5 additions & 5 deletions website_sale_vat_required/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ e-commerce required VAT
: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/12.0/website_sale_vat_required
:target: https://github.com/OCA/e-commerce/tree/13.0/website_sale_vat_required
: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-12-0/e-commerce-12-0-website_sale_vat_required
:target: https://translation.odoo-community.org/projects/e-commerce-13-0/e-commerce-13-0-website_sale_vat_required
: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/12.0
:target: https://runbot.odoo-community.org/runbot/113/13.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -49,7 +49,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_vat_required%0Aversion:%2012.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_vat_required%0Aversion:%2013.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 Down Expand Up @@ -84,6 +84,6 @@ 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/12.0/website_sale_vat_required>`_ project on GitHub.
This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/13.0/website_sale_vat_required>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
9 changes: 4 additions & 5 deletions website_sale_vat_required/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
{
"name": "e-commerce required VAT",
"summary": "VAT number required in checkout form",
"version": "12.0.1.0.0",
"version": "13.0.1.0.0",
"category": "Website",
"author": "Agile Business Group, " "Tecnativa, " "Odoo Community Association (OCA)",
"author": "Agile Business Group, Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/e-commerce",
"license": "AGPL-3",
"depends": ["website_sale", "base_vat",],
"data": ["views/templates.xml",],
"demo": ["demo/demo_assets.xml",],
"depends": ["website_sale", "base_vat"],
"data": ["views/templates.xml", "views/assets.xml"],
"installable": True,
"auto_install": False,
}
2 changes: 1 addition & 1 deletion website_sale_vat_required/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

class WebsiteSale(WebsiteSale):
def _get_mandatory_billing_fields(self):
result = super(WebsiteSale, self)._get_mandatory_billing_fields()
result = super()._get_mandatory_billing_fields()
result.append("vat")
return result
6 changes: 3 additions & 3 deletions website_sale_vat_required/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">e-commerce required VAT</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/12.0/website_sale_vat_required"><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_vat_required"><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><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/13.0/website_sale_vat_required"><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-13-0/e-commerce-13-0-website_sale_vat_required"><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/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends checkout e-commerce form in order to force user to fill
‘VAT number’ field.</p>
<p><strong>Table of contents</strong></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_vat_required%0Aversion:%2012.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_vat_required%0Aversion:%2013.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 Down Expand Up @@ -432,7 +432,7 @@ <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/12.0/website_sale_vat_required">OCA/e-commerce</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/13.0/website_sale_vat_required">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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ odoo.define("website_sale_vat_required.tour", function(require) {
content: "Set VAT",
trigger: "div.o_has_error label[for='vat']",
extra_trigger: "div.o_has_error label[for='vat']",
run: function(actions) {
run: function() {
$('div.o_has_error input[name="vat"]').val("US01234567891");
if ($("#div_phone").hasClass("o_has_error")) {
$("#div_phone input").val("11111111");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from odoo.tests.common import HttpCase


class TestUi(HttpCase):
class TestWebsiteSaleVatRequired(HttpCase):
def test_website_sale_vat_required(self):
self.env.user.partner_id.vat = False
self.browser_js(
Expand Down
File renamed without changes.
23 changes: 5 additions & 18 deletions website_sale_vat_required/views/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,11 @@
inherit_id="website_sale.address_b2b"
name="Address Management"
>
<xpath expr="//input[@name='vat']/.." position="replace" />
<xpath expr="//input[@name='company_name']/../.." position="after">
<t t-if="mode[1] == 'billing'">
<div
t-attf-class="form-group #{error.get('vat') and 'o_has_error' or ''} col-lg-6 div_vat"
>
<label
class="col-form-label font-weight-normal"
for="vat"
>TIN / VAT </label>
<input
type="text"
name="vat"
t-attf-class="form-control #{error.get('vat') and 'is-invalid' or ''}"
t-att-value="'vat' in checkout and checkout['vat']"
/>
</div>
</t>
<xpath
expr="//div[contains(@t-attf-class, 'div_vat')]/.."
position="attributes"
>
<attribute name="t-if">mode[1] == 'billing'</attribute>
</xpath>
</template>
</odoo>

0 comments on commit 860396e

Please sign in to comment.