diff --git a/sale_order_batch_stock/README.rst b/sale_order_batch_stock/README.rst new file mode 100644 index 0000000..a315b57 --- /dev/null +++ b/sale_order_batch_stock/README.rst @@ -0,0 +1,70 @@ +.. 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 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/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-madmooose%2Fodooapps-lightgray.png?logo=github + :target: https://github.com/madmooose/odooapps/tree/16.0/sale_order_batch_stock + :alt: madmooose/odooapps + +|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 +* Niels Göttsch + +Contributors +~~~~~~~~~~~~ + +* Niels Göttsch + +Maintainers +~~~~~~~~~~~ + +This module is part of the `madmooose/odooapps `_ 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..3952616 --- /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,Niels Göttsch", + "website": "https://ziemlichoptimal.de", + "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..71affa2 --- /dev/null +++ b/sale_order_batch_stock/models/sale_order_batch.py @@ -0,0 +1,24 @@ +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/pyproject.toml b/sale_order_batch_stock/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/sale_order_batch_stock/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" 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/icon.png b/sale_order_batch_stock/static/description/icon.png new file mode 100644 index 0000000..1267712 Binary files /dev/null and b/sale_order_batch_stock/static/description/icon.png differ 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..451bf2a --- /dev/null +++ b/sale_order_batch_stock/static/description/index.html @@ -0,0 +1,435 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Sale Order Batch Stock Binding

+ +

Beta License: LGPL-3 madmooose/odooapps

+

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
  • +
  • Niels Göttsch
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the madmooose/odooapps 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..0373704 --- /dev/null +++ b/sale_order_batch_stock/views/sale_order_batch_views.xml @@ -0,0 +1,26 @@ + + + + sale.order.batch.form.stock + sale.order.batch + + + + + + + + diff --git a/setup/.setuptools-odoo-make-default-ignore b/setup/.setuptools-odoo-make-default-ignore new file mode 100644 index 0000000..207e615 --- /dev/null +++ b/setup/.setuptools-odoo-make-default-ignore @@ -0,0 +1,2 @@ +# addons listed in this file are ignored by +# setuptools-odoo-make-default (one addon per line) diff --git a/setup/README b/setup/README new file mode 100644 index 0000000..a63d633 --- /dev/null +++ b/setup/README @@ -0,0 +1,2 @@ +To learn more about this directory, please visit +https://pypi.python.org/pypi/setuptools-odoo diff --git a/setup/sale_order_batch/odoo/addons/sale_order_batch b/setup/sale_order_batch/odoo/addons/sale_order_batch new file mode 120000 index 0000000..80470a0 --- /dev/null +++ b/setup/sale_order_batch/odoo/addons/sale_order_batch @@ -0,0 +1 @@ +../../../../sale_order_batch \ No newline at end of file diff --git a/setup/sale_order_batch/setup.py b/setup/sale_order_batch/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/sale_order_batch/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)