Browse Source

[IMP] cpo: return act_window from server action

pull/145/head
robin.keunen 4 years ago
parent
commit
fbecfa5ba6
  1. 7
      compute_purchase_order/models/computed_purchase_order.py
  2. 7
      compute_purchase_order/views/computed_purchase_order.xml

7
compute_purchase_order/models/computed_purchase_order.py

@ -96,11 +96,10 @@ class ComputedPurchaseOrder(models.Model):
action = {
"type": "ir.actions.act_window",
"res_model": "computed.purchase.order",
"views": [[False, "form"]],
# "view_mode": "form,tree",
# "view_type": "form",
# "target": "current",
"res_id": cpo.id,
"view_type": "form",
"view_mode": "form,tree",
"target": "current",
}
return action

7
compute_purchase_order/views/computed_purchase_order.xml

@ -107,12 +107,7 @@
<field name="binding_model_id" ref="product.model_product_template"/>
<field name="state">code</field>
<field name="code">
model.generate_cpo()
action = model.generate_cpo()
</field>
</record>
<menuitem id='menu_testing' name='Testing' sequence="100"
parent="purchase.menu_procurement_management"
action="action_generate_cpo"/>
</odoo>
Loading…
Cancel
Save