Hi
I have two models:
class Pharmacy(models.Model):
_inherit = 'res.partner'
medicine_ids = fields.Many2many('product.template', string="Existing Medicines")
class Medicine(models.Model):
_inherit = 'product.template'
pharmacy_ids = fields.Many2many('res.partner', string="Pharmacieis")
def add_pharmacies(self):
some logic
I need in form view of Medicine by pushing a button the function add_pharmacies be called and 1 pharmacy be added to the list of the pharmacies that have that product and the product to be added to specific pharmacy.
What Should I write in my function?