-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] mrp_workorder_scrap_button: In Work order form view new b…
…utton "Scrap".
- Loading branch information
1 parent
cc1bb49
commit 7c13624
Showing
13 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. 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 Workorder scrap button | ||
========================== | ||
|
||
* In Work order form view new button "Scrap", and in work order tree view | ||
new icon "Scrap". | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/avanzosc/mrp-addons/issues>`_. In case of trouble, | ||
please check there if your issue has already been reported. If you spotted | ||
it first, help us smash it by providing detailed and welcomed feedback. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Ana Juaristi <[email protected]> | ||
* Alfredo de la Fuente <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Mrp Workorder Scrap Button", | ||
"version": "16.0.1.0.0", | ||
"author": "Avanzosc", | ||
"website": "https://github.com/avanzosc/mrp-addons", | ||
"category": "Manufacturing/Manufacturing", | ||
"license": "AGPL-3", | ||
"depends": ["mrp"], | ||
"data": [ | ||
"views/mrp_workorder_views.xml", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_workorder_scrap_button | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-14 07:43+0000\n" | ||
"PO-Revision-Date: 2024-11-14 07:43+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_workorder_scrap_button | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_tree_editable_view | ||
msgid "Scrap" | ||
msgstr "" | ||
|
||
#. module: mrp_workorder_scrap_button | ||
#: model:ir.model,name:mrp_workorder_scrap_button.model_mrp_workorder | ||
msgid "Work Order" | ||
msgstr "Ordre de treball" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_workorder_scrap_button | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-14 07:43+0000\n" | ||
"PO-Revision-Date: 2024-11-14 07:43+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_workorder_scrap_button | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_tree_editable_view | ||
msgid "Scrap" | ||
msgstr "" | ||
|
||
#. module: mrp_workorder_scrap_button | ||
#: model:ir.model,name:mrp_workorder_scrap_button.model_mrp_workorder | ||
msgid "Work Order" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_workorder_scrap_button | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-14 07:44+0000\n" | ||
"PO-Revision-Date: 2024-11-14 07:44+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_workorder_scrap_button | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_tree_editable_view | ||
msgid "Scrap" | ||
msgstr "Desechar" | ||
|
||
#. module: mrp_workorder_scrap_button | ||
#: model:ir.model,name:mrp_workorder_scrap_button.model_mrp_workorder | ||
msgid "Work Order" | ||
msgstr "Orden de trabajo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_workorder_scrap_button | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-14 07:44+0000\n" | ||
"PO-Revision-Date: 2024-11-14 07:44+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_workorder_scrap_button | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_tree_editable_view | ||
msgid "Scrap" | ||
msgstr "" | ||
|
||
#. module: mrp_workorder_scrap_button | ||
#: model:ir.model,name:mrp_workorder_scrap_button.model_mrp_workorder | ||
msgid "Work Order" | ||
msgstr "Ordre de travail" |
27 changes: 27 additions & 0 deletions
27
mrp_workorder_scrap_button/i18n/mrp_workorder_scrap_button.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_workorder_scrap_button | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-14 07:43+0000\n" | ||
"PO-Revision-Date: 2024-11-14 07:43+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_workorder_scrap_button | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:mrp_workorder_scrap_button.mrp_production_workorder_tree_editable_view | ||
msgid "Scrap" | ||
msgstr "" | ||
|
||
#. module: mrp_workorder_scrap_button | ||
#: model:ir.model,name:mrp_workorder_scrap_button.model_mrp_workorder | ||
msgid "Work Order" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import mrp_workorder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from odoo import models | ||
|
||
|
||
class MrpWorkorder(models.Model): | ||
_inherit = "mrp.workorder" | ||
|
||
def button_scrap(self): | ||
self.ensure_one() | ||
result = super().button_scrap() | ||
result["context"]["product_ids"] = ( | ||
self.move_raw_ids.filtered(lambda x: x.state not in ("done", "cancel")) | ||
.mapped("product_id") | ||
.ids | ||
) | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<odoo> | ||
<record id="mrp_production_workorder_form_view_inherit" model="ir.ui.view"> | ||
<field name="model">mrp.workorder</field> | ||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit" /> | ||
<field name="arch" type="xml"> | ||
<field name="state" position="before"> | ||
<button | ||
name="button_scrap" | ||
type="object" | ||
string="Scrap" | ||
attrs="{'invisible': [('state', 'in', ('cancel', 'done'))]}" | ||
/> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record id="mrp_production_workorder_tree_editable_view" model="ir.ui.view"> | ||
<field name="model">mrp.workorder</field> | ||
<field | ||
name="inherit_id" | ||
ref="mrp.mrp_production_workorder_tree_editable_view" | ||
/> | ||
<field name="arch" type="xml"> | ||
<button name="action_open_wizard" position="before"> | ||
<button | ||
name="button_scrap" | ||
type="object" | ||
attrs="{'invisible': [('state', 'in', ('cancel', 'done'))]}" | ||
help="Scrap" | ||
icon="fa-trash" | ||
/> | ||
</button> | ||
</field> | ||
</record> | ||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/mrp_workorder_scrap_button/odoo/addons/mrp_workorder_scrap_button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../mrp_workorder_scrap_button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |