Skip to content

Commit

Permalink
[MIG] website_sale_tax_toggle: Migration to v13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-teruel committed Feb 17, 2021
1 parent ec414be commit 0bd1c13
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 24 deletions.
6 changes: 6 additions & 0 deletions setup/website_sale_tax_toggle/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
10 changes: 5 additions & 5 deletions website_sale_tax_toggle/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Website Sale Tax Toggle
: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_tax_toggle
:target: https://github.com/OCA/e-commerce/tree/13.0/website_sale_tax_toggle
: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_tax_toggle
:target: https://translation.odoo-community.org/projects/e-commerce-13-0/e-commerce-13-0-website_sale_tax_toggle
: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 All @@ -46,7 +46,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_tax_toggle%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_tax_toggle%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 @@ -79,6 +79,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_tax_toggle>`_ project on GitHub.
This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/13.0/website_sale_tax_toggle>`_ 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_tax_toggle/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
{
"name": "Website Sale Tax Toggle",
"summary": "Allow display price in Shop with or without taxes",
"version": "12.0.1.1.1",
"version": "13.0.1.0.0",
"development_status": "Beta",
"category": "Website",
"website": "https://github.com/OCA/e-commerce",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["website_sale",],
"data": ["views/assets.xml", "views/templates.xml",],
"depends": ["website_sale"],
"data": ["views/assets.xml", "views/templates.xml"],
"demo": ["demo/assets.xml"],
}
6 changes: 3 additions & 3 deletions website_sale_tax_toggle/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 Tax Toggle</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_tax_toggle"><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_tax_toggle"><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_tax_toggle"><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_tax_toggle"><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 the functionality of website sale module adding a toggle
button to allow to user selects view prices with taxes included or without taxes.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -396,7 +396,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_tax_toggle%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_tax_toggle%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 @@ -427,7 +427,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_tax_toggle">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_tax_toggle">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 @@ -13,11 +13,10 @@ odoo.define("website_sale_tax_toggle.tax_toggle_button", function(require) {
},
_onPublishBtnClick: function(ev) {
ev.preventDefault();
var self = this;
var $data = $(ev.currentTarget).parents(".js_tax_toggle_management:first");
this._rpc({
route: $data.data("controller"),
}).done(function(result) {
}).then(function(result) {
$data.find("input").prop("checked", result);
window.location.reload();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ odoo.define("website_sale_tax_toggle.tour", function(require) {
var tour = require("web_tour.tour");
var base = require("web_editor.base");

// Notice that it's important targeting the price as `b .oe_currency_value`
// Notice that it's important targeting the price as `span .oe_currency_value`
// or `.oe_price .oe_currency_value` to make sure this test is compatible
// with website_sale_b2x_alt_price module in this same repo.
var steps = [
{
content: "Toggle tax button click from list page",
trigger: ".js_tax_toggle_btn",
extra_trigger:
".oe_product_cart:contains('Product test tax toggle') b .oe_currency_value:containsExact('750.00')",
".oe_product_cart:contains('Product test tax toggle') span .oe_currency_value:containsExact('750.00')",
},
{
content: "Enter the product page",
trigger:
".oe_product_cart:has(b .oe_currency_value:containsExact('862.50')) a:contains('Product test tax toggle')",
".oe_product_cart:has(span .oe_currency_value:containsExact('862.50')) a:contains('Product test tax toggle')",
},
{
content: "Toggle tax button click from product page",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This styles has been added from addons/web_editor/static/src/scss/web_editor.ui.scss
// This styles has been added from addons/website/static/src/scss/web_editor.ui.scss
// to apply styles for public user too.
// INPUTS
.o_switch {
Expand All @@ -15,15 +15,14 @@
box-shadow: inset 0 0 0px 1px darken($o-we-switch-inactive-color, 10%);
border-radius: 100rem;
height: $o-we-switch-size;
width: $o-we-switch-size * 1.81;
margin-right: 0.51em;
width: $o-we-switch-size * 1.8;
margin-right: 0.5em;
display: inline-block;
transition: all 0.3s $o-we-md-ease;
font-size: 15px;

&:after {
content: "";
background: $o-we-color-paper;
background: $o-we-bg-color;
display: block;
width: $o-we-switch-size - 0.2;
height: $o-we-switch-size - 0.2;
Expand All @@ -45,6 +44,7 @@
}
}
}

&.o_switch_danger {
> input {
&:not(:checked) + span {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ def setUp(self):
)
self.env.user.partner_id.property_product_pricelist = pricelist
# To avoid currency converter
self.env["res.currency.rate"].search([]).write(
{"rate": 1,}
)
self.env["res.currency.rate"].search([]).write({"rate": 1})

def test_ui_website(self):
"""Test frontend tour."""
Expand Down
Empty file modified website_sale_tax_toggle/views/templates.xml
100755 → 100644
Empty file.

0 comments on commit 0bd1c13

Please sign in to comment.