Hello there,
On a sale order creation, I want to hide the 'create. option of the field partner_shipping_id. But I want to keep the 'create and edit' option.Is it possible?
So the user will have to edit his new partner on creation.
How to achieve this?
Actual code in my custom inherited view :
<xpath expr="//field[@name='partner_shipping_id']" position="attributes">
<attribute name="domain">['&',('parent_id','=',partner_id),('type','=','delivery')]</attribute>
<attribute name="attrs">{'no_create': True}</attribute>
</xpath>
Image :
EDIT #1
The real problem is :
I have a new field on res.partner
partner_territory = fields.Many2one(comodel_name='res.territory', string='Partner\'s territory', required=True)
With the 'Create' option, a new shipping address (partner) is created without respecting the 'required=True' of my new field. The partner is created and the field partner_territory stays empty. Isn't it weird?
With the 'Create and Edit...', a new window opens and the user must fill the field parnter_territory. Fine.
What do you think about this?
may be this will help you: https://www.youtube.com/watch?v=X_sdiKGQgJo