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

[17.0][MIG] ddmrp_exclude_moves_adu_calc_sales #487

Merged
86 changes: 86 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
==================================
DDMRP Exclude Moves ADU Calc Sales
==================================

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

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

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

This module extends ddmrp_exclude_moves_adu_calc to be able to mark sale
order lines to be excluded from adu calculation

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/ddmrp/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/ddmrp/issues/new?body=module:%20ddmrp_exclude_moves_adu_calc_sales%0Aversion:%2017.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
-------

* ForgeFlow

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

- Lois Rilo <[email protected]>
- David Jiménez <[email protected]>

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-DavidJForgeFlow| image:: https://github.com/DavidJForgeFlow.png?size=40px
:target: https://github.com/DavidJForgeFlow
:alt: DavidJForgeFlow

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

|maintainer-DavidJForgeFlow|

This module is part of the `OCA/ddmrp <https://github.com/OCA/ddmrp/tree/17.0/ddmrp_exclude_moves_adu_calc_sales>`_ 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 ddmrp_exclude_moves_adu_calc_sales/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

{
"name": "DDMRP Exclude Moves ADU Calc Sales",
"summary": "DDMRP Exclude Moves ADU Calc integration with Sales app.",
"version": "17.0.1.0.1",
"development_status": "Beta",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"maintainers": ["DavidJForgeFlow"],
"website": "https://github.com/OCA/ddmrp",
"category": "Warehouse Management",
"depends": ["sale", "ddmrp_exclude_moves_adu_calc"],
"data": ["views/sale_order_view.xml"],
"license": "LGPL-3",
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * ddmrp_exclude_moves_adu_calc_sales
#
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: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model.fields,field_description:ddmrp_exclude_moves_adu_calc_sales.field_sale_order_line__exclude_from_adu
msgid "Exclude from ADU calculation"
msgstr ""

#. module: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model.fields,help:ddmrp_exclude_moves_adu_calc_sales.field_sale_order_line__exclude_from_adu
msgid ""
"If this flag is set related stock moves will be excluded from ADU "
"calculation"
msgstr ""

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

#. module: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model,name:ddmrp_exclude_moves_adu_calc_sales.model_stock_move
msgid "Stock Move"
msgstr ""
41 changes: 41 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * ddmrp_exclude_moves_adu_calc_sales
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-03-20 20:35+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: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model.fields,field_description:ddmrp_exclude_moves_adu_calc_sales.field_sale_order_line__exclude_from_adu
msgid "Exclude from ADU calculation"
msgstr "Excluir del cálculo ADU"

#. module: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model.fields,help:ddmrp_exclude_moves_adu_calc_sales.field_sale_order_line__exclude_from_adu
msgid ""
"If this flag is set related stock moves will be excluded from ADU "
"calculation"
msgstr ""
"Si se activa este indicador, los movimientos de existencias relacionados se "
"excluirán del cálculo de ADU"

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

#. module: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model,name:ddmrp_exclude_moves_adu_calc_sales.model_stock_move
msgid "Stock Move"
msgstr "Movimiento de Almacén"
41 changes: 41 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * ddmrp_exclude_moves_adu_calc_sales
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-03-04 09:35+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: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model.fields,field_description:ddmrp_exclude_moves_adu_calc_sales.field_sale_order_line__exclude_from_adu
msgid "Exclude from ADU calculation"
msgstr "Escudere dal calcolo ADU"

#. module: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model.fields,help:ddmrp_exclude_moves_adu_calc_sales.field_sale_order_line__exclude_from_adu
msgid ""
"If this flag is set related stock moves will be excluded from ADU "
"calculation"
msgstr ""
"Se questa opzione è attiva, i movimenti di magazzino relativi verranno "
"esclusi dal calcolo ADU"

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

#. module: ddmrp_exclude_moves_adu_calc_sales
#: model:ir.model,name:ddmrp_exclude_moves_adu_calc_sales.model_stock_move
msgid "Stock Move"
msgstr "Movimento di magazzino"
2 changes: 2 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import sale_order_line
from . import stock_move
22 changes: 22 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo import fields, models


class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

exclude_from_adu = fields.Boolean(
string="Exclude from ADU calculation",
copy=False,
help="If this flag is set related stock moves will be excluded from "
"ADU calculation",
)

def write(self, vals):
if "exclude_from_adu" in vals:
self.mapped("move_ids").write(
{"exclude_from_adu": vals.get("exclude_from_adu")}
)
return super().write(vals)
16 changes: 16 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 ForgeFlow (http://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo import models


class StockMove(models.Model):
_inherit = "stock.move"

def _toggle_exclude_from_adu(self):
res = super()._toggle_exclude_from_adu()
for sl in self.mapped("sale_line_id"):
value = sl.move_ids.mapped("exclude_from_adu")
if len(value) == 1:
sl.exclude_from_adu = value[0]
return res
3 changes: 3 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Lois Rilo \<<[email protected]>\>
- David Jiménez \<<[email protected]>\>
2 changes: 2 additions & 0 deletions ddmrp_exclude_moves_adu_calc_sales/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module extends ddmrp_exclude_moves_adu_calc to be able to mark sale
order lines to be excluded from adu calculation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading