Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] product_packaging_level_salable: Migration to 18.0 #1808

Open
wants to merge 12 commits into
base: 18.0
Choose a base branch
from
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
105 changes: 105 additions & 0 deletions product_packaging_level_salable/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
===============================
Product Packaging level salable
===============================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |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_level_salable
: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_level_salable
: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|

The creation/update of sale order line will be blocked (by constraints)
if the data on the sale.order.line does not fit with the configuration
of the product's packagings.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Configuration
=============

This module allows odoo users to set:

- Can be sold: On product packaging level model, this checkbox defines
if product packagings from this particular type are available to be
selected on sale order line.

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_level_salable%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
-------

* Camptocamp

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

- Duong (Tran Quoc) <[email protected]>
- Tris Doan <[email protected]>

Other credits
-------------

The development and migration of this module has been financially
supported by:

- Camptocamp

This module feature was extracted from the original
`sale-workflow/sale_by_packaging <https://github.com/oca/sale-workflow/tree/14.0/sale_by_packaging>`__
module.

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_level_salable>`_ 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_level_salable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions product_packaging_level_salable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2023 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
{
"name": "Product Packaging level salable",
"summary": "",
"version": "18.0.1.0.0",
"development_status": "Alpha",
"category": "Product",
"website": "https://github.com/OCA/product-attribute",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["product_packaging_level", "sale_stock"],
"data": [
"views/product_packaging_level.xml",
],
}
81 changes: 81 additions & 0 deletions product_packaging_level_salable/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_packaging_level_salable
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-29 17:34+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: none\n"
"Language: es\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: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging_level__can_be_sold
msgid "Can be sold"
msgstr "Puede ser vendido"

#. module: product_packaging_level_salable
#: model:ir.model.fields,help:product_packaging_level_salable.field_product_packaging__sales
msgid "If true, the packaging can be used for sales orders"
msgstr "Si es verdadero, el envase puede utilizarse para pedidos de venta"

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_product_packaging_level
msgid "Level management for product.packaging"
msgstr "Gestión de niveles para productos.envasados"

#. module: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging_level__packaging_ids
msgid "Packaging"
msgstr "Empaquetado"

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid ""
"Packaging %(packaging)s on product %(product)s must be set as 'Sales' in "
"order to be used on a sale order."
msgstr ""
"Los %(packaging)s en los %(product)s deben estar configurados como 'Ventas' "
"para poder ser utilizados en un pedido de venta."

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_product_packaging
msgid "Product Packaging"
msgstr "Empaquetado de Producto"

#. module: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging__sales
msgid "Sales"
msgstr "Ventas"

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línea de Orden de Venta"

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid ""
"This product packaging must be set as 'Sales' in order to be used on a sale "
"order."
msgstr ""
"Este embalaje de producto debe estar configurado como \"Ventas\" para poder "
"ser utilizado en un pedido de venta."

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid "Warning"
msgstr "Aviso"
81 changes: 81 additions & 0 deletions product_packaging_level_salable/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_packaging_level_salable
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-10-29 15:40+0000\n"
"Last-Translator: mymage <[email protected]>\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: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging_level__can_be_sold
msgid "Can be sold"
msgstr "Può essere venduto"

#. module: product_packaging_level_salable
#: model:ir.model.fields,help:product_packaging_level_salable.field_product_packaging__sales
msgid "If true, the packaging can be used for sales orders"
msgstr "Se vero, l'imballo può essere utilizzato per gli ordini di vendita"

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_product_packaging_level
msgid "Level management for product.packaging"
msgstr "Gestione livello per product.packaging"

#. module: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging_level__packaging_ids
msgid "Packaging"
msgstr "Imballaggio"

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid ""
"Packaging %(packaging)s on product %(product)s must be set as 'Sales' in "
"order to be used on a sale order."
msgstr ""
"L'imballaggio %(packaging)s nel prodotto %(product)s deve essere impostato a "
"'Vendite' per essere utilizzato nell'ordine di vendita."

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_product_packaging
msgid "Product Packaging"
msgstr "Imballaggio prodotto"

#. module: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging__sales
msgid "Sales"
msgstr "Vendite"

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_sale_order_line
msgid "Sales Order Line"
msgstr "Riga ordine di vendita"

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid ""
"This product packaging must be set as 'Sales' in order to be used on a sale "
"order."
msgstr ""
"Questo imballaggio prodotto deve essere impostato a 'Vendite' per essere "
"usato in un ordine di vendita."

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid "Warning"
msgstr "Attenzione"
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_packaging_level_salable
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging_level__can_be_sold
msgid "Can be sold"
msgstr ""

#. module: product_packaging_level_salable
#: model:ir.model.fields,help:product_packaging_level_salable.field_product_packaging__sales
msgid "If true, the packaging can be used for sales orders"
msgstr ""

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_product_packaging_level
msgid "Level management for product.packaging"
msgstr ""

#. module: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging_level__packaging_ids
msgid "Packaging"
msgstr ""

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid ""
"Packaging %(packaging)s on product %(product)s must be set as 'Sales' in "
"order to be used on a sale order."
msgstr ""

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_product_packaging
msgid "Product Packaging"
msgstr ""

#. module: product_packaging_level_salable
#: model:ir.model.fields,field_description:product_packaging_level_salable.field_product_packaging__sales
msgid "Sales"
msgstr ""

#. module: product_packaging_level_salable
#: model:ir.model,name:product_packaging_level_salable.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid ""
"This product packaging must be set as 'Sales' in order to be used on a sale "
"order."
msgstr ""

#. module: product_packaging_level_salable
#. odoo-python
#: code:addons/product_packaging_level_salable/models/sale_order_line.py:0
#, python-format
msgid "Warning"
msgstr ""
3 changes: 3 additions & 0 deletions product_packaging_level_salable/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import product_packaging
from . import product_packaging_level
from . import sale_order_line
21 changes: 21 additions & 0 deletions product_packaging_level_salable/models/product_packaging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)

from odoo import api, fields, models


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

sales = fields.Boolean(
compute="_compute_sales",
readonly=False,
store=True,
default=None,
help="If true, the packaging can be used for sales orders",
)

@api.depends("packaging_level_id")
def _compute_sales(self):
for record in self:
record.sales = record.packaging_level_id.can_be_sold
Loading
Loading