diff --git a/purchase_packaging_uom/README.rst b/purchase_packaging_uom/README.rst new file mode 100644 index 00000000000..5696af9a261 --- /dev/null +++ b/purchase_packaging_uom/README.rst @@ -0,0 +1,3 @@ +# purchase_packaging_uom + +This is the README for purchase_packaging_uom. \ No newline at end of file diff --git a/purchase_packaging_uom/__init__.py b/purchase_packaging_uom/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/purchase_packaging_uom/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_packaging_uom/__manifest__.py b/purchase_packaging_uom/__manifest__.py new file mode 100644 index 00000000000..28b1cd5d941 --- /dev/null +++ b/purchase_packaging_uom/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2020 Camptocamp SA +# Copyright 2020 ForgeFlow, S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +{ + "name": "Purchase Packaging UoM", + "summary": "Adds purchase uom to product packaging", + "version": "16.0.1.0.0", + "category": "Purchase", + "website": "https://github.com/OCA/purchase-workflow", + "author": "Ametras, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": ["product"], + "data": ["views/product_packaging.xml"], +} diff --git a/purchase_packaging_uom/models/__init__.py b/purchase_packaging_uom/models/__init__.py new file mode 100644 index 00000000000..2c4d9a88a37 --- /dev/null +++ b/purchase_packaging_uom/models/__init__.py @@ -0,0 +1 @@ +from . import product_packaging diff --git a/purchase_packaging_uom/models/product_packaging.py b/purchase_packaging_uom/models/product_packaging.py new file mode 100644 index 00000000000..4144f5bc4c5 --- /dev/null +++ b/purchase_packaging_uom/models/product_packaging.py @@ -0,0 +1,13 @@ +# Copyright 2021 Ametras +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +from odoo import fields, models + + +class ProductPackaging(models.Model): + _inherit = "product.packaging" + + product_uom_po_id = fields.Many2one( + "uom.uom", + related="product_id.uom_po_id", + readonly=True, + ) diff --git a/purchase_packaging_uom/static/description/icon.png b/purchase_packaging_uom/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/purchase_packaging_uom/static/description/icon.png differ diff --git a/purchase_packaging_uom/static/description/index.html b/purchase_packaging_uom/static/description/index.html new file mode 100644 index 00000000000..e6d6415540d --- /dev/null +++ b/purchase_packaging_uom/static/description/index.html @@ -0,0 +1,441 @@ + + + + + + + Purchase Order Line Packaging Quantity + + + +
+

Purchase Order Line Packaging Quantity

+ + +

Alpha + License: AGPL-3 OCA/purchase-workflow Translate me on Weblate + Try me on Runbot

+

This module adds a “Purchase UoM” field on product packaging.

+

Table of contents

+
+ +
+
+

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 smashing it by providing a detailed and welcomed + feedback. +

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Ametras
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose + mission is to support the collaborative development of Odoo features and + promote its widespread use.

+

This module is part of the OCA/purchase-workflow + project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. +

+
+
+
+ + diff --git a/purchase_packaging_uom/views/product_packaging.xml b/purchase_packaging_uom/views/product_packaging.xml new file mode 100644 index 00000000000..bb6da7cb252 --- /dev/null +++ b/purchase_packaging_uom/views/product_packaging.xml @@ -0,0 +1,25 @@ + + + + product.packaging.tree.view.inherit + product.packaging + + + + + + + + + product.packaging.form.view.inherit + product.packaging + + + + + + + + + + diff --git a/setup/purchase_packaging_uom/odoo/addons/purchase_packaging_uom b/setup/purchase_packaging_uom/odoo/addons/purchase_packaging_uom new file mode 120000 index 00000000000..eee3bead9a9 --- /dev/null +++ b/setup/purchase_packaging_uom/odoo/addons/purchase_packaging_uom @@ -0,0 +1 @@ +../../../../purchase_packaging_uom \ No newline at end of file diff --git a/setup/purchase_packaging_uom/setup.py b/setup/purchase_packaging_uom/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/purchase_packaging_uom/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)