Hello,
I have the following problem:
class AccountInvoice (models.Model):
_inherit = 'account.invoice'
payment_method = fields.Selection (
[
('01', 'Without Use of the Financial System'),
('06', 'Account Debit'),
('19', 'Credit Card'),
('20', 'Others with Use of the Financial System'),
],
string = 'Payment Method',
required = True,
default = '01 ',
help = 'Forms of Payment'
)
@ api.onchange ('payment_method')
def do_stuff (self):
???
The conversion will be like:
('01', 'Without Use of the Financial System') --> Keeps the partner fiscal_position_id
('06', 'Account Debit') --> Changes the fiscal_position_id to "Purchase Payment Debit Agreement"
('19', 'Credit Card') --> Changes the fiscal_position_id to "Purchase
Purchase Credit Card Payment"
('20', 'Others with Use of the Financial System') --> Keeps the partner fiscal_position_id
What I need is to change the "fiscal_position_id" field when I change the payment_method selection. I don't know how to deal with this problem. The tax positions that I have created have tax mapping tables, so it is very important to facilitate the purchasing operator to indicate the payment method and its corresponding tax position.
I thank you all in advance for your help and assistance.