From e17935849c90d36936c1382eac3b7ddc673c2e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20G=C3=B6ttsch?= Date: Sat, 7 Feb 2026 23:09:33 +0100 Subject: [PATCH] [IMP] sale_order_batch: apply pre-commit --- sale_order_batch/README.rst | 19 +- sale_order_batch/__manifest__.py | 4 +- sale_order_batch/data/ir_sequence_data.xml | 4 +- sale_order_batch/models/sale_order_batch.py | 7 +- sale_order_batch/models/sale_order_line.py | 10 +- sale_order_batch/pyproject.toml | 3 + sale_order_batch/security/ir_rules.xml | 4 +- .../static/description/index.html | 33 ++-- sale_order_batch/views/sale_menus.xml | 2 +- .../views/sale_order_batch_product_views.xml | 39 +++-- .../views/sale_order_batch_views.xml | 165 ++++++++++++------ sale_order_batch/views/sale_order_views.xml | 37 ++-- .../wizard/sale_order_batch_cancel_wizard.xml | 13 +- 13 files changed, 218 insertions(+), 122 deletions(-) create mode 100644 sale_order_batch/pyproject.toml diff --git a/sale_order_batch/README.rst b/sale_order_batch/README.rst index 748e9e7..66e750a 100644 --- a/sale_order_batch/README.rst +++ b/sale_order_batch/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ================ Sale Order Batch ================ @@ -13,12 +17,12 @@ Sale Order Batch .. |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 +.. |badge2| image:: https://img.shields.io/badge/license-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-bakeupboys%2Fnfu-lightgray.png?logo=github - :target: https://github.com/bakeupboys/nfu/tree/16.0/sale_order_batch - :alt: bakeupboys/nfu +.. |badge3| image:: https://img.shields.io/badge/github-madmooose%2Fodooapps-lightgray.png?logo=github + :target: https://github.com/madmooose/odooapps/tree/16.0/sale_order_batch + :alt: madmooose/odooapps |badge1| |badge2| |badge3| @@ -49,10 +53,10 @@ Changelog Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +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. @@ -63,6 +67,7 @@ Authors ~~~~~~~ * BAKEUP +* Niels Göttsch Contributors ~~~~~~~~~~~~ @@ -72,6 +77,6 @@ Contributors Maintainers ~~~~~~~~~~~ -This module is part of the `bakeupboys/nfu `_ project on GitHub. +This module is part of the `madmooose/odooapps `_ project on GitHub. You are welcome to contribute. diff --git a/sale_order_batch/__manifest__.py b/sale_order_batch/__manifest__.py index 24fa8d7..e57fe86 100644 --- a/sale_order_batch/__manifest__.py +++ b/sale_order_batch/__manifest__.py @@ -1,8 +1,8 @@ { "name": "Sale Order Batch", "summary": "Group Sale Orders into a batch", - "author": "BAKEUP", - "website": "https://www.bakeup.org", + "author": "BAKEUP,Niels Göttsch", + "website": "https://ziemlichoptimal.de", "category": "Sale", "version": "16.0.2.3.1", "depends": ["sale", "product"], diff --git a/sale_order_batch/data/ir_sequence_data.xml b/sale_order_batch/data/ir_sequence_data.xml index 4c14e3e..3e5b0eb 100644 --- a/sale_order_batch/data/ir_sequence_data.xml +++ b/sale_order_batch/data/ir_sequence_data.xml @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ sale.order.batch SOB 5 - + diff --git a/sale_order_batch/models/sale_order_batch.py b/sale_order_batch/models/sale_order_batch.py index beb61bb..0f44883 100644 --- a/sale_order_batch/models/sale_order_batch.py +++ b/sale_order_batch/models/sale_order_batch.py @@ -3,7 +3,6 @@ from odoo.exceptions import UserError from odoo.addons.sale.models.sale_order import INVOICE_STATUS - STATES = [ ("open", "Open"), ("in_progress", "In Progress"), @@ -207,7 +206,8 @@ class SaleOrderBatch(models.Model): self.write({"state": "cancel"}) def _show_cancel_wizard(self): - """Decide whether the sale.order.batch.cancel wizard should be shown to cancel specified orders. + """Decide whether the sale.order.batch.cancel wizard should be shown to cancel + specified orders. :return: True if there is any non-draft order in the given orders :rtype: bool @@ -250,7 +250,8 @@ class SaleOrderBatchCancelWizard(models.TransientModel): if not_draft_orders: raise UserError( _( - "You can only cancel batches where all sale orders are in draft state." + "You can only cancel batches where all sale orders are in " + "draft state." ) ) # use _action_cancel to skip the wizzard diff --git a/sale_order_batch/models/sale_order_line.py b/sale_order_batch/models/sale_order_line.py index 0af31ae..2bc10a4 100644 --- a/sale_order_batch/models/sale_order_line.py +++ b/sale_order_batch/models/sale_order_line.py @@ -8,7 +8,7 @@ class SaleOrderLine(models.Model): batch_product_id = fields.Many2one("sale.order.batch.product", ondelete="restrict") def _link_batch_product(self): - lines_with_batch = self.filtered(lambda l: l.batch_id) + lines_with_batch = self.filtered(lambda line: line.batch_id) for line in lines_with_batch: batch_id = line.batch_id batch_product = self.env["sale.order.batch.product"].search( @@ -25,17 +25,17 @@ class SaleOrderLine(models.Model): line.batch_product_id = batch_product def _unlink_batch_product(self): - lines_to_unlink = self.filtered(lambda l: l.batch_product_id) + lines_to_unlink = self.filtered(lambda line: line.batch_product_id) batch_products = lines_to_unlink.mapped("batch_product_id") lines_to_unlink.update({"batch_product_id": False}) batch_products.filtered(lambda p: len(p.sale_order_line_ids) == 0).unlink() def _update_batch_product(self): - lines_with_batch = self.filtered(lambda l: l.batch_id) + lines_with_batch = self.filtered(lambda line: line.batch_id) lines_without_batch = self - lines_with_batch lines_with_batch.filtered( - lambda l: l.batch_product_id - and l.batch_product_id.product_id != l.product_id + lambda line: line.batch_product_id + and line.batch_product_id.product_id != line.product_id )._unlink_batch_product() lines_with_batch._link_batch_product() lines_without_batch._unlink_batch_product() diff --git a/sale_order_batch/pyproject.toml b/sale_order_batch/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/sale_order_batch/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_order_batch/security/ir_rules.xml b/sale_order_batch/security/ir_rules.xml index 7abb22e..b328a0e 100644 --- a/sale_order_batch/security/ir_rules.xml +++ b/sale_order_batch/security/ir_rules.xml @@ -1,10 +1,10 @@ - + Sales Order Batch multi-company - + [('company_id', 'in', company_ids)] diff --git a/sale_order_batch/static/description/index.html b/sale_order_batch/static/description/index.html index 57dab9b..bd90800 100644 --- a/sale_order_batch/static/description/index.html +++ b/sale_order_batch/static/description/index.html @@ -3,7 +3,7 @@ -Sale Order Batch +README.rst -
-

