I need to stop edit quantity of product in purchase order in odoo 10 after make rfq user must not edit quantity
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hi Hadeel Khattab
There are some customisation needed as below.
Code for purchase order line:
po = fields.Boolean(string='Po')
@api.model
def create(self,vals):
if vals.get('order_id'):
order_id = self.env['purchase.order'].browse(vals['order_id'])
if order_id.state == 'draft':
vals.update({
'po':True
})
return super(purchaseOrderLine, self).create(vals)
From xml side :
{'readonly': [('po','=',True)]}
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Hi,
Try this in your xml view by inheriting "purchase_order_form" from purchase ,
< record id="view_po_form_inherit" model="ir.ui.view" >
< field name="name">purchase.order.form < /field >
< field name="model">purchase.order< /field >
< field name="inherit_id" ref="purchase.purchase_order_form" / >
< field name="arch" type="xml" >
< xpath expr="/form/sheet/notebook/page[1]/field[@name='order_line']/tree/field[@name='product_qty']" position="replace" >
< field name="product_qty" attrs="{'readonly': [('parent.state', '!=', 'draft')]}" />
< /xpath >
< /field >
< /record >
Thanks
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up