From b682301c2b0533a037ee446156bd99cdaa7262cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?NIels=20G=C3=B6ttsch?= Date: Sat, 19 Oct 2024 23:04:01 +0200 Subject: [PATCH] [imp] add batches to Sale Orders --- sale_order_batch/README.rst | 1 + sale_order_batch/__manifest__.py | 2 +- sale_order_batch/models/sale_order.py | 2 +- sale_order_batch/readme/HISTORY.rst | 3 ++- .../static/description/index.html | 2 ++ .../views/sale_order_batch_views.xml | 7 ++---- sale_order_batch/views/sale_order_views.xml | 22 +++++++++++++++++-- 7 files changed, 29 insertions(+), 10 deletions(-) diff --git a/sale_order_batch/README.rst b/sale_order_batch/README.rst index 52941c0..570e177 100644 --- a/sale_order_batch/README.rst +++ b/sale_order_batch/README.rst @@ -37,6 +37,7 @@ Changelog :0.0.1: Initial module. :1.0.0: Add Multi Company ability :1.0.1: rename product creation methode +:1.1.0: Make validity_date persistent, add batches to SO views Bug Tracker =========== diff --git a/sale_order_batch/__manifest__.py b/sale_order_batch/__manifest__.py index 2011e6a..bbf0abc 100644 --- a/sale_order_batch/__manifest__.py +++ b/sale_order_batch/__manifest__.py @@ -4,7 +4,7 @@ "author": "BAKEUP", "website": "https://www.bakeup.org", "category": "Sale", - "version": "16.0.1.0.1", + "version": "16.0.1.1.0", "depends": ["sale", "product"], "data": [ "data/ir_sequence_data.xml", diff --git a/sale_order_batch/models/sale_order.py b/sale_order_batch/models/sale_order.py index a853f9d..9e76069 100644 --- a/sale_order_batch/models/sale_order.py +++ b/sale_order_batch/models/sale_order.py @@ -5,7 +5,7 @@ from odoo.exceptions import UserError class SaleOrder(models.Model): _inherit = "sale.order" - batch_id = fields.Many2one("sale.order.batch", copy=False, check_company=True) + batch_id = fields.Many2one("sale.order.batch", copy=False, check_company=True, domain="[('state','!=','closed')]") def action_add_to_batch(self): """ diff --git a/sale_order_batch/readme/HISTORY.rst b/sale_order_batch/readme/HISTORY.rst index 682f088..a906313 100644 --- a/sale_order_batch/readme/HISTORY.rst +++ b/sale_order_batch/readme/HISTORY.rst @@ -1,3 +1,4 @@ :0.0.1: Initial module. :1.0.0: Add Multi Company ability -:1.0.1: rename product creation methode \ No newline at end of file +:1.0.1: rename product creation methode +:1.1.0: Make validity_date persistent, add batches to SO views \ No newline at end of file diff --git a/sale_order_batch/static/description/index.html b/sale_order_batch/static/description/index.html index 2659f45..59438f4 100644 --- a/sale_order_batch/static/description/index.html +++ b/sale_order_batch/static/description/index.html @@ -398,6 +398,8 @@ anymore as log as they are part of a batch. Only Sale Orders in state Qutotation 1.0.1:rename product creation methode +1.1.0:Make validity_date persistent, add batches to SO views + diff --git a/sale_order_batch/views/sale_order_batch_views.xml b/sale_order_batch/views/sale_order_batch_views.xml index b110c25..fc79bf2 100644 --- a/sale_order_batch/views/sale_order_batch_views.xml +++ b/sale_order_batch/views/sale_order_batch_views.xml @@ -99,11 +99,8 @@ - - + + diff --git a/sale_order_batch/views/sale_order_views.xml b/sale_order_batch/views/sale_order_views.xml index 04be557..ec67136 100644 --- a/sale_order_batch/views/sale_order_views.xml +++ b/sale_order_batch/views/sale_order_views.xml @@ -36,11 +36,14 @@ name="attrs" >{'invisible': ['|',('batch_id','!=',False),('state', 'not in', ['draft'])]} + + + - - sale.order.list.view.inherited + + sale.order.tree.inherited.batch sale.order @@ -49,6 +52,21 @@