diff --git a/nfu_ecommerce/README.rst b/nfu_ecommerce/README.rst index 6eca94c..68cbf26 100644 --- a/nfu_ecommerce/README.rst +++ b/nfu_ecommerce/README.rst @@ -36,6 +36,7 @@ Changelog ========= :0.0.1: Initial module. +:1.0.0: Live Bug Tracker =========== diff --git a/nfu_ecommerce/__manifest__.py b/nfu_ecommerce/__manifest__.py index 74cfd89..0a65af3 100644 --- a/nfu_ecommerce/__manifest__.py +++ b/nfu_ecommerce/__manifest__.py @@ -4,9 +4,9 @@ "author": "BAKEUP", "website": "https://www.bakeup.org", "category": "website", - "version": "16.0.0.0.1", + "version": "16.0.1.0.0", "depends": ["website_sale", "nfu_sale_order_batch_packaging"], - "data": ["views/templates.xml"], + "data": ["views/product_template_views.xml", "views/templates.xml"], "assets": {"web.assets_frontend": ["nfu_ecommerce/static/src/js/website_sale.js"]}, "license": "LGPL-3", } diff --git a/nfu_ecommerce/models/__init__.py b/nfu_ecommerce/models/__init__.py index 2d7ee6c..53fa79a 100644 --- a/nfu_ecommerce/models/__init__.py +++ b/nfu_ecommerce/models/__init__.py @@ -1,2 +1,3 @@ +from . import product_template from . import sale_order from . import sale_order_line diff --git a/nfu_ecommerce/models/product_template.py b/nfu_ecommerce/models/product_template.py new file mode 100644 index 0000000..b785776 --- /dev/null +++ b/nfu_ecommerce/models/product_template.py @@ -0,0 +1,13 @@ +from odoo import models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + def action_publish_on_website(self): + for product in self: + product.is_published = True + + def action_unpublish_on_website(self): + for product in self: + product.is_published = False diff --git a/nfu_ecommerce/models/sale_order_line.py b/nfu_ecommerce/models/sale_order_line.py index 00b6a85..4f952a8 100644 --- a/nfu_ecommerce/models/sale_order_line.py +++ b/nfu_ecommerce/models/sale_order_line.py @@ -6,5 +6,6 @@ class SaleOrderLine(models.Model): def compute_open_packages(self): self.ensure_one() - open_qty = self.batch_uom_qty % self.product_packaging_id.qty + qty_of_last_pack = self.batch_uom_qty % self.product_packaging_id.qty + open_qty = self.product_packaging_id.qty - qty_of_last_pack return open_qty diff --git a/nfu_ecommerce/readme/HISTORY.rst b/nfu_ecommerce/readme/HISTORY.rst index e986fe7..e9a3e7c 100644 --- a/nfu_ecommerce/readme/HISTORY.rst +++ b/nfu_ecommerce/readme/HISTORY.rst @@ -1 +1,2 @@ -:0.0.1: Initial module. \ No newline at end of file +:0.0.1: Initial module. +:1.0.0: Live \ No newline at end of file diff --git a/nfu_ecommerce/static/description/index.html b/nfu_ecommerce/static/description/index.html index 1beceae..6d36996 100644 --- a/nfu_ecommerce/static/description/index.html +++ b/nfu_ecommerce/static/description/index.html @@ -395,6 +395,8 @@ and after the current order.

0.0.1:Initial module. +1.0.0:Live + diff --git a/nfu_ecommerce/views/product_template_views.xml b/nfu_ecommerce/views/product_template_views.xml new file mode 100644 index 0000000..b710e18 --- /dev/null +++ b/nfu_ecommerce/views/product_template_views.xml @@ -0,0 +1,15 @@ + + + + product.template.product.tree.inherit.website + product.template + + + +