Odoo 12.0+e-20190816 (Enterprise Edition)
I have added a new res.partner field to POs to allow the user to select a contact person from the selected company.
Python code:
vendor_contact_id = fields.Many2one( "res.partner", string="Vendor Contact", help="This name will appear on the PO, and will be the default recipient of e-mailed POs" )
XML:
<field name="vendor_contact_id" context="{'default_parent_id': partner_id}" domain="[('parent_id','=',partner_id),('is_company','=',False)]"/>
My issue is that creating a partner appears to trigger a notification message, and this notification message is using the default_parent_id as the parent_id. This references a non-existent mail.message and blocks creation of the partner due to a foreign key constraint. How can I get the default value to only apply to res.partner and not the resulting mail.message?
Context in odoo: https://learnopenerp.blogspot.com/2018/01/get-parent-form-value-in-one2many-form.html