Set default value while creating record from one2many field - odoo
问题 I want to set default value for multiple fields while creating records from one2many field, in that default value will be taken from the parent model. Odoo Model Structure class purchase_order(models.Model): _inherit='purchase.order' cash_forecast_ids = fields.One2many(comodel_name='cash.forecast', inverse_name='purchase_order_id', string='Payment Schedules') class cash_forecast(models.Model): _name='cash.forecast' purchase_order_id = fields.Many2one(comodel_name='purchase.order', string='PO'