diff --git a/sale_order_batch_stock/README.rst b/sale_order_batch_stock/README.rst new file mode 100644 index 0000000..7e407bb --- /dev/null +++ b/sale_order_batch_stock/README.rst @@ -0,0 +1,65 @@ +============================== +Sale Order Batch Stock Binding +============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c32b4440b58e98f3bea5539d78dfa2916d64aebc757c140d78b67b2a2ce288da + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/sale_order_batch_stock + :alt: bruecksen/ife_nfu + +|badge1| |badge2| |badge3| + +This module adds Deliverys to Sale ORder Batch Views. + +**Table of contents** + +.. contents:: + :local: + +Changelog +========= + +:0.0.1: 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 + +Maintainers +~~~~~~~~~~~ + +This module is part of the `bruecksen/ife_nfu `_ project on GitHub. + +You are welcome to contribute. diff --git a/sale_order_batch_stock/__init__.py b/sale_order_batch_stock/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/sale_order_batch_stock/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_order_batch_stock/__manifest__.py b/sale_order_batch_stock/__manifest__.py new file mode 100644 index 0000000..950a05a --- /dev/null +++ b/sale_order_batch_stock/__manifest__.py @@ -0,0 +1,12 @@ +{ + "name": "Sale Order Batch Stock Binding", + "summary": "Sale Order Batch Stock Bindingh", + "author": "BAKEUP", + "website": "https://www.bakeup.org", + "category": "hidden", + "version": "16.0.0.0.1", + "depends": ["sale_order_batch", "sale_stock"], + "data": ["views/sale_order_batch_views.xml"], + "autoinstall": "True", + "license": "LGPL-3", +} diff --git a/sale_order_batch_stock/models/__init__.py b/sale_order_batch_stock/models/__init__.py new file mode 100644 index 0000000..b2dc7f4 --- /dev/null +++ b/sale_order_batch_stock/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order_batch diff --git a/sale_order_batch_stock/models/sale_order_batch.py b/sale_order_batch_stock/models/sale_order_batch.py new file mode 100644 index 0000000..ff9a9e8 --- /dev/null +++ b/sale_order_batch_stock/models/sale_order_batch.py @@ -0,0 +1,21 @@ +from odoo import api, fields, models + + +STATES = [("open", "Open"), ("close", "Close")] + + +class SaleOrderBatch(models.Model): + _inherit = "sale.order.batch" + + picking_ids = fields.Many2many("stock.picking", compute="_compute_picking_ids", string="Transfers") + delivery_count = fields.Integer(string="Delivery Orders", compute="_compute_picking_ids") + + @api.depends("sale_order_ids.picking_ids") + def _compute_picking_ids(self): + for batch in self: + pickings = batch.sale_order_ids.mapped("picking_ids") + batch.picking_ids = pickings + batch.delivery_count = len(pickings) + + def action_view_delivery(self): + return self.env["sale.order"]._get_action_view_picking(self.picking_ids) diff --git a/sale_order_batch_stock/readme/CONTRIBUTORS.rst b/sale_order_batch_stock/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..fda28e1 --- /dev/null +++ b/sale_order_batch_stock/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Niels Göttsch \ No newline at end of file diff --git a/sale_order_batch_stock/readme/DESCRIPTION.rst b/sale_order_batch_stock/readme/DESCRIPTION.rst new file mode 100644 index 0000000..2836d2a --- /dev/null +++ b/sale_order_batch_stock/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds Deliverys to Sale ORder Batch Views. diff --git a/sale_order_batch_stock/readme/HISTORY.rst b/sale_order_batch_stock/readme/HISTORY.rst new file mode 100644 index 0000000..e986fe7 --- /dev/null +++ b/sale_order_batch_stock/readme/HISTORY.rst @@ -0,0 +1 @@ +:0.0.1: Initial module. \ No newline at end of file diff --git a/sale_order_batch_stock/static/description/index.html b/sale_order_batch_stock/static/description/index.html new file mode 100644 index 0000000..515a69f --- /dev/null +++ b/sale_order_batch_stock/static/description/index.html @@ -0,0 +1,428 @@ + + + + + +Sale Order Batch Stock Binding + + + +
+

Sale Order Batch Stock Binding

+ + +

Beta License: LGPL-3 bruecksen/ife_nfu

+

This module adds Deliverys to Sale ORder Batch Views.

+

Table of contents

+ +
+

Changelog

+ +++ + + + +
0.0.1: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/sale_order_batch_stock/views/sale_order_batch_views.xml b/sale_order_batch_stock/views/sale_order_batch_views.xml new file mode 100644 index 0000000..19a9e9e --- /dev/null +++ b/sale_order_batch_stock/views/sale_order_batch_views.xml @@ -0,0 +1,22 @@ + + + + sale.order.batch.form.stock + sale.order.batch + + + + + + + +