Skip to content

Commit

Permalink
[FIX] mrp_workorder_grouping_by_material: move line does not have qty…
Browse files Browse the repository at this point in the history
…_to_consume
  • Loading branch information
oihane committed Jul 4, 2024
1 parent 14cdfca commit b02d22d
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 20 deletions.
2 changes: 1 addition & 1 deletion mrp_workorder_grouping_by_material/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Workorders grouping by main material",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"depends": [
"mrp",
Expand Down
24 changes: 18 additions & 6 deletions mrp_workorder_grouping_by_material/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 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-11 08:49+0000\n"
"PO-Revision-Date: 2023-09-11 08:49+0000\n"
"POT-Creation-Date: 2024-05-15 11:44+0000\n"
"PO-Revision-Date: 2024-05-15 11:44+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -26,6 +26,14 @@ msgid ""
" * Cancelled: The MO has been cancelled, can't be confirmed anymore."
msgstr "Técnico: utilizado sólo en vistas"

#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#, python-format
msgid "%(workorder)s: %(error_name)s"
msgstr ""

#. module: mrp_workorder_grouping_by_material
#: model_terms:ir.ui.view,arch_db:mrp_workorder_grouping_by_material.mrp_production_view_form
#: model_terms:ir.ui.view,arch_db:mrp_workorder_grouping_by_material.mrp_workorder_view_form
Expand Down Expand Up @@ -381,13 +389,15 @@ msgstr "Material principal"
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0
#, python-format
msgid "Main material must have an operation"
msgstr "El material principal debe tener una operación"

#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0
#, python-format
msgid "Main product lot is not selected"
msgstr "No seleccionado lote para material principal"
Expand Down Expand Up @@ -739,10 +749,6 @@ msgstr "Empezar a trabajar"

#. module: mrp_workorder_grouping_by_material
#: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest__state
msgid "State"
msgstr "Estado"

#. module: mrp_workorder_grouping_by_material
#: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest_line__state
msgid "Status"
msgstr "Estado"
Expand Down Expand Up @@ -774,13 +780,15 @@ msgstr "El número de productos tomados por esta orden de trabajo"
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder.py:0
#, python-format
msgid "The workcenter is 'nesting_required'"
msgstr "El centro de trabajo requiere anidado"

#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0
#, python-format
msgid ""
"There can only be one main material per operation. Check lines that contains"
Expand Down Expand Up @@ -874,6 +882,7 @@ msgstr "Estado de la orden de trabajo"
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest_line__worksheet
#, python-format
msgid "Worksheet"
Expand All @@ -882,13 +891,15 @@ msgstr "Hoja de trabajo"
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0
#, python-format
msgid "Worksheets"
msgstr "Hojas de trabajo"

#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/wizard/nested_new_line.py:0
#: code:addons/mrp_workorder_grouping_by_material/wizard/nested_new_line.py:0
#, python-format
msgid ""
"the quantity to be produced must be less than or equal to quantity produced"
Expand All @@ -897,6 +908,7 @@ msgstr "La cantidad a producir debe ser menor o igual a la cantidad producida"
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#, python-format
msgid "{}: You should provide a lot/serial number for the final product."
msgstr "{}: Deberias de añadir un lot/num. de serie para el producto final."
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-11 08:49+0000\n"
"PO-Revision-Date: 2023-09-11 08:49+0000\n"
"POT-Creation-Date: 2024-05-15 11:44+0000\n"
"PO-Revision-Date: 2024-05-15 11:44+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -26,6 +26,14 @@ msgid ""
" * Cancelled: The MO has been cancelled, can't be confirmed anymore."
msgstr ""

#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#, python-format
msgid "%(workorder)s: %(error_name)s"
msgstr ""

#. module: mrp_workorder_grouping_by_material
#: model_terms:ir.ui.view,arch_db:mrp_workorder_grouping_by_material.mrp_production_view_form
#: model_terms:ir.ui.view,arch_db:mrp_workorder_grouping_by_material.mrp_workorder_view_form
Expand Down Expand Up @@ -381,13 +389,15 @@ msgstr ""
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0
#, python-format
msgid "Main material must have an operation"
msgstr ""

#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0
#, python-format
msgid "Main product lot is not selected"
msgstr ""
Expand Down Expand Up @@ -564,7 +574,7 @@ msgstr ""

#. module: mrp_workorder_grouping_by_material
#: model:ir.model.fields,help:mrp_workorder_grouping_by_material.field_mrp_workorder_nest__message_needaction_counter
msgid "Number of messages which requires an action"
msgid "Number of messages requiring action"
msgstr ""

#. module: mrp_workorder_grouping_by_material
Expand Down Expand Up @@ -739,10 +749,6 @@ msgstr ""

#. module: mrp_workorder_grouping_by_material
#: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest__state
msgid "State"
msgstr ""

#. module: mrp_workorder_grouping_by_material
#: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest_line__state
msgid "Status"
msgstr ""
Expand Down Expand Up @@ -770,13 +776,15 @@ msgstr ""
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder.py:0
#, python-format
msgid "The workcenter is 'nesting_required'"
msgstr ""

#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_bom.py:0
#, python-format
msgid ""
"There can only be one main material per operation. Check lines that contains"
Expand Down Expand Up @@ -870,6 +878,7 @@ msgstr ""
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#: model:ir.model.fields,field_description:mrp_workorder_grouping_by_material.field_mrp_workorder_nest_line__worksheet
#, python-format
msgid "Worksheet"
Expand All @@ -878,13 +887,15 @@ msgstr ""
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest.py:0
#, python-format
msgid "Worksheets"
msgstr ""

#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/wizard/nested_new_line.py:0
#: code:addons/mrp_workorder_grouping_by_material/wizard/nested_new_line.py:0
#, python-format
msgid ""
"the quantity to be produced must be less than or equal to quantity produced"
Expand All @@ -893,6 +904,7 @@ msgstr ""
#. module: mrp_workorder_grouping_by_material
#. odoo-python
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#: code:addons/mrp_workorder_grouping_by_material/models/mrp_workorder_nest_line.py:0
#, python-format
msgid "{}: You should provide a lot/serial number for the final product."
msgstr ""
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def _write_lot_producing_qty(self):
move_line.write(
{
"lot_id": n_line.nest_id.lot_id.id,
"qty_done": move_line.qty_to_consume,
"qty_done": move_line.reserved_qty,
}
)
# if res:
Expand Down Expand Up @@ -326,10 +326,10 @@ def action_check_ready(self):
elif nl.workorder_id.state == "done":
nl.state = "done"

def action_cancel(self):
if not any(self.filtered(lambda n: n.state == "ready")):
raise UserError(_(""))
return self.write({"state": "cancel"})
# def action_cancel(self):
# if not any(self.filtered(lambda n: n.state == "ready")):
# raise UserError(_(""))
# return self.write({"state": "cancel"})

def button_start(self):
for nl in self.filtered(lambda n: n.state == "ready"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
string="Planned Start Date"
domain="[]"
context="{'group_by': 'date_planned_start'}"
/>
<filter
name="group_state"
string="Status"
domain="[]"
context="{'group_by': 'state'}"
/>
</group>
</search>
Expand All @@ -39,7 +45,14 @@
<field name="lot_id" />
<field name="date_planned_start" widget="date" />
<field name="done_cancel_lines" invisible="1" />
<field name="state" invisible="1" />
<field
name="state"
widget="badge"
decoration-success="state == 'done'"
decoration-info="state not in ('done', 'cancel')"
readonly="1"
optional="show"
/>
</tree>
</field>
</record>
Expand Down

0 comments on commit b02d22d

Please sign in to comment.