Skip to content
Snippets Groups Projects
Commit c94efd8a authored by niyasraphy's avatar niyasraphy
Browse files

[FIX] account: traceback on accrued revenue entry when no order line


before this commit, traceback is raised when trying to create accrued revenue entry without entering the order lines.

open a sale order, enter customer and save it, from the action button, click Accrued Revenue Entry and enter an amount in the amount field, exception will be raised.

after this commit, no exception will be raised.

closes odoo/odoo#111961

X-original-commit: d68eafd5
Signed-off-by: default avatarJohn Laterre (jol) <jol@odoo.com>
parent f3abd7c3
Branches
Tags
No related merge requests found
......@@ -144,7 +144,7 @@ class AccruedExpenseRevenue(models.TransientModel):
fnames = []
total_balance = 0.0
for order in orders:
if len(orders) == 1 and self.amount:
if len(orders) == 1 and self.amount and order.order_line:
total_balance = self.amount
order_line = order.order_line[0]
if is_purchase:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment