diff --git a/sale_order_general_discount/README.rst b/sale_order_general_discount/README.rst index 662172b8df8..a0b985ede61 100644 --- a/sale_order_general_discount/README.rst +++ b/sale_order_general_discount/README.rst @@ -7,7 +7,7 @@ Sale Order General Discount !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:a4eeadfa3e2fc4ad9f54244dc002a32d12938c91207c4f729001730ca727a156 + !! source digest: sha256:dae30a736c327172b8cf10b83644dc4e2e475ea9f9f02596c3c201ab4143e52c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png @@ -87,6 +87,7 @@ Contributors - Raf Ven - Sudhir Arya +- Heliconia Solutions Pvt. Ltd. Maintainers ----------- diff --git a/sale_order_general_discount/__manifest__.py b/sale_order_general_discount/__manifest__.py index 506289ed499..af4f6dd4839 100644 --- a/sale_order_general_discount/__manifest__.py +++ b/sale_order_general_discount/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Sale Order General Discount", "summary": "General discount per sale order", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "development_status": "Production/Stable", "category": "Sales", "website": "https://github.com/OCA/sale-workflow", diff --git a/sale_order_general_discount/models/product_product.py b/sale_order_general_discount/models/product_product.py index 8ab79509019..7ec5ec65794 100644 --- a/sale_order_general_discount/models/product_product.py +++ b/sale_order_general_discount/models/product_product.py @@ -7,7 +7,6 @@ class ProductProduct(models.Model): _inherit = "product.product" bypass_general_discount = fields.Boolean( - string="Don't apply general discount", help="If this checkbox is not ticked, it means changing general discount on " "sale order will impact sale order lines with this related product.", ) diff --git a/sale_order_general_discount/models/product_template.py b/sale_order_general_discount/models/product_template.py index 369c56ae69b..f995b944a46 100644 --- a/sale_order_general_discount/models/product_template.py +++ b/sale_order_general_discount/models/product_template.py @@ -7,7 +7,6 @@ class ProductTemplate(models.Model): _inherit = "product.template" bypass_general_discount = fields.Boolean( - string="Don't apply general discount", compute="_compute_bypass_general_discount", inverse="_inverse_bypass_general_discount", search="_search_bypass_general_discount", diff --git a/sale_order_general_discount/models/res_partner.py b/sale_order_general_discount/models/res_partner.py index f69789f6cee..f1271ccc082 100644 --- a/sale_order_general_discount/models/res_partner.py +++ b/sale_order_general_discount/models/res_partner.py @@ -8,7 +8,6 @@ class ResPartner(models.Model): _inherit = "res.partner" sale_discount = fields.Float( - string="Discount", digits="Discount", company_dependent=True, ) diff --git a/sale_order_general_discount/models/sale_order.py b/sale_order_general_discount/models/sale_order.py index 5a8159de7cd..211b08d945d 100644 --- a/sale_order_general_discount/models/sale_order.py +++ b/sale_order_general_discount/models/sale_order.py @@ -9,7 +9,6 @@ class SaleOrder(models.Model): _inherit = "sale.order" general_discount = fields.Float( - string="Discount (%)", compute="_compute_general_discount", store=True, readonly=False, diff --git a/sale_order_general_discount/readme/CONTRIBUTORS.md b/sale_order_general_discount/readme/CONTRIBUTORS.md index 88f7cbcfcb5..305d97c1bae 100644 --- a/sale_order_general_discount/readme/CONTRIBUTORS.md +++ b/sale_order_general_discount/readme/CONTRIBUTORS.md @@ -3,3 +3,4 @@ - Stefan Ungureanu \<\> - Raf Ven \<\> - Sudhir Arya \<\> +- Heliconia Solutions Pvt. Ltd. \<\> diff --git a/sale_order_general_discount/static/description/index.html b/sale_order_general_discount/static/description/index.html index f33bf3c37b3..d3784cb073d 100644 --- a/sale_order_general_discount/static/description/index.html +++ b/sale_order_general_discount/static/description/index.html @@ -367,7 +367,7 @@

Sale Order General Discount

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:a4eeadfa3e2fc4ad9f54244dc002a32d12938c91207c4f729001730ca727a156 +!! source digest: sha256:dae30a736c327172b8cf10b83644dc4e2e475ea9f9f02596c3c201ab4143e52c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

This module allows to set a general discount in a sales order. This @@ -434,6 +434,7 @@

Contributors

  • Raf Ven <raf.ven@dynapps.be>
  • Sudhir Arya <sudhir@erpharbor.com>
  • +
  • Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>
  • diff --git a/sale_order_general_discount/tests/test_sale_order_general_discount.py b/sale_order_general_discount/tests/test_sale_order_general_discount.py index a9f329d8d25..6625350f009 100644 --- a/sale_order_general_discount/tests/test_sale_order_general_discount.py +++ b/sale_order_general_discount/tests/test_sale_order_general_discount.py @@ -10,76 +10,84 @@ class TestSaleOrderLineInput(TransactionCase): def setUpClass(cls): super().setUpClass() cls.partner = cls.env["res.partner"].create( - {"name": "Test", "sale_discount": 10.0} + [{"name": "Test", "sale_discount": 10.0}] ) cls.contact = cls.env["res.partner"].create( - { - "name": "Contact Test", - "parent_id": cls.partner.id, - "type": "contact", - } + [ + { + "name": "Contact Test", + "parent_id": cls.partner.id, + "type": "contact", + } + ] ) cls.product = cls.env["product.product"].create( - {"name": "test_product", "type": "service"} + [{"name": "test_product", "type": "service"}] ) cls.pricelist = cls.env["product.pricelist"].create( - {"name": "Public Pricelist", "sequence": 1} + [{"name": "Public Pricelist", "sequence": 1}] ) cls.product2 = cls.env["product.product"].create( - { - "name": "test product without general discount", - "type": "service", - "bypass_general_discount": True, - } + [ + { + "name": "test product without general discount", + "type": "service", + "bypass_general_discount": True, + } + ] ) cls.order = cls.env["sale.order"].create( - { - "partner_id": cls.partner.id, - "order_line": [ - ( - 0, - 0, - { - "name": cls.product.name, - "product_id": cls.product.id, - "product_uom_qty": 1, - "product_uom": cls.product.uom_id.id, - "price_unit": 1000.00, - }, - ), - ( - 0, - 0, - { - "name": cls.product2.name, - "product_id": cls.product2.id, - "product_uom_qty": 1, - "product_uom": cls.product2.uom_id.id, - "price_unit": 1000.00, - }, - ), - ], - "pricelist_id": cls.pricelist.id, - } + [ + { + "partner_id": cls.partner.id, + "order_line": [ + ( + 0, + 0, + { + "name": cls.product.name, + "product_id": cls.product.id, + "product_uom_qty": 1, + "product_uom": cls.product.uom_id.id, + "price_unit": 1000.00, + }, + ), + ( + 0, + 0, + { + "name": cls.product2.name, + "product_id": cls.product2.id, + "product_uom_qty": 1, + "product_uom": cls.product2.uom_id.id, + "price_unit": 1000.00, + }, + ), + ], + "pricelist_id": cls.pricelist.id, + } + ] ) cls.contact_order = cls.env["sale.order"].create( - { - "partner_id": cls.contact.id, - "order_line": [ - ( - 0, - 0, - { - "name": cls.product.name, - "product_id": cls.product.id, - "product_uom_qty": 1, - "product_uom": cls.product.uom_id.id, - "price_unit": 1000.00, - }, - ) - ], - "pricelist_id": cls.pricelist.id, - } + [ + { + "partner_id": cls.contact.id, + "order_line": [ + ( + 0, + 0, + { + "name": cls.product.name, + "product_id": cls.product.id, + "product_uom_qty": 1, + "product_uom": cls.product.uom_id.id, + "price_unit": 1000.00, + }, + ) + ], + "pricelist_id": cls.pricelist.id, + } + ] ) cls.View = cls.env["ir.ui.view"] @@ -112,18 +120,20 @@ def test_default_line_discount_value(self): ctx = self._get_ctx_from_view(res) self.assertTrue("default_discount" in ctx) view = self.View.create( - { - "name": "test", - "type": "form", - "model": "sale.order", - "arch": """ + [ + { + "name": "test", + "type": "form", + "model": "sale.order", + "arch": """
    """, - } + } + ] ) res = self.order.get_view(view_id=view.id, view_type="form") ctx = self._get_ctx_from_view(res) diff --git a/sale_order_general_discount/views/product_view.xml b/sale_order_general_discount/views/product_view.xml index ed14decf50a..a6b2805d750 100644 --- a/sale_order_general_discount/views/product_view.xml +++ b/sale_order_general_discount/views/product_view.xml @@ -7,7 +7,10 @@ - + @@ -20,6 +23,7 @@ diff --git a/sale_order_general_discount/views/res_partner_view.xml b/sale_order_general_discount/views/res_partner_view.xml index 8274ff87e25..c88ff73b32e 100644 --- a/sale_order_general_discount/views/res_partner_view.xml +++ b/sale_order_general_discount/views/res_partner_view.xml @@ -12,7 +12,7 @@ > diff --git a/sale_order_general_discount/views/sale_order_view.xml b/sale_order_general_discount/views/sale_order_view.xml index 7c7a538451d..3844f8e8b0d 100644 --- a/sale_order_general_discount/views/sale_order_view.xml +++ b/sale_order_general_discount/views/sale_order_view.xml @@ -8,11 +8,15 @@ - +
    +