mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_progress_button: Unstart button and date_start field added
This commit is contained in:
@@ -18,3 +18,12 @@ class MrpProduction(models.Model):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def action_unstart(self):
|
||||||
|
self.write(
|
||||||
|
{
|
||||||
|
"state": "confirmed",
|
||||||
|
"date_start": False,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return True
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
* Florian da Costa <florian.dacosta@akretion.com>
|
* Florian da Costa <florian.dacosta@akretion.com>
|
||||||
|
* Bernat Puig Font <bernat.puig@forgeflow.com>
|
||||||
|
|||||||
@@ -95,3 +95,5 @@ class TestProgressButton(TransactionCase):
|
|||||||
)
|
)
|
||||||
production.action_progress()
|
production.action_progress()
|
||||||
self.assertEqual(production.state, "progress")
|
self.assertEqual(production.state, "progress")
|
||||||
|
production.action_unstart()
|
||||||
|
self.assertEqual(production.state, "confirmed")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="mrp_production_progress_button_form_view" model="ir.ui.view">
|
<record id="mrp_production_progress_button_form_view" model="ir.ui.view">
|
||||||
|
<field name="name">mrp.production.view.form.progress.button</field>
|
||||||
<field name="model">mrp.production</field>
|
<field name="model">mrp.production</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
|
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
@@ -14,7 +14,17 @@
|
|||||||
class="oe_highlight"
|
class="oe_highlight"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
<button name="action_assign" position="after">
|
||||||
|
<button
|
||||||
|
name="action_unstart"
|
||||||
|
attrs="{'invisible': [('state', '!=', 'progress')]}"
|
||||||
|
type="object"
|
||||||
|
string="Unstart"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
<field name="company_id" position="after">
|
||||||
|
<field name="date_start" />
|
||||||
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user