+
+
+
+
+
+
+ Clear Filters
+
+
+
From 952d33f2812a3caf98fccbae80b1e6e396a478d2 Mon Sep 17 00:00:00 2001
From: eLBati
Date: Mon, 4 Jun 2018 16:54:54 +0200
Subject: [PATCH 005/101] ADD website_sale_charge_payment_fee
ADD website_sale_charge_payment_fee_delivery: link module
ADD website_sale_charge_payment_fee_quote: link module
---
website_sale_charge_payment_fee/README.rst | 82 ++++
website_sale_charge_payment_fee/__init__.py | 5 +
.../__manifest__.py | 23 +
.../controllers/__init__.py | 4 +
.../controllers/website_sale.py | 31 ++
website_sale_charge_payment_fee/i18n/it.po | 105 +++++
.../i18n/website_sale_charge_payment_fee.pot | 96 ++++
.../models/__init__.py | 5 +
.../models/payment.py | 32 ++
.../models/sale.py | 44 ++
.../readme/CONFIGURE.rst | 5 +
.../readme/CONTRIBUTORS.rst | 1 +
.../readme/DESCRIPTION.rst | 1 +
.../static/description/index.html | 426 ++++++++++++++++++
.../static/src/js/website_sale_fee.js | 26 ++
.../templates/website_sale.xml | 60 +++
.../views/payment_view.xml | 40 ++
17 files changed, 986 insertions(+)
create mode 100644 website_sale_charge_payment_fee/README.rst
create mode 100644 website_sale_charge_payment_fee/__init__.py
create mode 100644 website_sale_charge_payment_fee/__manifest__.py
create mode 100644 website_sale_charge_payment_fee/controllers/__init__.py
create mode 100644 website_sale_charge_payment_fee/controllers/website_sale.py
create mode 100644 website_sale_charge_payment_fee/i18n/it.po
create mode 100644 website_sale_charge_payment_fee/i18n/website_sale_charge_payment_fee.pot
create mode 100644 website_sale_charge_payment_fee/models/__init__.py
create mode 100644 website_sale_charge_payment_fee/models/payment.py
create mode 100644 website_sale_charge_payment_fee/models/sale.py
create mode 100644 website_sale_charge_payment_fee/readme/CONFIGURE.rst
create mode 100644 website_sale_charge_payment_fee/readme/CONTRIBUTORS.rst
create mode 100644 website_sale_charge_payment_fee/readme/DESCRIPTION.rst
create mode 100644 website_sale_charge_payment_fee/static/description/index.html
create mode 100644 website_sale_charge_payment_fee/static/src/js/website_sale_fee.js
create mode 100644 website_sale_charge_payment_fee/templates/website_sale.xml
create mode 100644 website_sale_charge_payment_fee/views/payment_view.xml
diff --git a/website_sale_charge_payment_fee/README.rst b/website_sale_charge_payment_fee/README.rst
new file mode 100644
index 0000000000..6ae8a6e2f7
--- /dev/null
+++ b/website_sale_charge_payment_fee/README.rst
@@ -0,0 +1,82 @@
+=============================
+eCommerce: charge payment fee
+=============================
+
+.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Beta
+.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
+ :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
+ :alt: License: LGPL-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_charge_payment_fee
+ :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_charge_payment_fee
+ :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
+ :alt: Try me on Runbot
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module allows to associate generic payment fee to online payment methods. Thus, when website user select a payment method with additional fee, an additional sale order line will be added to online order
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Configuration
+=============
+
+Click
+
+Accounting -> Configuration -> Payments -> Payment Acquirers
+
+open an acquirer and in CHARGE PAYMENT FEE tab, you can set the fee to be charged to customer.
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub 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 `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
+Credits
+=======
+
+Authors
+~~~~~~~
+
+* Agile Business Group
+
+Contributors
+~~~~~~~~~~~~
+
+* Lorenzo Battistini
+
+Maintainers
+~~~~~~~~~~~
+
+This module is maintained by the OCA.
+
+.. image:: https://odoo-community.org/logo.png
+ :alt: Odoo Community Association
+ :target: https://odoo-community.org
+
+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 `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/website_sale_charge_payment_fee/__init__.py b/website_sale_charge_payment_fee/__init__.py
new file mode 100644
index 0000000000..17a5bf9ce5
--- /dev/null
+++ b/website_sale_charge_payment_fee/__init__.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
+
+from . import models
+from . import controllers
diff --git a/website_sale_charge_payment_fee/__manifest__.py b/website_sale_charge_payment_fee/__manifest__.py
new file mode 100644
index 0000000000..18e2f6b951
--- /dev/null
+++ b/website_sale_charge_payment_fee/__manifest__.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Copyright 2018 Lorenzo Battistini - Agile Business Group
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
+
+{
+ "name": "eCommerce: charge payment fee",
+ "summary": "Payment fee charged to customer",
+ "version": "10.0.1.0.0",
+ "development_status": "Beta",
+ "category": "Website",
+ "website": "https://github.com/OCA/e-commerce",
+ "author": "Agile Business Group, Odoo Community Association (OCA)",
+ "license": "LGPL-3",
+ "application": False,
+ "installable": True,
+ "depends": [
+ "website_sale",
+ ],
+ "data": [
+ "views/payment_view.xml",
+ "templates/website_sale.xml"
+ ],
+}
diff --git a/website_sale_charge_payment_fee/controllers/__init__.py b/website_sale_charge_payment_fee/controllers/__init__.py
new file mode 100644
index 0000000000..ac49d820bd
--- /dev/null
+++ b/website_sale_charge_payment_fee/controllers/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
+
+from . import website_sale
diff --git a/website_sale_charge_payment_fee/controllers/website_sale.py b/website_sale_charge_payment_fee/controllers/website_sale.py
new file mode 100644
index 0000000000..50cf76fdef
--- /dev/null
+++ b/website_sale_charge_payment_fee/controllers/website_sale.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
+
+from odoo.http import request
+from odoo import http
+from odoo.addons.website_sale.controllers.main import WebsiteSale
+
+
+class WebsiteSaleFee(WebsiteSale):
+
+ @http.route()
+ def payment(self, **post):
+ res = super(WebsiteSaleFee, self).payment(**post)
+ values = res.qcontext
+ order = request.website.sale_get_order()
+ payment_fee_id = post.get('payment_fee_id')
+ if payment_fee_id or 'acquirers' in values:
+ # If 'acquirers' in values, default behaviour when acquirers are
+ # present, we update the order with the first one
+ # (see 'payment' template)
+ # If payment_fee_id, it means user selected it
+ # (see website_sale_fee.js)
+ if payment_fee_id:
+ selected_acquirer = request.env[
+ 'payment.acquirer'].browse(int(payment_fee_id))
+ values['selected_acquirer'] = selected_acquirer
+ else:
+ selected_acquirer = values['acquirers'][0]
+ order.sudo().update_fee_line(selected_acquirer.sudo())
+ return request.render("website_sale.payment", values)
+ return res
diff --git a/website_sale_charge_payment_fee/i18n/it.po b/website_sale_charge_payment_fee/i18n/it.po
new file mode 100644
index 0000000000..911aa9afa3
--- /dev/null
+++ b/website_sale_charge_payment_fee/i18n/it.po
@@ -0,0 +1,105 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * website_sale_charge_payment_fee
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 10.0+e\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-06-08 10:08+0000\n"
+"PO-Revision-Date: 2018-06-08 10:08+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.ui.view,arch_db:website_sale_charge_payment_fee.payment_fee
+msgid "(Fee:"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,help:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee
+msgid ""
+"An extra fee line will be added to online order when using this payment "
+"method"
+msgstr ""
+"Una tariffa aggiuntiva verrà aggiunta all'ordine online quando si utilizza "
+"questo metodo di pagamento"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.ui.view,arch_db:website_sale_charge_payment_fee.acquirer_form_fee
+msgid "Charge payment fee"
+msgstr "Addebita tariffa di pagamento"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_type
+msgid "Computation type"
+msgstr "Tipo di calcolo"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_description
+msgid "Fee Description"
+msgstr "Descrizione tariffa"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_product_id
+msgid "Fee Product"
+msgstr "Prodotto tariffa"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee
+msgid "Fee charged to customer"
+msgstr "Tariffa addebitata al cliente"
+
+#. module: website_sale_charge_payment_fee
+#: selection:payment.acquirer,charge_fee_type:0
+msgid "Fixed"
+msgstr "Fisso"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_fixed_price
+msgid "Fixed Price"
+msgstr "Prezzo Fisso"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model,name:website_sale_charge_payment_fee.model_payment_acquirer
+msgid "Payment Acquirer"
+msgstr "Acquirente di Pagamento"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_sale_order_line_payment_fee_line
+msgid "Payment fee line"
+msgstr "Riga tariffa pagamento"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_percentage
+#: selection:payment.acquirer,charge_fee_type:0
+msgid "Percentage"
+msgstr "Percentuale"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,help:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_percentage
+msgid "Percentage applied to order total"
+msgstr "Percentuale applicata al totale dell'ordine"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model,name:website_sale_charge_payment_fee.model_sale_order
+msgid "Sales Order"
+msgstr "Ordine di vendita"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model,name:website_sale_charge_payment_fee.model_sale_order_line
+msgid "Sales Order Line"
+msgstr "Riga d'Ordine di Vendita"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_tax_ids
+msgid "Taxes"
+msgstr "Imposte"
+
+#~ msgid "(Fee:"
+#~ msgstr "(Tariffa:"
diff --git a/website_sale_charge_payment_fee/i18n/website_sale_charge_payment_fee.pot b/website_sale_charge_payment_fee/i18n/website_sale_charge_payment_fee.pot
new file mode 100644
index 0000000000..9b18067401
--- /dev/null
+++ b/website_sale_charge_payment_fee/i18n/website_sale_charge_payment_fee.pot
@@ -0,0 +1,96 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * website_sale_charge_payment_fee
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 10.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.ui.view,arch_db:website_sale_charge_payment_fee.payment_fee
+msgid "(Fee:"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,help:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee
+msgid "An extra fee line will be added to online order when using this payment method"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.ui.view,arch_db:website_sale_charge_payment_fee.acquirer_form_fee
+msgid "Charge payment fee"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_type
+msgid "Computation type"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_description
+msgid "Fee Description"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_product_id
+msgid "Fee Product"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee
+msgid "Fee charged to customer"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: selection:payment.acquirer,charge_fee_type:0
+msgid "Fixed"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_fixed_price
+msgid "Fixed Price"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model,name:website_sale_charge_payment_fee.model_payment_acquirer
+msgid "Payment Acquirer"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_sale_order_line_payment_fee_line
+msgid "Payment fee line"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_percentage
+#: selection:payment.acquirer,charge_fee_type:0
+msgid "Percentage"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,help:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_percentage
+msgid "Percentage applied to order total"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model,name:website_sale_charge_payment_fee.model_sale_order
+msgid "Sales Order"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model,name:website_sale_charge_payment_fee.model_sale_order_line
+msgid "Sales Order Line"
+msgstr ""
+
+#. module: website_sale_charge_payment_fee
+#: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_acquirer_charge_fee_tax_ids
+msgid "Taxes"
+msgstr ""
+
diff --git a/website_sale_charge_payment_fee/models/__init__.py b/website_sale_charge_payment_fee/models/__init__.py
new file mode 100644
index 0000000000..b80a3a9e3e
--- /dev/null
+++ b/website_sale_charge_payment_fee/models/__init__.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
+
+from . import payment
+from . import sale
diff --git a/website_sale_charge_payment_fee/models/payment.py b/website_sale_charge_payment_fee/models/payment.py
new file mode 100644
index 0000000000..3788f0acf1
--- /dev/null
+++ b/website_sale_charge_payment_fee/models/payment.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
+
+from odoo import models, fields, api
+import odoo.addons.decimal_precision as dp
+
+
+class PaymentAcquirer(models.Model):
+ _inherit = 'payment.acquirer'
+
+ charge_fee = fields.Boolean(
+ "Fee charged to customer",
+ help="An extra fee line will be added to online order when using this "
+ "payment method")
+ charge_fee_description = fields.Text("Fee Description")
+ charge_fee_product_id = fields.Many2one(
+ 'product.product', string="Fee Product")
+ charge_fee_tax_ids = fields.Many2many(
+ 'account.tax', string='Taxes')
+ charge_fee_fixed_price = fields.Float(
+ 'Fixed Price', digits=dp.get_precision('Product Price'))
+ charge_fee_percentage = fields.Float(
+ 'Percentage', help="Percentage applied to order total")
+ charge_fee_type = fields.Selection([
+ ('fixed', 'Fixed'),
+ ('percentage', 'Percentage'),
+ ], string="Computation type", default='fixed')
+
+ @api.onchange("charge_fee_product_id")
+ def onchange_charge_fee_product_id(self):
+ if self.charge_fee_product_id:
+ self.charge_fee_description = self.charge_fee_product_id.name
diff --git a/website_sale_charge_payment_fee/models/sale.py b/website_sale_charge_payment_fee/models/sale.py
new file mode 100644
index 0000000000..989f9a79a2
--- /dev/null
+++ b/website_sale_charge_payment_fee/models/sale.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
+
+from odoo import models, fields
+
+
+class SaleOrder(models.Model):
+ _inherit = 'sale.order'
+
+ def update_fee_line(self, acquirer):
+ for line in self.order_line:
+ if line.payment_fee_line:
+ line.unlink()
+ if acquirer.charge_fee:
+ if acquirer.charge_fee_type == 'fixed':
+ price = acquirer.charge_fee_fixed_price
+ if (
+ self.company_id.currency_id.id !=
+ self.pricelist_id.currency_id.id
+ ):
+ price = self.company_id.currency_id.with_context(
+ date=self.date_order
+ ).compute(price, self.pricelist_id.currency_id)
+ elif acquirer.charge_fee_type == 'percentage':
+ price = (
+ acquirer.charge_fee_percentage / 100.0
+ ) * self.amount_total
+ self.env['sale.order.line'].create({
+ 'order_id': self.id,
+ 'payment_fee_line': True,
+ 'product_id': acquirer.charge_fee_product_id.id,
+ 'product_uom': acquirer.charge_fee_product_id.uom_id.id,
+ 'name': acquirer.charge_fee_description,
+ 'price_unit': price,
+ 'product_uom_qty': 1,
+ 'tax_id': [
+ (6, 0, [t.id for t in acquirer.charge_fee_tax_ids])
+ ],
+ })
+
+
+class SaleOrderLine(models.Model):
+ _inherit = 'sale.order.line'
+ payment_fee_line = fields.Boolean("Payment fee line", readonly=True)
diff --git a/website_sale_charge_payment_fee/readme/CONFIGURE.rst b/website_sale_charge_payment_fee/readme/CONFIGURE.rst
new file mode 100644
index 0000000000..66a127433f
--- /dev/null
+++ b/website_sale_charge_payment_fee/readme/CONFIGURE.rst
@@ -0,0 +1,5 @@
+Click
+
+Accounting -> Configuration -> Payments -> Payment Acquirers
+
+open an acquirer and in CHARGE PAYMENT FEE tab, you can set the fee to be charged to customer.
diff --git a/website_sale_charge_payment_fee/readme/CONTRIBUTORS.rst b/website_sale_charge_payment_fee/readme/CONTRIBUTORS.rst
new file mode 100644
index 0000000000..65a7e30bc6
--- /dev/null
+++ b/website_sale_charge_payment_fee/readme/CONTRIBUTORS.rst
@@ -0,0 +1 @@
+* Lorenzo Battistini
diff --git a/website_sale_charge_payment_fee/readme/DESCRIPTION.rst b/website_sale_charge_payment_fee/readme/DESCRIPTION.rst
new file mode 100644
index 0000000000..229cd5325a
--- /dev/null
+++ b/website_sale_charge_payment_fee/readme/DESCRIPTION.rst
@@ -0,0 +1 @@
+This module allows to associate generic payment fee to online payment methods. Thus, when website user select a payment method with additional fee, an additional sale order line will be added to online order
diff --git a/website_sale_charge_payment_fee/static/description/index.html b/website_sale_charge_payment_fee/static/description/index.html
new file mode 100644
index 0000000000..f2a0c18070
--- /dev/null
+++ b/website_sale_charge_payment_fee/static/description/index.html
@@ -0,0 +1,426 @@
+
+
+
+
+
+
+eCommerce: charge payment fee
+
+
+
+
+
eCommerce: charge payment fee
+
+
+
+
This module allows to associate generic payment fee to online payment methods. Thus, when website user select a payment method with additional fee, an additional sale order line will be added to online order
Bugs are tracked on GitHub 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.
+
Do not contact contributors directly about support or help with technical issues.
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 project on GitHub.
This module extends the functionality of website sale module to allow to
+display the minimal price in ‘/shop’ view when product has distinct variants
+price and set order by minimal price in product’s view.
Bugs are tracked on GitHub 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.
+
Do not contact contributors directly about support or help with technical issues.
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 project on GitHub.
+
+
diff --git a/website_sale_product_minimal_price/static/src/js/website_sale_product_minimal_price_tour.js b/website_sale_product_minimal_price/static/src/js/website_sale_product_minimal_price_tour.js
new file mode 100644
index 0000000000..72a56fe11d
--- /dev/null
+++ b/website_sale_product_minimal_price/static/src/js/website_sale_product_minimal_price_tour.js
@@ -0,0 +1,31 @@
+/* Copyright 2019 Sergio Teruel
+ * License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */
+
+odoo.define("website_sale_product_minimal_price.tour", function (require) {
+ "use strict";
+
+ var tour = require("web_tour.tour");
+ var base = require("web_editor.base");
+
+ var steps = [
+ {
+ trigger: "a:contains('My product test')",
+ extra_trigger: ".product_price:has(span:contains('From '))",
+ },
+ {
+ trigger: "a[href='/shop']",
+ extra_trigger: ".js_attribute_value:eq(0):has(span:contains('Test v1'))",
+ },
+ ];
+ tour.register("website_sale_product_minimal_price",
+ {
+ url: "/shop",
+ test: true,
+ wait_for: base.ready(),
+ },
+ steps
+ );
+ return {
+ steps: steps,
+ };
+});
diff --git a/website_sale_product_minimal_price/tests/__init__.py b/website_sale_product_minimal_price/tests/__init__.py
new file mode 100644
index 0000000000..3feff797da
--- /dev/null
+++ b/website_sale_product_minimal_price/tests/__init__.py
@@ -0,0 +1 @@
+from . import test_website_sale_product_minimal_price
diff --git a/website_sale_product_minimal_price/tests/test_website_sale_product_minimal_price.py b/website_sale_product_minimal_price/tests/test_website_sale_product_minimal_price.py
new file mode 100644
index 0000000000..bcaf4d6b07
--- /dev/null
+++ b/website_sale_product_minimal_price/tests/test_website_sale_product_minimal_price.py
@@ -0,0 +1,18 @@
+# Copyright 2019 Tecnativa - Sergio Teruel
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+from odoo.tests.common import HttpCase
+
+
+class WebsiteSaleProductMinimalPriceHttpCase(HttpCase):
+
+ def test_ui_website(self):
+ """Test frontend tour."""
+ tour = (
+ "odoo.__DEBUG__.services['web_tour.tour']",
+ "website_sale_product_minimal_price",
+ )
+ self.phantom_js(
+ url_path="/",
+ code="%s.run('%s')" % tour,
+ ready="%s.tours['%s'].ready" % tour,
+ )
diff --git a/website_sale_product_minimal_price/views/assets.xml b/website_sale_product_minimal_price/views/assets.xml
new file mode 100644
index 0000000000..e3da2ba84f
--- /dev/null
+++ b/website_sale_product_minimal_price/views/assets.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
diff --git a/website_sale_product_minimal_price/views/templates.xml b/website_sale_product_minimal_price/views/templates.xml
new file mode 100755
index 0000000000..be6aabbe0d
--- /dev/null
+++ b/website_sale_product_minimal_price/views/templates.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+ sorted_values
+
+
+ sorted_values
+
+
+ sorted_values
+
+
+
+
+
+
+
+ From
+
+
+
+
+
From 14682130782f84f7ad7965731f1d945db05ada6c Mon Sep 17 00:00:00 2001
From: Sergio Teruel
Date: Thu, 12 Dec 2019 00:25:49 +0100
Subject: [PATCH 024/101] [MIG] website_sale_product_minimal_price: Migration
to v12.0
---
website_sale_product_minimal_price/README.rst | 22 ++++---
.../__manifest__.py | 8 +--
.../data/demo.xml | 49 ---------------
website_sale_product_minimal_price/i18n/es.po | 43 +++++--------
.../website_sale_product_minimal_price.pot | 35 +++--------
.../models/product_template.py | 61 ++++++++++++++++---
.../static/description/index.html | 8 ++-
...website_sale_product_minimal_price_tour.js | 9 ++-
...test_website_sale_product_minimal_price.py | 60 +++++++++++++++++-
.../views/templates.xml | 16 +++--
10 files changed, 171 insertions(+), 140 deletions(-)
delete mode 100644 website_sale_product_minimal_price/data/demo.xml
diff --git a/website_sale_product_minimal_price/README.rst b/website_sale_product_minimal_price/README.rst
index a3785b9696..bc11d1335f 100644
--- a/website_sale_product_minimal_price/README.rst
+++ b/website_sale_product_minimal_price/README.rst
@@ -7,20 +7,20 @@ Website Sale Product Minimal Price
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
+.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
- :alt: Beta
+ :alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
: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/11.0/website_sale_product_minimal_price
+ :target: https://github.com/OCA/e-commerce/tree/12.0/website_sale_product_minimal_price
: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-11-0/e-commerce-11-0-website_sale_product_minimal_price
+ :target: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_product_minimal_price
: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/11.0
+ :target: https://runbot.odoo-community.org/runbot/113/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -50,7 +50,7 @@ Bug Tracker
Bugs are tracked on `GitHub 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -82,6 +82,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 `_ project on GitHub.
+.. |maintainer-sergio-teruel| image:: https://github.com/sergio-teruel.png?size=40px
+ :target: https://github.com/sergio-teruel
+ :alt: sergio-teruel
+
+Current `maintainer `__:
+
+|maintainer-sergio-teruel|
+
+This module is part of the `OCA/e-commerce `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/website_sale_product_minimal_price/__manifest__.py b/website_sale_product_minimal_price/__manifest__.py
index fbfba46aa5..516561f762 100644
--- a/website_sale_product_minimal_price/__manifest__.py
+++ b/website_sale_product_minimal_price/__manifest__.py
@@ -3,8 +3,9 @@
{
'name': 'Website Sale Product Minimal Price',
'summary': 'Display minimal price for products that has variants',
- 'version': '11.0.1.0.0',
- 'development_status': 'Beta',
+ 'version': '12.0.1.0.0',
+ 'development_status': 'Production/Stable',
+ 'maintainers': ['sergio-teruel'],
'category': 'Website',
'website': 'https://github.com/OCA/e-commerce',
'author': 'Tecnativa, Odoo Community Association (OCA)',
@@ -18,7 +19,4 @@
'views/assets.xml',
'views/templates.xml',
],
- 'demo': [
- 'data/demo.xml',
- ],
}
diff --git a/website_sale_product_minimal_price/data/demo.xml b/website_sale_product_minimal_price/data/demo.xml
deleted file mode 100644
index a21fe954fd..0000000000
--- a/website_sale_product_minimal_price/data/demo.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
- Test attribute
-
-
-
- Test v1
-
-
-
- Test v2
-
-
-
- My product test with various prices
- 20.0
- consu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 5.0
-
-
-
-
- 10.0
-
-
-
diff --git a/website_sale_product_minimal_price/i18n/es.po b/website_sale_product_minimal_price/i18n/es.po
index db2e5e2335..989d4e6118 100644
--- a/website_sale_product_minimal_price/i18n/es.po
+++ b/website_sale_product_minimal_price/i18n/es.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-05-07 14:11+0000\n"
-"PO-Revision-Date: 2019-05-07 16:13+0200\n"
+"POT-Creation-Date: 2019-12-11 23:22+0000\n"
+"PO-Revision-Date: 2019-12-12 00:24+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
@@ -18,40 +18,29 @@ msgstr ""
"X-Generator: Poedit 2.0.6\n"
#. module: website_sale_product_minimal_price
-#: model:ir.ui.view,arch_db:website_sale_product_minimal_price.products_item
+#: model_terms:ir.ui.view,arch_db:website_sale_product_minimal_price.products_item
msgid "From "
msgstr "Desde "
#. module: website_sale_product_minimal_price
-#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_product_has_distinct_variant_price
-#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_template_has_distinct_variant_price
-msgid "Has variants with distinct extra"
-msgstr ""
-
-#. module: website_sale_product_minimal_price
-#: model:product.product,name:website_sale_product_minimal_price.product_product_test_1
-#: model:product.product,name:website_sale_product_minimal_price.product_product_test_2
-#: model:product.template,name:website_sale_product_minimal_price.product_product_test_1_product_template
-#: model:product.template,name:website_sale_product_minimal_price.product_product_test_2_product_template
-msgid "My product test with various prices"
-msgstr "Mi producto de test con varios precios"
+#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_product__has_distinct_variant_price
+#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_template__has_distinct_variant_price
+msgid "Has variants with distinct price extra"
+msgstr "Tiene variantes con diferentes precios extra"
#. module: website_sale_product_minimal_price
#: model:ir.model,name:website_sale_product_minimal_price.model_product_template
msgid "Product Template"
msgstr "Plantilla de producto"
-#. module: website_sale_product_minimal_price
-#: model:product.attribute,name:website_sale_product_minimal_price.product_attribute_test
-msgid "Test attribute"
-msgstr "Atributo de prueba"
+#~ msgid "My product test with various prices"
+#~ msgstr "Mi producto de test con varios precios"
-#. module: website_sale_product_minimal_price
-#: model:product.attribute.value,name:website_sale_product_minimal_price.product_attribute_value_test_1
-msgid "Test v1"
-msgstr "Valor 1 de test"
+#~ msgid "Test attribute"
+#~ msgstr "Atributo de prueba"
-#. module: website_sale_product_minimal_price
-#: model:product.attribute.value,name:website_sale_product_minimal_price.product_attribute_value_test_2
-msgid "Test v2"
-msgstr "Valor 2 de test"
+#~ msgid "Test v1"
+#~ msgstr "Valor 1 de test"
+
+#~ msgid "Test v2"
+#~ msgstr "Valor 2 de test"
diff --git a/website_sale_product_minimal_price/i18n/website_sale_product_minimal_price.pot b/website_sale_product_minimal_price/i18n/website_sale_product_minimal_price.pot
index be41c4a889..2bb3e5cb10 100644
--- a/website_sale_product_minimal_price/i18n/website_sale_product_minimal_price.pot
+++ b/website_sale_product_minimal_price/i18n/website_sale_product_minimal_price.pot
@@ -4,8 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 11.0\n"
+"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-12-11 23:22+0000\n"
+"PO-Revision-Date: 2019-12-11 23:22+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -14,22 +16,14 @@ msgstr ""
"Plural-Forms: \n"
#. module: website_sale_product_minimal_price
-#: model:ir.ui.view,arch_db:website_sale_product_minimal_price.products_item
+#: model_terms:ir.ui.view,arch_db:website_sale_product_minimal_price.products_item
msgid "From "
msgstr ""
#. module: website_sale_product_minimal_price
-#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_product_has_distinct_variant_price
-#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_template_has_distinct_variant_price
-msgid "Has variants with distinct extra"
-msgstr ""
-
-#. module: website_sale_product_minimal_price
-#: model:product.product,name:website_sale_product_minimal_price.product_product_test_1
-#: model:product.product,name:website_sale_product_minimal_price.product_product_test_2
-#: model:product.template,name:website_sale_product_minimal_price.product_product_test_1_product_template
-#: model:product.template,name:website_sale_product_minimal_price.product_product_test_2_product_template
-msgid "My product test with various prices"
+#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_product__has_distinct_variant_price
+#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_template__has_distinct_variant_price
+msgid "Has variants with distinct price extra"
msgstr ""
#. module: website_sale_product_minimal_price
@@ -37,18 +31,3 @@ msgstr ""
msgid "Product Template"
msgstr ""
-#. module: website_sale_product_minimal_price
-#: model:product.attribute,name:website_sale_product_minimal_price.product_attribute_test
-msgid "Test attribute"
-msgstr ""
-
-#. module: website_sale_product_minimal_price
-#: model:product.attribute.value,name:website_sale_product_minimal_price.product_attribute_value_test_1
-msgid "Test v1"
-msgstr ""
-
-#. module: website_sale_product_minimal_price
-#: model:product.attribute.value,name:website_sale_product_minimal_price.product_attribute_value_test_2
-msgid "Test v2"
-msgstr ""
-
diff --git a/website_sale_product_minimal_price/models/product_template.py b/website_sale_product_minimal_price/models/product_template.py
index 5e19bf9d20..6fcf9eaa55 100644
--- a/website_sale_product_minimal_price/models/product_template.py
+++ b/website_sale_product_minimal_price/models/product_template.py
@@ -8,7 +8,7 @@ class ProductTemplate(models.Model):
has_distinct_variant_price = fields.Boolean(
compute='_compute_has_distinct_variant_price',
- string='Has variants with distinct extra',
+ string='Has variants with distinct price extra',
)
def _compute_has_distinct_variant_price(self):
@@ -18,12 +18,53 @@ def _compute_has_distinct_variant_price(self):
if len(prices) > 1:
template.has_distinct_variant_price = True
- def _website_price(self):
- templates = self.filtered(lambda x: x.product_variant_count > 1)
- super(ProductTemplate, self - templates)._website_price()
- for product in templates:
- variant = product.product_variant_ids.sorted(
- key=lambda p: p.website_price)[:1]
- product.website_price = variant.website_price
- product.website_public_price = variant.website_public_price
- product.website_price_difference = variant.website_price_difference
+ def _get_combination_info(
+ self, combination=False, product_id=False, add_qty=1, pricelist=False,
+ parent_combination=False, only_template=False):
+ """
+ Update product template prices for products items view in website shop
+ render with cheaper variant prices.
+ """
+ combination_info = super()._get_combination_info(
+ combination=combination, product_id=product_id, add_qty=add_qty,
+ pricelist=pricelist, parent_combination=parent_combination,
+ only_template=only_template)
+
+ if (only_template and self.env.context.get('website_id') and
+ self.product_variant_count > 1):
+ cheaper_variant = self.product_variant_ids.sorted(
+ key=lambda p: p.price_extra)[:1]
+
+ res = cheaper_variant._get_combination_info_variant()
+
+ combination_info.update({
+ 'price': res.get('price'),
+ 'list_price': res.get('list_price'),
+ 'has_discounted_price': res.get('has_discounted_price'),
+ })
+ return combination_info
+
+ def _get_first_possible_combination(
+ self, parent_combination=None, necessary_values=None):
+ """
+ Get the cheaper product combination for the product for website view.
+ We only take into account attributes that generate variants and
+ products with more than one variant.
+ """
+ combination = super()._get_first_possible_combination(
+ parent_combination=parent_combination,
+ necessary_values=necessary_values
+ )
+ if (self.env.context.get('website_id') and
+ self.product_variant_count > 1):
+ ptav_obj = self.env['product.template.attribute.value']
+ pav = self.product_variant_ids.sorted(
+ 'lst_price')[:1].attribute_value_ids
+ cheaper_combination = ptav_obj.search([
+ ('product_tmpl_id', '=', self.id),
+ ('product_attribute_value_id', 'in', pav.ids),
+ ])
+ variant_combination = combination.filtered(
+ lambda x: x.attribute_id.create_variant == 'always')
+ return cheaper_combination + (combination - variant_combination)
+ return combination
diff --git a/website_sale_product_minimal_price/static/description/index.html b/website_sale_product_minimal_price/static/description/index.html
index 7a7887680c..9f1c74c784 100644
--- a/website_sale_product_minimal_price/static/description/index.html
+++ b/website_sale_product_minimal_price/static/description/index.html
@@ -367,7 +367,7 @@
Website Sale Product Minimal Price
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module extends the functionality of website sale module to allow to
display the minimal price in ‘/shop’ view when product has distinct variants
price and set order by minimal price in product’s view.
Bugs are tracked on GitHub 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.
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 project on GitHub.
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module extends the functionality of website sale module to allow to
display the minimal price in ‘/shop’ view when product has distinct variants
price and set order by minimal price in product’s view.
Bugs are tracked on GitHub 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.
Bugs are tracked on GitHub 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
@@ -404,28 +412,29 @@
');
$form.append(
@@ -75,7 +75,7 @@ odoo.define("website_sale_product_minimal_price.load", function(require) {
*
* @override
*/
- _onChangeCombination: function() {
+ _onChangeCombination: function () {
VariantMixin._onChangeQtyWebsiteSale.apply(this, arguments);
return this._super.apply(this, arguments);
},
diff --git a/website_sale_product_minimal_price/tests/test_product_with_no_prices.py b/website_sale_product_minimal_price/tests/test_product_with_no_prices.py
index c86f783366..88504087b7 100644
--- a/website_sale_product_minimal_price/tests/test_product_with_no_prices.py
+++ b/website_sale_product_minimal_price/tests/test_product_with_no_prices.py
@@ -4,9 +4,9 @@
class TestProductWithNoPrices(HttpCase):
- """ With this test we are checking that the minimal price is set
- when the product has not a price defined and the price of
- variants depend on a subpricelist.
+ """With this test we are checking that the minimal price is set
+ when the product has not a price defined and the price of
+ variants depend on a subpricelist.
"""
def setUp(self):
From 34a3b43eee71bf529f64fad5b1ae7cacac2a5c09 Mon Sep 17 00:00:00 2001
From: miguels73 <55379877+miguels73@users.noreply.github.com>
Date: Thu, 15 Jul 2021 10:24:56 +0200
Subject: [PATCH 036/101] [MIG] website_sale_product_minimal_price: Migration
to 14.0
---
website_sale_product_minimal_price/README.rst | 10 +++++-----
.../__manifest__.py | 2 +-
.../i18n/website_sale_product_minimal_price.pot | 17 ++++++++++++++++-
.../static/description/index.html | 6 +++---
4 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/website_sale_product_minimal_price/README.rst b/website_sale_product_minimal_price/README.rst
index 66710adb25..2bbcbf7110 100644
--- a/website_sale_product_minimal_price/README.rst
+++ b/website_sale_product_minimal_price/README.rst
@@ -14,13 +14,13 @@ Website Sale Product Minimal Price
: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/13.0/website_sale_product_minimal_price
+ :target: https://github.com/OCA/e-commerce/tree/14.0/website_sale_product_minimal_price
: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-13-0/e-commerce-13-0-website_sale_product_minimal_price
+ :target: https://translation.odoo-community.org/projects/e-commerce-14-0/e-commerce-14-0-website_sale_product_minimal_price
: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/13.0
+ :target: https://runbot.odoo-community.org/runbot/113/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -56,7 +56,7 @@ Bug Tracker
Bugs are tracked on `GitHub 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -98,6 +98,6 @@ Current `maintainer `__:
|maintainer-sergio-teruel|
-This module is part of the `OCA/e-commerce `_ project on GitHub.
+This module is part of the `OCA/e-commerce `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/website_sale_product_minimal_price/__manifest__.py b/website_sale_product_minimal_price/__manifest__.py
index af744521ff..c5ee20d6a6 100644
--- a/website_sale_product_minimal_price/__manifest__.py
+++ b/website_sale_product_minimal_price/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "Website Sale Product Minimal Price",
"summary": "Display minimal price for products that has variants",
- "version": "13.0.1.1.0",
+ "version": "14.0.1.0.0",
"development_status": "Production/Stable",
"maintainers": ["sergio-teruel"],
"category": "Website",
diff --git a/website_sale_product_minimal_price/i18n/website_sale_product_minimal_price.pot b/website_sale_product_minimal_price/i18n/website_sale_product_minimal_price.pot
index 45d544ebd2..5e48100f30 100644
--- a/website_sale_product_minimal_price/i18n/website_sale_product_minimal_price.pot
+++ b/website_sale_product_minimal_price/i18n/website_sale_product_minimal_price.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 13.0\n"
+"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -13,6 +13,11 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
+#. module: website_sale_product_minimal_price
+#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_template__display_name
+msgid "Display Name"
+msgstr ""
+
#. module: website_sale_product_minimal_price
#. openerp-web
#: code:addons/website_sale_product_minimal_price/static/src/xml/website_sale_product_minimal_price.xml:0
@@ -20,6 +25,16 @@ msgstr ""
msgid "From"
msgstr ""
+#. module: website_sale_product_minimal_price
+#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_template__id
+msgid "ID"
+msgstr ""
+
+#. module: website_sale_product_minimal_price
+#: model:ir.model.fields,field_description:website_sale_product_minimal_price.field_product_template____last_update
+msgid "Last Modified on"
+msgstr ""
+
#. module: website_sale_product_minimal_price
#. openerp-web
#: code:addons/website_sale_product_minimal_price/static/src/xml/website_sale_product_price_scale.xml:0
diff --git a/website_sale_product_minimal_price/static/description/index.html b/website_sale_product_minimal_price/static/description/index.html
index 6e231d1a54..2c1101a0a0 100644
--- a/website_sale_product_minimal_price/static/description/index.html
+++ b/website_sale_product_minimal_price/static/description/index.html
@@ -367,7 +367,7 @@
Website Sale Product Minimal Price
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module extends the functionality of website sale module to allow to
display the minimal price in ‘/shop’ view when product has distinct variants
price and set order by minimal price in product’s view.
Bugs are tracked on GitHub 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.
To enable (or disable) the cart empty button for a website, go to
+Website / Configuration / Settings. Then search the “Cart Empty
+Button” and edit its value.
Bugs are tracked on GitHub Issues.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us to smash it by providing a detailed and welcomed
+feedback.
+
Do not contact contributors directly about support or help with technical issues.
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 project on GitHub.
+
+
+
+
diff --git a/website_sale_empty_cart/views/res_config_settings.xml b/website_sale_empty_cart/views/res_config_settings.xml
new file mode 100644
index 0000000000..b187325ac3
--- /dev/null
+++ b/website_sale_empty_cart/views/res_config_settings.xml
@@ -0,0 +1,21 @@
+
+
+
+
+ res.config.settings.view.form.inherit.website.sale
+ res.config.settings
+
+
+
+
+
+
+
+
+
+
From e570574d14a3e5ea21c013cf63f1485e5e518977 Mon Sep 17 00:00:00 2001
From: oca-ci
Date: Mon, 24 Nov 2025 10:16:38 +0000
Subject: [PATCH 049/101] [UPD] Update website_sale_empty_cart.pot
---
website_sale_empty_cart/i18n/es.po | 1 +
.../i18n/website_sale_empty_cart.pot | 45 +++++++++++++++++++
2 files changed, 46 insertions(+)
create mode 100644 website_sale_empty_cart/i18n/website_sale_empty_cart.pot
diff --git a/website_sale_empty_cart/i18n/es.po b/website_sale_empty_cart/i18n/es.po
index da372473cb..b79df19f01 100644
--- a/website_sale_empty_cart/i18n/es.po
+++ b/website_sale_empty_cart/i18n/es.po
@@ -10,6 +10,7 @@ msgstr ""
"PO-Revision-Date: 2025-10-13 08:51+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
diff --git a/website_sale_empty_cart/i18n/website_sale_empty_cart.pot b/website_sale_empty_cart/i18n/website_sale_empty_cart.pot
new file mode 100644
index 0000000000..fb5b356915
--- /dev/null
+++ b/website_sale_empty_cart/i18n/website_sale_empty_cart.pot
@@ -0,0 +1,45 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * website_sale_empty_cart
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 17.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: website_sale_empty_cart
+#: model_terms:ir.ui.view,arch_db:website_sale_empty_cart.res_config_settings_view_form
+msgid "Cart Empty Button"
+msgstr ""
+
+#. module: website_sale_empty_cart
+#: model:ir.model,name:website_sale_empty_cart.model_res_config_settings
+msgid "Config Settings"
+msgstr ""
+
+#. module: website_sale_empty_cart
+#: model_terms:ir.ui.view,arch_db:website_sale_empty_cart.total_empty_cart
+msgid "Empty Cart"
+msgstr ""
+
+#. module: website_sale_empty_cart
+#: model_terms:ir.ui.view,arch_db:website_sale_empty_cart.res_config_settings_view_form
+msgid "Enable or disable the cart empty button"
+msgstr ""
+
+#. module: website_sale_empty_cart
+#: model:ir.model.fields,field_description:website_sale_empty_cart.field_res_config_settings__cart_empty_button
+#: model:ir.model.fields,field_description:website_sale_empty_cart.field_website__cart_empty_button
+msgid "Is the cart empty button enabled?"
+msgstr ""
+
+#. module: website_sale_empty_cart
+#: model:ir.model,name:website_sale_empty_cart.model_website
+msgid "Website"
+msgstr ""
From 1474c9c432bb32355ffa663f2a113bdfbd3063a7 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Mon, 24 Nov 2025 10:24:24 +0000
Subject: [PATCH 050/101] [BOT] post-merge updates
---
website_sale_empty_cart/README.rst | 16 ++++++++--------
.../static/description/index.html | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/website_sale_empty_cart/README.rst b/website_sale_empty_cart/README.rst
index b72993fbb2..783b00c76c 100644
--- a/website_sale_empty_cart/README.rst
+++ b/website_sale_empty_cart/README.rst
@@ -11,7 +11,7 @@ Website Sale Empty Cart
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:928fae09fdbcafb56001f6797b4eb84799a63ba9d1355764c7ecfe88d1a9b0ad
+ !! source digest: sha256:1726e2de04bdb2f25a02c31ff9b56ace136978ac47063506aecad4510c9d65cb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -45,9 +45,9 @@ Configuration
To configure this module, you need to:
-- To enable (or disable) the cart empty button for a website, go to
- Website / Configuration / Settings. Then search the "Cart Empty
- Button" and edit its value.
+- To enable (or disable) the cart empty button for a website, go to
+ Website / Configuration / Settings. Then search the "Cart Empty
+ Button" and edit its value.
Usage
=====
@@ -82,11 +82,11 @@ Authors
Contributors
------------
-- `Sygel `__:
+- `Sygel `__:
- - Alberto Martínez
- - Valentin Vinagre
- - Harald Panten
+ - Alberto Martínez
+ - Valentin Vinagre
+ - Harald Panten
Maintainers
-----------
diff --git a/website_sale_empty_cart/static/description/index.html b/website_sale_empty_cart/static/description/index.html
index 6061ec7e53..3ebfdbfb9d 100644
--- a/website_sale_empty_cart/static/description/index.html
+++ b/website_sale_empty_cart/static/description/index.html
@@ -372,7 +372,7 @@
Website Sale Empty Cart
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:928fae09fdbcafb56001f6797b4eb84799a63ba9d1355764c7ecfe88d1a9b0ad
+!! source digest: sha256:1726e2de04bdb2f25a02c31ff9b56ace136978ac47063506aecad4510c9d65cb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
From 55781595988d3dc04bc6971f0bde71041acdb19f Mon Sep 17 00:00:00 2001
From: Manfred Nelvin H
Date: Tue, 17 Mar 2026 16:55:27 +0530
Subject: [PATCH 054/101] [MIG] website_sale_empty_cart: Migration to 18.0
---
website_sale_empty_cart/README.rst | 16 ++++------
website_sale_empty_cart/__manifest__.py | 2 +-
.../static/description/index.html | 32 ++++++++-----------
.../tests/test_website_sale_empty_cart.py | 4 +--
4 files changed, 22 insertions(+), 32 deletions(-)
diff --git a/website_sale_empty_cart/README.rst b/website_sale_empty_cart/README.rst
index 783b00c76c..0443b0ce61 100644
--- a/website_sale_empty_cart/README.rst
+++ b/website_sale_empty_cart/README.rst
@@ -1,7 +1,3 @@
-.. image:: https://odoo-community.org/readme-banner-image
- :target: https://odoo-community.org/get-involved?utm_source=readme
- :alt: Odoo Community Association
-
=======================
Website Sale Empty Cart
=======================
@@ -17,17 +13,17 @@ Website Sale Empty Cart
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
-.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
+.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
: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/17.0/website_sale_empty_cart
+ :target: https://github.com/OCA/e-commerce/tree/18.0/website_sale_empty_cart
: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-17-0/e-commerce-17-0-website_sale_empty_cart
+ :target: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_empty_cart
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -67,7 +63,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -101,6 +97,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 `_ project on GitHub.
+This module is part of the `OCA/e-commerce `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/website_sale_empty_cart/__manifest__.py b/website_sale_empty_cart/__manifest__.py
index ab9079f63e..48d631738d 100644
--- a/website_sale_empty_cart/__manifest__.py
+++ b/website_sale_empty_cart/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "Website Sale Empty Cart",
"summary": "Adds a button in the website cart to empty all",
- "version": "17.0.1.0.0",
+ "version": "18.0.1.0.0",
"website": "https://github.com/OCA/e-commerce",
"author": "Sygel, Odoo Community Association (OCA)",
"license": "AGPL-3",
diff --git a/website_sale_empty_cart/static/description/index.html b/website_sale_empty_cart/static/description/index.html
index 3ebfdbfb9d..1c532eec34 100644
--- a/website_sale_empty_cart/static/description/index.html
+++ b/website_sale_empty_cart/static/description/index.html
@@ -3,7 +3,7 @@
-README.rst
+Website Sale Empty Cart
-
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
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 project on GitHub.
+
This module is part of the OCA/e-commerce project on GitHub.