i have a many2field from a model called related that contains cars and their models which are same in some parts that we are sell in our market we need to make a unique price for each car,model,year not for all as package
actually i don't now what should i do
class autopart(models.Model): _inherit = 'product.template' related = fields.Many2many(comodel_name="relate",relation='car', string="",domain="[('item','=', item )]" ) class relate(models.Model): _name = 'relate' _rec_name = 'code' code = fields.Char(string="product Code", required=False, compute=ref , store=True) strings = fields.Char(string="", required=False, ) item = fields.Many2many(comodel_name="item", string="Items", ) car = fields.Many2one(comodel_name="cars", string="car", required=True, ondelete='restrict', ) model = fields.Many2many(comodel_name="models", string="",domain="[('car','=', car )]" ) start = fields.Char(string="", required=False, ) end = fields.Char(string="", required=False, ) rang = fields.One2many(comodel_name="yearrange", inverse_name="product_id", store=True, string="Years" ,) ignore = fields.Char(string="Ignore", required=False, ) sum = fields.Char(string="profit sumition", required=False, compute=sum_pro ) total = fields.Integer(string="total of elements", required=False,compute=total )
What did you want to ask? Check out your problem solution here: https://github.com/sehrishnaz/learnopenerp/wiki