When dealing with a multi-company setup with no product-level income accounts assigned, the invoice line creation pivots to the "product category" assigned accounts. However, it does not correctly reference the company field in the subscription template when referencing the category data. This can result in incorrect income accounts being used upon invoice creation.
To Reproduce
Affected versions:
Steps to reproduce the behavior:
Create multi-company instance
Set up product category with different income accounts for each company
Convert subscription to invoice for company B, it will use company A's product category income account.
Expected behavior
The company should be taken into account when referencing the 'product category' account settings.
Module
subscription_oca/models/sale_subscription_line.py
Describe the bug
When dealing with a multi-company setup with no product-level income accounts assigned, the invoice line creation pivots to the "product category" assigned accounts. However, it does not correctly reference the company field in the subscription template when referencing the category data. This can result in incorrect income accounts being used upon invoice creation.
To Reproduce
Affected versions:
Steps to reproduce the behavior:
Expected behavior The company should be taken into account when referencing the 'product category' account settings.