Hallo everyone,
I would like to configure following functionality:
On behalf of Company A, Company B, Company C
I would like to make an Invoice with individual Invoice number, for example INV_A, INV_B, INV_C.
Those companies are selling the same service (from Odoo point of view) so let`s say I create Sale Order, where I am able to select company in tab "Other Information".
After creating SO, I am trying to create Invoice and after VALIDATION I always get this error:
Field(s) `company_id` failed against a constraint: Account and Period must belong to the same company.
This comes from constraint check [_check_company_id] from [_name = "account.move.line"] model. What is more, I get problem with [lines.account_id.company_id] which is different that other company informations in line.
CODE:
def _check_company_id(self, cr, uid, ids, context=None):
lines = self.browse(cr, uid, ids, context=context)
for l in lines:
if l.company_id != l.account_id.company_id or l.company_id != l.period_id.company_id:
return False
return True
Could someone tell me, where have I configured something incorrectly? I cannot find any reason and it drives me crazy...
Thanks in advance,
Piotr
Invoice company and debtors account(customer account) company must be same!!