Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions product_packaging_template_purchase/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
===================================
Product Packaging Template Purchase
===================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4117f24e9fce866ad6bb85f61ac7b8659d84f7874332cfd3153b3f3b5e29b318
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/18.0/product_packaging_template_purchase
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_packaging_template_purchase
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the ``product_packaging_template`` that adds
packaging on template level.

The goal of this module is being able to set the "Purchase"
configuration (determining if a packaging is usable in purchase orders)
on the packaging template level.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/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 <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_packaging_template_purchase%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* ACSONE SA/NV

Contributors
------------

- Marie Lejeune <marie.lejeune@acsone.eu>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/product-attribute <https://github.com/OCA/product-attribute/tree/18.0/product_packaging_template_purchase>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions product_packaging_template_purchase/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions product_packaging_template_purchase/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Product Packaging Template Purchase",
"summary": """Adds the 'Purchase' information on packaging template level""",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
"depends": [
"product",
"purchase",
"product_packaging_template",
],
"data": [
"views/product_packaging_template.xml",
],
"installable": True,
}
1 change: 1 addition & 0 deletions product_packaging_template_purchase/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_packaging_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models


class ProductPackagingTemplate(models.Model):
_inherit = "product.packaging.template"

purchase = fields.Boolean(
default=True, help="If true, the packaging can be used for purchase orders"
)

@api.model
def _get_values_to_propagate(self, vals):
res = super()._get_values_to_propagate(vals)
if "purchase" in vals:
res["purchase"] = vals["purchase"]
return res

def _prepare_create_values_for_packaging(self):
res = super()._prepare_create_values_for_packaging()
res["purchase"] = self.purchase
return res
3 changes: 3 additions & 0 deletions product_packaging_template_purchase/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions product_packaging_template_purchase/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Marie Lejeune \<<marie.lejeune@acsone.eu>\>
3 changes: 3 additions & 0 deletions product_packaging_template_purchase/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module extends the `product_packaging_template` that adds packaging on template level.

The goal of this module is being able to set the "Purchase" configuration (determining if a packaging is usable in purchase orders) on the packaging template level.
Loading
Loading