From 05c2c86f0f82ab42f9eb23b0aaaf838eb52da435 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 24 Mar 2023 15:54:25 +0700 Subject: revert create bill from received --- indoteknik_custom/models/stock_picking.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index f59534d2..77af676c 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -84,21 +84,16 @@ class StockPicking(models.Model): # Invoice values. invoice_vals = order._prepare_invoice() # Invoice line values (keep only necessary sections). - # for line in order.order_line: - # if line.display_type == 'line_section': - # pending_section = line - # continue - # if not float_is_zero(line.qty_to_invoice, precision_digits=precision): - # if pending_section: - # invoice_vals['invoice_line_ids'].append((0, 0, pending_section._prepare_lines_bill())) - # pending_section = None - # invoice_vals['invoice_line_ids'].append((0, 0, line._prepare_lines_bill())) - - for in_line in self.move_lines: - invoice_vals['invoice_line_ids'].append((0,0, in_line._prepare_lines_bill)) + for line in order.order_line: + if line.display_type == 'line_section': + pending_section = line + continue + if not float_is_zero(line.qty_to_invoice, precision_digits=precision): + if pending_section: + invoice_vals['invoice_line_ids'].append((0, 0, pending_section._prepare_account_move_line())) + pending_section = None + invoice_vals['invoice_line_ids'].append((0, 0, line._prepare_account_move_line())) invoice_vals_list.append(invoice_vals) - print('---cek disini---') - print(invoice_vals_list) if not invoice_vals_list: raise UserError(_('There is no invoiceable line. If a product has a control policy based on received quantity, please make sure that a quantity has been received.')) -- cgit v1.2.3