While creating a One2many field we required a inverse name (name of the inverse Many2one field in comodel_name) But Wizard records may refer to regular records or wizard records through many2one fields, but regular records cannot refer to wizard records through a many2one field!!!.
SO How can we create One2many field in a wizard.?
I have done like....
class sales_test_wizard(models.TransientModel):
_name = 'sales.test.wizard'
from_date = fields.Date(string="Date From")
to_date = fields.Date(string="Date To")
name = fields.Char(string="Name", size=32, required=True)
sales_test_report = fields.One2many('sales.register', 'register_wiz_id', string='Sales Test')
class sales_register(models.Model):
_name = 'sales.register'
name = fields.Char('Order Reference')
date_order = fields.Datetime('Date')
partner_id = fields.Many2one('res.partner', 'Customer')
amount_total = fields.Float(string='Total')
register_wiz_id = fields.Many2one('sales.test.wizard','Register Wizard ID')
Am getting an error like : AssertionError: Many2One relationships from non-transient Model to TransientModel are forbidden
Can anyone please find me a solution for this...
Hello, you're found any solution related to this problem?