Hello,
In a personal module, I want to do something special.
When I click on the menuitem, I want to show a form view where I have one field. This field is a many2one field.
When I select a value for this field, I want to click on a button (not the create button, so I don't want to create a record) and after the click, I want to show a pivot view depending of the value of the field selected.
There are my codes :
class miadi_tarifs(models.Model):
_name = 'miadi.tarifs'
code = fields.Char(string='Code', default='', required=True)
libelle = fields.Char(string='Libellé', default='', required=True)
class miadi_lignesTarifs(models.Model):
_name = 'miadi.lignestarifs'
code_tarif = fields.Many2one('miadi.tarifs', 'Price Code', default='', required=True, ondelete='cascade')
produit_id = fields.Many2one('product.product', 'Product', required=True, ondelete='cascade')
conditionnement_id = fields.Many2one('miadi.packaging', 'Packaging', required=True, ondelete='cascade')
prix_unitaire = fields.Float('Unit Price', default=0)
Actually, in the pivot view return by a function, I have in first column the "code_tarif", in second column the "produit_id", in row the "conditionnement_id" and that is display for the cases is the "prix_unitaire". What I want is to display the pivot view with only the "produit_id" in column depending the "code_tarif" value selected in the previous for view.
I hope you will understand me and you will be able to help me.
I'm on Odoo 10
Thanks