Skip to content

Commit

Permalink
[MIG] mrp_bom_cost_in_product_base_cost
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Aug 22, 2024
1 parent 14cdfca commit 2fa09fa
Show file tree
Hide file tree
Showing 15 changed files with 547 additions and 0 deletions.
24 changes: 24 additions & 0 deletions mrp_bom_cost_in_product_base_cost/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=================================
MRP BoM cost in product base cost
=================================

* Put the cost of the BoM in base cost, and recalculate standard price.


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


Credits
=======

Contributors
------------
* Ana Juaristi <anajuaristi@avanzosc.es>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>

Do not contact contributors directly about support or help with technical issues.
4 changes: 4 additions & 0 deletions mrp_bom_cost_in_product_base_cost/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2020 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import models
from . import wizard
19 changes: 19 additions & 0 deletions mrp_bom_cost_in_product_base_cost/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2020 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "MRP BoM Cost In Product Base Cost",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"depends": ["product_category_sale_price", "mrp_account"],
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/odoo-addons",
"category": "Sales",
"data": [
"views/product_product_view.xml",
"wizard/wiz_product_template_recalculate_bom_cost_view.xml",
"wizard/wiz_product_product_recalculate_bom_cost_view.xml",
"wizard/wiz_product_product_recalculate_bom_cost2_view.xml",
],
"installable": True,
"auto_install": True,
}
133 changes: 133 additions & 0 deletions mrp_bom_cost_in_product_base_cost/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mrp_bom_cost_in_product_base_cost
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-07-24 13:37+0000\n"
"PO-Revision-Date: 2020-07-24 13:37+0000\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: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.view_change_standard_price
msgid "Base cost"
msgstr "Coste base"

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost2_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_template_recalculate_bom_cost_view_form
msgid "Cancel"
msgstr "Cancelar"

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.actions.act_window,name:mrp_bom_cost_in_product_base_cost.action_wiz_recalculate_product_product_sale_price
#: model:ir.actions.act_window,name:mrp_bom_cost_in_product_base_cost.action_wiz_recalculate_product_template_sale_price
msgid "Compute base cost from BoM"
msgstr "Calcular coste base desde LdM"

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.product_product_view_form_normal_inherit_extended
msgid "Compute cost from BoM"
msgstr "Calcular coste desde LdM"

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.product_product_view_form_normal_inherit_extended
msgid "Compute the price of the product using products and operations of related bill of materials, for manufactured products only."
msgstr "Calcule el precio del producto usando productos y operaciones del proyecto de ley relacionado con materiales, sólo para los productos manufacturados ."

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__create_uid
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__create_uid
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__create_uid
msgid "Created by"
msgstr "Creado por"

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__create_date
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__create_date
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__create_date
msgid "Created on"
msgstr "Creado el"

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__display_name
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__display_name
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__id
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__id
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__id
msgid "ID"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2____last_update
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost____last_update
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost____last_update
msgid "Last Modified on"
msgstr "Última modificación en"

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__write_uid
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__write_uid
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__write_uid
msgid "Last Updated by"
msgstr "Última actualización por"

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__write_date
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__write_date
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__write_date
msgid "Last Updated on"
msgstr "Última actualización el"

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model,name:mrp_bom_cost_in_product_base_cost.model_product_product
msgid "Product"
msgstr "Producto"

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost2_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_template_recalculate_bom_cost_view_form
msgid "Recalculate BoM cost"
msgstr "Recalcular coste LdM"

