how we suppose to do that, is it possible to use Many2many fields or we can create another model with vehicle_id and partner_id.
how create and edit vehicle_number fetch automatically cutomer_id many2many field when vehicle already existing vehicle number with different partner_id
I try to used vehicle.master.model in field many2many vehicle_number and relation with invoice module when create vehicle_number in invoice to not fetch automatically when vehicle_number is already created with different partner_id.
class VehicleMaster(models.Model): _name = "vehicle.master.model" _description = "Vehicle Master" _rec_name = 'x_vehicle_number_id' x_brand_id = fields.Many2one('vehicle.brand.model', string="Brand Name",ondelete='restrict') x_model_id = fields.Many2one('vehicle.model.model', string="Model Name",domain=" [('brand_id','=',x_brand_id)]",ondelete='restrict') x_vehicle_number_id = fields.Char(string="Vehicle Number", required=True, tracking=True,ondelete='restrict') x_customer_id = fields.Many2many('res.partner',string="Customers",required=True,tracking=True) class CustomInvoice(models.Model): _inherit = "account.move" vehicle_number = fields.Many2one('vehicle.master.model',string='Vehicle number',domain="[('x_customer_id','=',partner_id)]")