Dear Odoo Community
I am trying to update invoice line with automated action feature.
Here is my code:
for record in records:
id1 = env["account.move.line"].search([('product_id', 'ilike', 'OFIDA')])[0].id
id2 = env["account.move.line"].search([('product_id', 'ilike', 'TAXE VOIRIE')])[0].id
record['line_ids'] = [
(1, id1, {'quantity': 0.01, 'price_unit': record.x_studio_fob_1 }),
(1, id2, {'quantity': record.x_studio_taxe_voirie, 'price_unit': record.x_studio_poids_t })
]
I am getting the below error message:
Cannot create an unbalanced accounting document. Ids: [7822] Debit - credit difference: [-3100.0]
Can anybody assist me with the correct code syntax to automatically recompute the invoice?