Protect Cancel button with a confirmation pop-up
This commit is contained in:
@@ -16,6 +16,8 @@ class PurchaseOrder(models.Model):
|
|||||||
fiscal_position_id = fields.Many2one(track_visibility='onchange')
|
fiscal_position_id = fields.Many2one(track_visibility='onchange')
|
||||||
incoterm_id = fields.Many2one(track_visibility='onchange')
|
incoterm_id = fields.Many2one(track_visibility='onchange')
|
||||||
partner_ref = fields.Char(track_visibility='onchange')
|
partner_ref = fields.Char(track_visibility='onchange')
|
||||||
|
# field 'partner_id': native value for track_visibility='always'
|
||||||
|
partner_id = fields.Many2one(track_visibility='onchange')
|
||||||
# for report
|
# for report
|
||||||
delivery_partner_id = fields.Many2one(
|
delivery_partner_id = fields.Many2one(
|
||||||
'res.partner', compute='_compute_delivery_partner_id', readonly=True)
|
'res.partner', compute='_compute_delivery_partner_id', readonly=True)
|
||||||
|
|||||||
@@ -33,6 +33,9 @@
|
|||||||
<field name="fiscal_position_id" position="attributes">
|
<field name="fiscal_position_id" position="attributes">
|
||||||
<attribute name="widget">selection</attribute>
|
<attribute name="widget">selection</attribute>
|
||||||
</field>
|
</field>
|
||||||
|
<button name="button_cancel" type="object" position="attributes">
|
||||||
|
<attribute name="confirm">Are you sure you want to cancel this purchase order?</attribute>
|
||||||
|
</button>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
<attribute name="context">{'show_address': 1, 'default_type': 'delivery'}</attribute>
|
<attribute name="context">{'show_address': 1, 'default_type': 'delivery'}</attribute>
|
||||||
<attribute name="options">{'always_reload': True}</attribute>
|
<attribute name="options">{'always_reload': True}</attribute>
|
||||||
</field>
|
</field>
|
||||||
|
<button name="action_cancel" type="object" position="attributes">
|
||||||
|
<attribute name="confirm">Are you sure you want to cancel this sale order?</attribute>
|
||||||
|
</button>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,9 @@
|
|||||||
<attribute name="attrs"></attribute>
|
<attribute name="attrs"></attribute>
|
||||||
</page>
|
</page>
|
||||||
-->
|
-->
|
||||||
|
<button name="action_cancel" type="object" position="attributes">
|
||||||
|
<attribute name="confirm">Are you sure you want to cancel this picking?</attribute>
|
||||||
|
</button>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user