we have migrated successfully our tryton solution to 5.0. Sadly, we did not made it to post automatically the invoices, which are created from a sale. In the past solution, the coding worked correctly.
For the usecase, we override the method create_invoice and wrote:
invoice = super(Sale, self).create_invoice() invoice.reference = self.reference invoice.invoice_date = self.sale_date invoice.save() Invoice = Pool().get('account.invoice') if invoice.party.sale_invoice_grouping_method != 'standard': Invoice.post([invoice])
Within the posting process, we found out, that the payment-term method “get_value” of payment_term.py cannot compute correctly, because the attribute of ratio is None.
File “/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/account_invoice/invoice.py”, line 1367, in post
move = invoice.get_move()
File “/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/account_invoice/invoice.py”, line 948, in get_move
total, self.company.currency, self.invoice_date)
File “/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/account_invoice/payment_term.py”, line 70, in compute
value = line.get_value(remainder, amount, currency)
File “/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/account_invoice/payment_term.py”, line 223, in get_value
return currency.round(amount * self.ratio)
TypeError: unsupported operand type(s) for *: ‘decimal.Decimal’ and ‘NoneType’
Actual I cannot see, how the payment_term.ratio will be read correctly, or what I am missing.
Thank you and best regards,