#. module: mrp_bom_cost_in_product_base_cost
#: code:addons/mrp_bom_cost_in_product_base_cost/models/product.py:38
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost2_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_template_recalculate_bom_cost_view_form
#, python-format
msgid "Recalculate BoM cost in products"
msgstr "Recalcular coste LdM en productos"

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model,name:mrp_bom_cost_in_product_base_cost.model_wiz_product_product_recalculate_bom_cost
#: model:ir.model,name:mrp_bom_cost_in_product_base_cost.model_wiz_product_product_recalculate_bom_cost2
#: model:ir.model,name:mrp_bom_cost_in_product_base_cost.model_wiz_product_template_recalculate_bom_cost
msgid "Wizard for recalculate BoM cost in products"
msgstr "Asistente para recalcular coste LdM en productos"

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_template_recalculate_bom_cost_view_form
msgid "You are going to recalculate BoM cost in base cost. Are you sure?"
msgstr "Usted va a recalcular el coste base desde la LdM. ¿Está usted seguro?"

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost2_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost_view_form
msgid "You are going to recalculate base cost from the BoM. Are you sure?"
msgstr "Usted va a recalcular el coste base desde la LdM. ¿Está usted seguro?"

Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mrp_bom_cost_in_product_base_cost
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-07-24 13:37+0000\n"
"PO-Revision-Date: 2020-07-24 13:37+0000\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: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.view_change_standard_price
msgid "Base cost"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost2_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_template_recalculate_bom_cost_view_form
msgid "Cancel"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.actions.act_window,name:mrp_bom_cost_in_product_base_cost.action_wiz_recalculate_product_product_sale_price
#: model:ir.actions.act_window,name:mrp_bom_cost_in_product_base_cost.action_wiz_recalculate_product_template_sale_price
msgid "Compute base cost from BoM"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.product_product_view_form_normal_inherit_extended
msgid "Compute cost from BoM"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.product_product_view_form_normal_inherit_extended
msgid "Compute the price of the product using products and operations of related bill of materials, for manufactured products only."
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__create_uid
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__create_uid
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__create_uid
msgid "Created by"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__create_date
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__create_date
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__create_date
msgid "Created on"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__display_name
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__display_name
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__display_name
msgid "Display Name"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__id
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__id
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__id
msgid "ID"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2____last_update
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost____last_update
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost____last_update
msgid "Last Modified on"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__write_uid
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__write_uid
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__write_uid
msgid "Last Updated by"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost2__write_date
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_product_recalculate_bom_cost__write_date
#: model:ir.model.fields,field_description:mrp_bom_cost_in_product_base_cost.field_wiz_product_template_recalculate_bom_cost__write_date
msgid "Last Updated on"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model,name:mrp_bom_cost_in_product_base_cost.model_product_product
msgid "Product"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost2_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_template_recalculate_bom_cost_view_form
msgid "Recalculate BoM cost"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: code:addons/mrp_bom_cost_in_product_base_cost/models/product.py:38
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost2_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_template_recalculate_bom_cost_view_form
#, python-format
msgid "Recalculate BoM cost in products"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model:ir.model,name:mrp_bom_cost_in_product_base_cost.model_wiz_product_product_recalculate_bom_cost
#: model:ir.model,name:mrp_bom_cost_in_product_base_cost.model_wiz_product_product_recalculate_bom_cost2
#: model:ir.model,name:mrp_bom_cost_in_product_base_cost.model_wiz_product_template_recalculate_bom_cost
msgid "Wizard for recalculate BoM cost in products"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_template_recalculate_bom_cost_view_form
msgid "You are going to recalculate BoM cost in base cost. Are you sure?"
msgstr ""

#. module: mrp_bom_cost_in_product_base_cost
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost2_view_form
#: model_terms:ir.ui.view,arch_db:mrp_bom_cost_in_product_base_cost.wiz_product_product_recalculate_bom_cost_view_form
msgid "You are going to recalculate base cost from the BoM. Are you sure?"
msgstr ""

3 changes: 3 additions & 0 deletions mrp_bom_cost_in_product_base_cost/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2020 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import product
53 changes: 53 additions & 0 deletions mrp_bom_cost_in_product_base_cost/models/product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 2020 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import _, api, models


class ProductProduct(models.Model):
_inherit = "product.product"

def action_bom_cost(self):
return super(
ProductProduct, self.with_context(update_base_cost=True)
).action_bom_cost()

def button_bom_cost(self):
self.ensure_one()
return super(
ProductProduct, self.with_context(update_base_cost=True)
).button_bom_cost()

def do_change_standard_price(self, new_price, account_id):
result = super(
ProductProduct, self.with_context(update_base_cost=True)
).do_change_standard_price(new_price, account_id)
return result

def button_call_wizard_calculate_bom_cost(self):
self.ensure_one()
wiz_obj = self.env["wiz.product.product.recalculate.bom.cost2"]
wiz = wiz_obj.with_context(
{
"active_id": self.id,
"active_ids": self.ids,
"active_model": "product.product",
}
).create({})
context = self.env.context.copy()
context.update(
{
"active_id": self.id,
"active_ids": self.ids,
"active_model": "product.product",
}
)
return {
"name": _("Recalculate BoM cost in products"),
"type": "ir.actions.act_window",
"res_model": "wiz.product.product.recalculate.bom.cost2",
"view_type": "form",
"view_mode": "form",
"res_id": wiz.id,
"target": "new",
"context": context,
}
Loading

0 comments on commit 2fa09fa

Please sign in to comment.