Skip to content

Commit

Permalink
[14.0][IMP] custom_mrp_line_cost: New fields in stock move lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tu Nombre committed Jul 30, 2024
1 parent afa50b4 commit e228804
Show file tree
Hide file tree
Showing 19 changed files with 459 additions and 685 deletions.
2 changes: 1 addition & 1 deletion custom_mrp_line_cost/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"category": "MRP",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/mrp-addons",
"website": "http://www.avanzosc.es",
"depends": [
"mrp",
"mrp_bom_line_coef",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record forcecreate="True" id="moveline_standard_price" model="decimal.precision">
<field name="name">MRP Price Decimal Precision</field>
Expand All @@ -9,3 +8,4 @@
<field name="digits">3</field>
</record>
</odoo>

27 changes: 19 additions & 8 deletions custom_mrp_line_cost/i18n/custom_mrp_line_cost.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-20 11:29+0000\n"
"PO-Revision-Date: 2024-02-20 11:29+0000\n"
"POT-Creation-Date: 2024-07-02 06:20+0000\n"
"PO-Revision-Date: 2024-07-02 06:20+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -87,6 +87,16 @@ msgstr ""
msgid "Canal Cost"
msgstr ""

#. module: custom_mrp_line_cost
#: model:ir.model.fields,field_description:custom_mrp_line_cost.field_stock_move_line__clean_qty
msgid "Clean"
msgstr ""

#. module: custom_mrp_line_cost
#: model:ir.model.fields,field_description:custom_mrp_line_cost.field_stock_move_line__clean_performance
msgid "Clean Performance"
msgstr ""

#. module: custom_mrp_line_cost
#: model:ir.model.fields,field_description:custom_mrp_line_cost.field_mrp_bom_byproduct__coefficient
msgid "Coefficient"
Expand Down Expand Up @@ -156,6 +166,7 @@ msgstr ""

#. module: custom_mrp_line_cost
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.mrp_production_form_view
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.production_move_line_ids_tree_view
#, python-format
Expand Down Expand Up @@ -297,6 +308,7 @@ msgstr ""

#. module: custom_mrp_line_cost
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.mrp_production_form_view
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.production_finished_move_line_ids_tree_view
#, python-format
Expand Down Expand Up @@ -335,12 +347,6 @@ msgstr ""
msgid "Price Difference"
msgstr ""

#. module: custom_mrp_line_cost
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#, python-format
msgid "Produced Move Lines"
msgstr ""

#. module: custom_mrp_line_cost
#: model:ir.model,name:custom_mrp_line_cost.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
Expand Down Expand Up @@ -377,6 +383,11 @@ msgstr ""
msgid "Purchase Unit Price"
msgstr ""

#. module: custom_mrp_line_cost
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.mrp_production_form_view
msgid "Recalculate Costs"
msgstr ""

#. module: custom_mrp_line_cost
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.mrp_production_form_view
msgid "Rto. %"
Expand Down
27 changes: 19 additions & 8 deletions custom_mrp_line_cost/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-20 11:30+0000\n"
"PO-Revision-Date: 2024-02-20 11:30+0000\n"
"POT-Creation-Date: 2024-07-02 06:21+0000\n"
"PO-Revision-Date: 2024-07-02 06:21+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -87,6 +87,16 @@ msgstr "Peso medio canal"
msgid "Canal Cost"
msgstr "Coste canal"

#. module: custom_mrp_line_cost
#: model:ir.model.fields,field_description:custom_mrp_line_cost.field_stock_move_line__clean_qty
msgid "Clean"
msgstr "Limpio"

#. module: custom_mrp_line_cost
#: model:ir.model.fields,field_description:custom_mrp_line_cost.field_stock_move_line__clean_performance
msgid "Clean Performance"
msgstr "Rendimiento limpio"

#. module: custom_mrp_line_cost
#: model:ir.model.fields,field_description:custom_mrp_line_cost.field_mrp_bom_byproduct__coefficient
msgid "Coefficient"
Expand Down Expand Up @@ -156,6 +166,7 @@ msgstr "Nombre mostrado"

#. module: custom_mrp_line_cost
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.mrp_production_form_view
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.production_move_line_ids_tree_view
#, python-format
Expand Down Expand Up @@ -297,6 +308,7 @@ msgstr "Importe total de salidas"

#. module: custom_mrp_line_cost
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.mrp_production_form_view
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.production_finished_move_line_ids_tree_view
#, python-format
Expand Down Expand Up @@ -335,12 +347,6 @@ msgstr "Albaranes por hacer"
msgid "Price Difference"
msgstr "Diferencia"

#. module: custom_mrp_line_cost
#: code:addons/custom_mrp_line_cost/models/mrp_production.py:0
#, python-format
msgid "Produced Move Lines"
msgstr "Operaciones creadas"

#. module: custom_mrp_line_cost
#: model:ir.model,name:custom_mrp_line_cost.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
Expand Down Expand Up @@ -377,6 +383,11 @@ msgstr "Importe de compra"
msgid "Purchase Unit Price"
msgstr "Precio unitario"

#. module: custom_mrp_line_cost
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.mrp_production_form_view
msgid "Recalculate Costs"
msgstr "Recalcular costes"

#. module: custom_mrp_line_cost
#: model_terms:ir.ui.view,arch_db:custom_mrp_line_cost.mrp_production_form_view
msgid "Rto. %"
Expand Down
39 changes: 13 additions & 26 deletions custom_mrp_line_cost/models/killing_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,40 @@ class KillingCost(models.Model):

workcenter_id = fields.Many2one(
string="Workcenter",
comodel_name="mrp.workcenter",
)
comodel_name="mrp.workcenter")
january = fields.Float(
string="January",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
february = fields.Float(
string="February",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
march = fields.Float(
string="March",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
april = fields.Float(
string="April",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
may = fields.Float(
string="May",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
june = fields.Float(
string="June",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
july = fields.Float(
string="July",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
august = fields.Float(
string="August",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
september = fields.Float(
string="September",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
october = fields.Float(
string="October",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
november = fields.Float(
string="November",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
december = fields.Float(
string="December",
digits="Killing Cost Decimal Precision",
)
digits="Killing Cost Decimal Precision")
23 changes: 9 additions & 14 deletions custom_mrp_line_cost/models/mrp_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ class MrpBom(models.Model):
pallet_id = fields.Many2one(
string="Pallet",
comodel_name="product.product",
domain="[('palet', '=', True)]",
)
domain="[('palet', '=', True)]")
packaging_id = fields.Many2one(
string="Packaging",
comodel_name="product.product",
)
comodel_name="product.product")

@api.model
def name_search(self, name="", args=None, operator="ilike", limit=100):
Expand All @@ -24,11 +22,9 @@ def name_search(self, name="", args=None, operator="ilike", limit=100):
if not name:
return result
my_name = "%{}%".format(name)
cond = [
"|",
("product_tmpl_id", operator, my_name),
("code", operator, my_name),
]
cond = ["|",
("product_tmpl_id", operator, my_name),
("code", operator, my_name)]
boms = self.sudo().search(cond)
for bom in boms:
found = False
Expand All @@ -37,10 +33,9 @@ def name_search(self, name="", args=None, operator="ilike", limit=100):
found = True
break
if not found:
result.append(
(
bom.id,
"{}: {}".format(bom.code, bom.product_tmpl_id.display_name),
)
result.append((
bom.id, "{}: {}".format(
bom.code, bom.product_tmpl_id.display_name
))
)
return result
10 changes: 7 additions & 3 deletions custom_mrp_line_cost/models/mrp_bom_byproduct.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
class MrpBomByproduct(models.Model):
_inherit = "mrp.bom.byproduct"

coefficient = fields.Float(string="Coefficient")
expense_kg = fields.Boolean(string="Production Cost", default=False)
cost = fields.Float(string="Fixed Price")
coefficient = fields.Float(
string="Coefficient")
expense_kg = fields.Boolean(
string="Production Cost",
default=False)
cost = fields.Float(
string="Fixed Price")
Loading

0 comments on commit e228804

Please sign in to comment.