Skip to content

Commit 97355af

Browse files
committedAug 31, 2016
[ENH] Purchase Force Done - Move reason text to delivery notebook.
1 parent 09b2a1f commit 97355af

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎purchase_force_done/views/purchase_view.xml

+2-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
<field name="inherit_id"
88
ref="purchase.purchase_order_form"/>
99
<field name="arch" type="xml">
10-
<xpath expr="/form/sheet//h1[1]" position="after">
11-
<h2 attrs="{'invisible': [('state', '!=', 'done')]}">
12-
<label for="force_done_reason" string="Force Done Reason:"/>
13-
<field name="force_done_reason" class="oe_inline" />
14-
</h2>
10+
<xpath expr="//field[@name='shipped']" position="after">
11+
<field name="force_done_reason"/>
1512
</xpath>
1613
<xpath expr="//button[@name='action_cancel']" position="after">
1714
<button name="%(action_force_done)d" string="Force Done"

‎purchase_force_done/wizard/force_done_reason.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class PurchaseOrderForceDone(models.TransientModel):
99

1010
force_done_reason = fields.Char(
1111
string="Force Done Reason",
12+
required=True,
1213
)
1314

1415
@api.one
@@ -29,6 +30,8 @@ def confirm_force_done(self):
2930
])
3031
if len(picking) > 0:
3132
picking.action_cancel()
32-
order.force_done_reason = self.force_done_reason
33+
order.write({
34+
'force_done_reason': self.force_done_reason,
35+
})
3336
order.wkf_po_done()
3437
return act_close

0 commit comments

Comments
 (0)
Please sign in to comment.