Sale Order Batch

+
+ + +Odoo Community Association + +
+

Sale Order Batch

-

Beta License: LGPL-3 bakeupboys/nfu

+

Beta License: LGPL-3 madmooose/odooapps

This module adds the possibility to group Sale orders into batches. Attributes of a Sale Order Batch will be written to all Sale Order. Wenn attached to a batch they can be processed together. On the other hand they cannot be proccesed individual anymore as log as they are part of a batch. Only Sale Orders in state Qutotation or Quotation Send can be attached to a batch.

@@ -387,7 +392,7 @@ anymore as log as they are part of a batch. Only Sale Orders in state Qutotation
-

Changelog

+

Changelog

  • 16.0.0.0.1: Initial module.
  • 16.0.0.1: Add Multi Company ability
  • @@ -403,33 +408,35 @@ anymore as log as they are part of a batch. Only Sale Orders in state Qutotation
-

Bug Tracker

-

Bugs are tracked on GitHub Issues. +

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.

-

Credits

+

Credits

-

Authors

+

Authors

  • BAKEUP
  • +
  • Niels Göttsch
-

Maintainers

-

This module is part of the bakeupboys/nfu project on GitHub.

+

Maintainers

+

This module is part of the madmooose/odooapps project on GitHub.

You are welcome to contribute.

+
diff --git a/sale_order_batch/views/sale_menus.xml b/sale_order_batch/views/sale_menus.xml index 44413a8..a245ba6 100644 --- a/sale_order_batch/views/sale_menus.xml +++ b/sale_order_batch/views/sale_menus.xml @@ -1,4 +1,4 @@ - + + sale.order.batch.product.form @@ -6,38 +6,41 @@
- +

- +

- - + + - - + + - + - - - - - - - - - - + + + + + + + + + + diff --git a/sale_order_batch/views/sale_order_batch_views.xml b/sale_order_batch/views/sale_order_batch_views.xml index bebe390..acb62b8 100644 --- a/sale_order_batch/views/sale_order_batch_views.xml +++ b/sale_order_batch/views/sale_order_batch_views.xml @@ -1,15 +1,24 @@ - + sale.order.batch.tree sale.order.batch - - - - - + + + + + sale.order.batch - - - - - + + + + + - +
@@ -131,7 +149,11 @@ icon="fa-pencil-square-o" attrs="{'invisible': [('sale_order_count', '=', 0)]}" > - +

- +

- + - - - + + + - + - - - - - - + + + + + + - + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + +
- - + +
@@ -237,9 +284,21 @@ sale.order.batch - - - + + +
@@ -249,7 +308,7 @@ ir.actions.act_window sale.order.batch tree,form,activity - + {'search_default_filter_batch_open': 1}
@@ -258,7 +317,7 @@ ir.actions.act_window sale.order.batch tree,form,activity - + {'search_default_filter_batch_finished': 1} @@ -269,7 +328,7 @@ tree,form,activity {'create': False} [('invoice_status','=','to invoice')] - +

No batches to invoice found diff --git a/sale_order_batch/views/sale_order_views.xml b/sale_order_batch/views/sale_order_views.xml index ec67136..b2cfb34 100644 --- a/sale_order_batch/views/sale_order_views.xml +++ b/sale_order_batch/views/sale_order_views.xml @@ -1,12 +1,12 @@ - + sale.order.form.inherit.batch sale.order - + - + - + {'invisible': ['|',('batch_id','!=',False),('state', 'not in', ['sent'])]} - + {'invisible': ['|',('batch_id','!=',False),('state', 'not in', ['draft'])]} - + @@ -45,15 +54,19 @@ sale.order.tree.inherited.batch sale.order - +

-
- +
@@ -61,10 +74,10 @@ sale.order.tree.inherited.batch sale.order - + - + diff --git a/sale_order_batch/wizard/sale_order_batch_cancel_wizard.xml b/sale_order_batch/wizard/sale_order_batch_cancel_wizard.xml index 9609fba..0c221f9 100644 --- a/sale_order_batch/wizard/sale_order_batch_cancel_wizard.xml +++ b/sale_order_batch/wizard/sale_order_batch_cancel_wizard.xml @@ -9,14 +9,19 @@ Are you sure you want to cancel this order? - - + +