Skip to Content
Menu
This question has been flagged
1 Reply
2359 Views

Hello,

How is it possible to change values in a many2one field according if we are in the account.move form of a customer invoice or of a vendor invoice ?

Avatar
Discard
Best Answer

Hi,
You can achieve this by using domain based on account.move type.In the model account.move there is a selection field which actually distinguish the type of moves.The technical name of the field is type and it has the following values : 

('entry', 'Journal Entry'),
('out_invoice', 'Customer Invoice'),
('out_refund', 'Customer Credit Note'),
('in_invoice', 'Vendor Bill'),
('in_refund', 'Vendor Credit Note'),
('out_receipt', 'Sales Receipt'),
('in_receipt', 'Purchase Receipt'),

You can use an appropriate domain using this field according to your need.Since your need is not specified in your question you can use domain if you want to control the values of many2one field based on the type field, or if you want to hide or show the field based on the type, the type field can be used inside the attrs of field definition.

Regards

Avatar
Discard