取消采购单时,如果该采购单关联的库存移动是由采购申请创建的,则不取消
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
'wizard/purchase_request_line_make_purchase_order_view.xml',
|
'wizard/purchase_request_line_make_purchase_order_view.xml',
|
||||||
'views/purchase_request_line_view.xml',
|
'views/purchase_request_line_view.xml',
|
||||||
'views/stock_picking_views.xml',
|
'views/stock_picking_views.xml',
|
||||||
|
'views/purchase_request_menu_views.xml',
|
||||||
],
|
],
|
||||||
'assets': {
|
'assets': {
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
|
|||||||
@@ -27,4 +27,14 @@ class PurchaseOrder(models.Model):
|
|||||||
if reverse_move_ids:
|
if reverse_move_ids:
|
||||||
reverse_move_ids.picking_id.action_cancel()
|
reverse_move_ids.picking_id.action_cancel()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def button_cancel(self):
|
||||||
|
"""
|
||||||
|
将取消的采购订单关联的库存移动撤销
|
||||||
|
"""
|
||||||
|
move_ids = self.order_line.move_dest_ids.filtered(lambda move: move.state != 'done' and not move.scrapped)
|
||||||
|
res =super(PurchaseOrder, self).button_cancel()
|
||||||
|
if move_ids.mapped('created_purchase_request_line_id'):
|
||||||
|
move_ids.write({'state': 'waiting', 'is_done': False})
|
||||||
|
return res
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<menuitem id="purchase_request.menu_purchase_request_pro_mgt" sequence="0"/>
|
||||||
|
<menuitem id="purchase.menu_purchase_rfq" sequence="1"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
|
|
||||||
@@ -7,6 +7,12 @@
|
|||||||
<xpath expr="//button[@name='button_draft']" position="attributes">
|
<xpath expr="//button[@name='button_draft']" position="attributes">
|
||||||
<attribute name="string">重置草稿</attribute>
|
<attribute name="string">重置草稿</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='button_done']" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='%(purchase_request.action_purchase_request_line_make_purchase_order)d']" position="attributes">
|
||||||
|
<attribute name="class">oe_highlight</attribute>
|
||||||
|
</xpath>
|
||||||
<xpath expr="//field[@name='line_ids']//field[@name='purchased_qty']" position="after">
|
<xpath expr="//field[@name='line_ids']//field[@name='purchased_qty']" position="after">
|
||||||
<field name="supply_method"/>
|
<field name="supply_method"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user