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
+
+
+
+
+
+
+
+
+
+
diff --git a/nfu_ecommerce/views/templates.xml b/nfu_ecommerce/views/templates.xml
index 00d6a52..381c302 100644
--- a/nfu_ecommerce/views/templates.xml
+++ b/nfu_ecommerce/views/templates.xml
@@ -3,10 +3,12 @@
- Open Package: /
- Total Ordered Quantity:
+ Open Package: /
+
+ Max Ordered Quantity:
@@ -85,10 +87,13 @@
-
- Open Package:
+ Open Package: /
+
+ Max Ordered Quantity:
- Ordered Quantity:
diff --git a/nfu_sale_order_batch_packaging/README.rst b/nfu_sale_order_batch_packaging/README.rst
index 08329e7..167f57f 100644
--- a/nfu_sale_order_batch_packaging/README.rst
+++ b/nfu_sale_order_batch_packaging/README.rst
@@ -35,6 +35,7 @@ Changelog
:0.0.1: Initial module.
:1.0.0: rename to nfu_sale_order_batch_packaging
+:1.1.0: Live
Bug Tracker
===========
diff --git a/nfu_sale_order_batch_packaging/__manifest__.py b/nfu_sale_order_batch_packaging/__manifest__.py
index a2258d4..0ecdd3d 100644
--- a/nfu_sale_order_batch_packaging/__manifest__.py
+++ b/nfu_sale_order_batch_packaging/__manifest__.py
@@ -4,7 +4,7 @@
"author": "BAKEUP",
"website": "https://www.bakeup.org",
"category": "Sale",
- "version": "16.0.1.0.0",
+ "version": "16.0.1.1.0",
"depends": ["sale", "sale_order_batch"],
"data": [
"views/sale_order_views.xml",
diff --git a/nfu_sale_order_batch_packaging/models/sale_order_line.py b/nfu_sale_order_batch_packaging/models/sale_order_line.py
index 1305009..e01a175 100644
--- a/nfu_sale_order_batch_packaging/models/sale_order_line.py
+++ b/nfu_sale_order_batch_packaging/models/sale_order_line.py
@@ -9,6 +9,7 @@ class SaleOrderLine(models.Model):
product_uom_ordered_qty = fields.Float(string="Ordered Qty", digits="Product Unit of Measure", default=1.0)
product_uom_max_qty = fields.Float(string="Max Qty", digits="Product Unit of Measure")
batch_uom_qty = fields.Float(compute="_compute_batch_uom_qty")
+ batch_uom_max_qty = fields.Float(compute="_compute_batch_uom_qty")
@api.constrains("product_uom_qty", "product_uom_max_qty")
def _check_product_uom_qty(self):
@@ -21,20 +22,21 @@ class SaleOrderLine(models.Model):
)
)
- @api.depends("product_uom_qty")
+ @api.depends("product_uom_qty", "product_uom_max_qty")
def _compute_batch_uom_qty(self):
for line in self:
if line.order_id.batch_id:
batch_id = line.batch_id
product_id = line.product_id
- batch_uom_qtys = (
+ batch_lines = (
self.env["sale.order.line"]
.sudo()
.search([("batch_id", "=", batch_id.id), ("product_id", "=", product_id.id)])
- ).mapped("product_uom_qty")
- line.batch_uom_qty = sum(batch_uom_qtys)
+ )
+ line.batch_uom_qty = sum(batch_lines.mapped("product_uom_qty"))
+ line.batch_uom_max_qty = sum(batch_lines.mapped("product_uom_max_qty"))
else:
- line.batch_uom_qty = 0
+ line.batch_uom_max_qty = line.batch_uom_qty = 0
@api.depends("product_packaging_id", "product_uom", "product_uom_qty", "batch_id")
def _compute_product_packaging_qty(self):
diff --git a/nfu_sale_order_batch_packaging/readme/HISTORY.rst b/nfu_sale_order_batch_packaging/readme/HISTORY.rst
index ce67226..918d67d 100644
--- a/nfu_sale_order_batch_packaging/readme/HISTORY.rst
+++ b/nfu_sale_order_batch_packaging/readme/HISTORY.rst
@@ -1,2 +1,3 @@
:0.0.1: Initial module.
-:1.0.0: rename to nfu_sale_order_batch_packaging
\ No newline at end of file
+:1.0.0: rename to nfu_sale_order_batch_packaging
+:1.1.0: Live
\ No newline at end of file
diff --git a/nfu_sale_order_batch_packaging/static/description/index.html b/nfu_sale_order_batch_packaging/static/description/index.html
index 211bb0f..ff7ebcd 100644
--- a/nfu_sale_order_batch_packaging/static/description/index.html
+++ b/nfu_sale_order_batch_packaging/static/description/index.html
@@ -395,6 +395,8 @@ and adds a packaging default to sale order batch.
| 1.0.0: | rename to nfu_sale_order_batch_packaging |
+| 1.1.0: | Live |
+