Skip to Content
Menu
This question has been flagged
1 Reply
2326 Views

in the following code amount is assigned to price_unit,


invoice_line_id = self.env['account.move.line'].create({ 'name':std_fee_id.fee_item_id.name, 'move_id': invoice_rec.id, 'product_id': product_id.related_product.id, #'fiscalyear_month_id': std_fee_id.fiscalyear_month_id.id, 'price_unit': float(std_fee_id.amount), 'account_id': product_id.property_account_income_id.id, })

Avatar
Discard
Author

hi Niyas Raphy,

after adding that code now it gives me this user error:

User Error

Cannot create unbalanced journal entry. Ids: [59] Differences debit - credit: [-1500.0]

pass this in context: with_context(check_move_validity=False)

Best Answer

Hi,

Try triggering these onchange functions and see,

* _onchange_product_id

* _onchange_price_subtotal


Code:

invoice_line._onchange_product_id()
invoice_line._onchange_price_subtotal()

Thanks

Avatar
Discard