Browse Source

[IMP] cpo: return act_window from server action

pull/145/head
robin.keunen 5 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 = { action = {
"type": "ir.actions.act_window", "type": "ir.actions.act_window",
"res_model": "computed.purchase.order", "res_model": "computed.purchase.order",
"views": [[False, "form"]],
# "view_mode": "form,tree",
# "view_type": "form",
# "target": "current",
"res_id": cpo.id, "res_id": cpo.id,
"view_type": "form",
"view_mode": "form,tree",
"target": "current",
} }
return action 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="binding_model_id" ref="product.model_product_template"/>
<field name="state">code</field> <field name="state">code</field>
<field name="code"> <field name="code">
model.generate_cpo()
action = model.generate_cpo()
</field> </field>
</record> </record>
<menuitem id='menu_testing' name='Testing' sequence="100"
parent="purchase.menu_procurement_management"
action="action_generate_cpo"/>
</odoo> </odoo>
Loading…
Cancel
Save