Hi
After migration from Odoo 11 to 12, my existing sales orders can no more be invoiced. When validating the invoice, I get this error:
File "/var/opt/odoo/odoo/fields.py", line 1038, in _compute_value
getattr(records, self.compute)()
File "/var/opt/odoo/addons/sale/models/sale.py", line 1308, in _compute_untaxed_amount_invoiced
amount_invoiced += invoice_line.currency_id._convert(invoice_line.price_subtotal, line.currency_id, line.company_id, invoice_date)
File "/var/opt/odoo/odoo/addons/base/models/res_currency.py", line 200, in _convert
assert company, "convert amount from unknown company"
AssertionError: convert amount from unknown company
Creating a new invoice or a new sales order and from there an invoice works with validation. Has anybody an idea what could be missing? Is this a migration problem?
Thanks for help.
Another hint
When opening Odoo Studio on an invoice, selecting any Domain expression on fields having "company_id" inside gives an error: The domain you entered is not properly formed
For instance on Invoice, Other Info, account_id, where Domain is [('company_id', '=', company_id ...
Seems like company_id is the problem.
I've taken a migrated production database from April 5th and updated all modules.
I've checked the database.
There is a valid company, all fine.
The account_invoice has a company_id and currency_id set. So does the account_invoice_line
id | 2460
name | BLABLA
origin |
sequence | 2
invoice_id | 612
uom_id | 1
product_id | 189
account_id | 274
price_unit | 100.00
price_subtotal | 100.00
price_total | 107.70
price_subtotal_signed | 100.00
quantity | 1.000
discount | 0.00
account_analytic_id |
company_id | 1
partner_id | 906
currency_id | 6
is_rounding_line | f
create_uid | 2
create_date | 2019-04-07 08:12:25.450818
write_uid | 2
write_date | 2019-04-07 12:54:42.409277
subscription_id |
asset_category_id |
asset_start_date |
asset_end_date |
asset_mrr | 0.00
purchase_line_id |
display_type |
Strange that newly created invoices work. Also invoices from existing subscriptions work fine. The invoice has been generated from a timesheet. I've only installed from OCA/account-invoicing
- account-invoicing/sale_timesheet_invoice_description
- account-invoicing/account_invoice_refund_link
Removed those modules, still same result.
Why don't you revert to Odoo support?
Thanks for your help. I've submitted a ticket to Odoo support. Was just hoping somebody online on Sundays could help me understanding the problem. Obviously, it is more difficult.