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
111 changes: 111 additions & 0 deletions purchase_stock_packaging/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

========================
Purchase Stock Packaging
========================

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

.. |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-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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/19.0/purchase_stock_packaging
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-19-0/purchase-workflow-19-0-purchase_stock_packaging
: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/purchase-workflow&target_branch=19.0
:alt: Try me on Runboat

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

This module allows to transmit the product packaging from the
procurement values to the generated purchase order line

**Table of contents**

.. contents::
:local:

Usage
=====

- For instance, create a sale order with a route that trigger make to
order stock rules (and a purchase order).
- On that sale order, force using a product packaging that would not be
the default one for the filled in qunatity.
- The purchase order line created should use the same product packaging.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/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/purchase-workflow/issues/new?body=module:%20purchase_stock_packaging%0Aversion:%2019.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
* ForgeFlow

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

- Lois Rilo Antelo <lois.rilo@forgeflow.com>
- Denis Roussel <denis.roussel@acsone.eu>
- `Binhex System Solutions <https://binhex.cloud/>`__:

- Deriman Alonso <d.alonso@binhex.cloud>

- `360ERP <https://www.360erp.com>`__:

- Kevin Khao <kevinkhao@gmail.com>

- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

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.

.. |maintainer-rousseldenis| image:: https://github.com/rousseldenis.png?size=40px
:target: https://github.com/rousseldenis
:alt: rousseldenis

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-rousseldenis|

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/19.0/purchase_stock_packaging>`_ 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 purchase_stock_packaging/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions purchase_stock_packaging/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2022 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Purchase Stock Packaging",
"summary": """
Allows to transmit the product packaging from the procurement values
to the generated purchase order line""",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"maintainers": ["rousseldenis"],
"author": "ACSONE SA/NV,ForgeFlow,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"depends": [
"purchase_stock",
],
}
23 changes: 23 additions & 0 deletions purchase_stock_packaging/i18n/hr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_stock_packaging
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-01-04 02:40+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>\n"
"Language-Team: none\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.14.1\n"

#. module: purchase_stock_packaging
#: model:ir.model,name:purchase_stock_packaging.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Stavka narudžbe"
22 changes: 22 additions & 0 deletions purchase_stock_packaging/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_stock_packaging
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-22 14:36+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: purchase_stock_packaging
#: model:ir.model,name:purchase_stock_packaging.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Riga ordine di acquisto"
20 changes: 20 additions & 0 deletions purchase_stock_packaging/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_stock_packaging
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"

#. module: purchase_stock_packaging
#: model:ir.model,name:purchase_stock_packaging.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
19 changes: 19 additions & 0 deletions purchase_stock_packaging/i18n/purchase_stock_packaging.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_stock_packaging
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: purchase_stock_packaging
#: model:ir.model,name:purchase_stock_packaging.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
23 changes: 23 additions & 0 deletions purchase_stock_packaging/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_stock_packaging
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-01-10 08:44+0000\n"
"Last-Translator: Matjaz Mozetic <matjaz@luxim.si>\n"
"Language-Team: none\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
"n%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: purchase_stock_packaging
#: model:ir.model,name:purchase_stock_packaging.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Postavka nabavnega naloga"
1 change: 1 addition & 0 deletions purchase_stock_packaging/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import purchase_order_line
42 changes: 42 additions & 0 deletions purchase_stock_packaging/models/purchase_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2022 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"

@api.model
def _prepare_purchase_order_line_from_procurement(
self,
product_id,
product_qty,
product_uom,
location_dest_id,
name,
origin,
company_id,
values,
po,
):
# For new PO lines we set the product packaging if present in
# the procurement values.
res = super()._prepare_purchase_order_line_from_procurement(
product_id,
product_qty,
product_uom,
location_dest_id,
name,
origin,
company_id,
values,
po,
)
packaging_uom = values.get("packaging_uom_id")
if packaging_uom:
res["product_uom_id"] = packaging_uom.id
res["product_qty"] = product_uom._compute_quantity(
product_qty, packaging_uom
)
return res
3 changes: 3 additions & 0 deletions purchase_stock_packaging/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
8 changes: 8 additions & 0 deletions purchase_stock_packaging/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- Lois Rilo Antelo \<<lois.rilo@forgeflow.com>\>
- Denis Roussel \<<denis.roussel@acsone.eu>\>
- [Binhex System Solutions](https://binhex.cloud/):
- Deriman Alonso \<<d.alonso@binhex.cloud>\>
- [360ERP](https://www.360erp.com):
- Kevin Khao \<<kevinkhao@gmail.com>\>
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
- Bhavesh Heliconia
2 changes: 2 additions & 0 deletions purchase_stock_packaging/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to transmit the product packaging from the
procurement values to the generated purchase order line
5 changes: 5 additions & 0 deletions purchase_stock_packaging/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- For instance, create a sale order with a route that trigger make to
order stock rules (and a purchase order).
- On that sale order, force using a product packaging that would not be
the default one for the filled in qunatity.
- The purchase order line created should use the same product packaging.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading