diff --git a/nfu_sale_order_packaging/README.rst b/nfu_sale_order_packaging/README.rst new file mode 100644 index 0000000..c9230a0 --- /dev/null +++ b/nfu_sale_order_packaging/README.rst @@ -0,0 +1,67 @@ +======================== +NFU Sale Order Packaging +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:cf35c3a80aa0718148099036cd6a3dd60afb61acdb420573b1bd129be3ea2cf1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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 + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github + :target: https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_sale_order_packaging + :alt: bruecksen/ife_nfu + +|badge1| |badge2| |badge3| + +This module adds a minium and a maximum order quantity field to Sale Orders +and adds a packaging default to sale order batch. + +**Table of contents** + +.. contents:: + :local: + +Changelog +========= + +:1.0.0: Initial module. + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* BAKEUP + +Contributors +~~~~~~~~~~~~ + +* Niels Göttsch +* Matthias Brück + +Maintainers +~~~~~~~~~~~ + +This module is part of the `bruecksen/ife_nfu `_ project on GitHub. + +You are welcome to contribute. diff --git a/nfu_sale_order_packaging/__init__.py b/nfu_sale_order_packaging/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/nfu_sale_order_packaging/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/nfu_sale_order_packaging/__manifest__.py b/nfu_sale_order_packaging/__manifest__.py new file mode 100644 index 0000000..8e81c8b --- /dev/null +++ b/nfu_sale_order_packaging/__manifest__.py @@ -0,0 +1,11 @@ +{ + "name": "NFU Sale Order Packaging", + "summary": "Add minimum and maximum order quantities to sale orders and use default packaging", + "author": "BAKEUP", + "website": "https://www.bakeup.org", + "category": "Stock", + "version": "16.0.0.0.1", + "depends": ["sale", "sale_order_batch"], + "data": ["views/sale_order_views.xml", "views/sale_order_batch_views.xml"], + "license": "LGPL-3", +} diff --git a/nfu_sale_order_packaging/models/__init__.py b/nfu_sale_order_packaging/models/__init__.py new file mode 100644 index 0000000..8eb9d1d --- /dev/null +++ b/nfu_sale_order_packaging/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order_line diff --git a/nfu_sale_order_packaging/models/sale_order_line.py b/nfu_sale_order_packaging/models/sale_order_line.py new file mode 100644 index 0000000..a0bd60b --- /dev/null +++ b/nfu_sale_order_packaging/models/sale_order_line.py @@ -0,0 +1,15 @@ +from odoo import _, api, fields, models +from odoo.exceptions import UserError + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + 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") + + @api.constrains("product_uom_qty", "product_uom_max_qty") + def _check_product_uom_qty(self): + for record in self: + if record.product_uom_max_qty != 0 and record.product_uom_qty > record.product_uom_max_qty: + raise UserError(_("The quantity must be less than or equal to the maximum quantity.")) diff --git a/nfu_sale_order_packaging/readme/CONTRIBUTORS.rst b/nfu_sale_order_packaging/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..a4ec453 --- /dev/null +++ b/nfu_sale_order_packaging/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Niels Göttsch +* Matthias Brück \ No newline at end of file diff --git a/nfu_sale_order_packaging/readme/DESCRIPTION.rst b/nfu_sale_order_packaging/readme/DESCRIPTION.rst new file mode 100644 index 0000000..3bd5ae9 --- /dev/null +++ b/nfu_sale_order_packaging/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module adds a minium and a maximum order quantity field to Sale Orders +and adds a packaging default to sale order batch. \ No newline at end of file diff --git a/nfu_sale_order_packaging/readme/HISTORY.rst b/nfu_sale_order_packaging/readme/HISTORY.rst new file mode 100644 index 0000000..765ab9c --- /dev/null +++ b/nfu_sale_order_packaging/readme/HISTORY.rst @@ -0,0 +1 @@ +:1.0.0: Initial module. \ No newline at end of file diff --git a/nfu_sale_order_packaging/static/description/icon.png b/nfu_sale_order_packaging/static/description/icon.png new file mode 100644 index 0000000..1267712 Binary files /dev/null and b/nfu_sale_order_packaging/static/description/icon.png differ diff --git a/nfu_sale_order_packaging/static/description/index.html b/nfu_sale_order_packaging/static/description/index.html new file mode 100644 index 0000000..36dab75 --- /dev/null +++ b/nfu_sale_order_packaging/static/description/index.html @@ -0,0 +1,430 @@ + + + + + +NFU Sale Order Packaging + + + +
+

NFU Sale Order Packaging

+ + +

Beta License: LGPL-3 bruecksen/ife_nfu

+

This module adds a minium and a maximum order quantity field to Sale Orders +and adds a packaging default to sale order batch.

+

Table of contents

+ +
+

Changelog

+ +++ + + + +
1.0.0:Initial module.
+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • BAKEUP
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the bruecksen/ife_nfu project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/nfu_sale_order_packaging/views/sale_order_batch_views.xml b/nfu_sale_order_packaging/views/sale_order_batch_views.xml new file mode 100644 index 0000000..6b32222 --- /dev/null +++ b/nfu_sale_order_packaging/views/sale_order_batch_views.xml @@ -0,0 +1,17 @@ + + + + sale.order.batch.form.product.min_max_qty + sale.order.batch + + + + + + + + + diff --git a/nfu_sale_order_packaging/views/sale_order_views.xml b/nfu_sale_order_packaging/views/sale_order_views.xml new file mode 100644 index 0000000..f0d2742 --- /dev/null +++ b/nfu_sale_order_packaging/views/sale_order_views.xml @@ -0,0 +1,14 @@ + + + + sale.order.form.product.min_max_qty + sale.order + + + + + + + + +