diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-03-30 01:43:11 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-03-30 01:43:11 +0000 |
| commit | b5a9a4d37c07c32fb60753f29e7d982be221999b (patch) | |
| tree | 98668c355f6f5e832f368a1d0a373d7cae85b49d /indoteknik_custom/models/stock_picking.py | |
| parent | 60d0b36cf33785c0cf6bea1d10b344dcdb37695a (diff) | |
| parent | 20eebfe836dcd6e971ccd0676b6294a2f3b06e5a (diff) | |
Merged in release (pull request #29)
Release
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 77af676c..e63370f5 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -84,15 +84,17 @@ 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': + for line in self.move_ids_without_package: + po_line = self.env['purchase.order.line'].search([('order_id', '=', po.id), ('product_id', '=', line.product_id.id)], limit=1) + qty = line.product_uom_qty + if po_line.display_type == 'line_section': pending_section = line continue - if not float_is_zero(line.qty_to_invoice, precision_digits=precision): + if not float_is_zero(po_line.qty_to_invoice, precision_digits=precision): if pending_section: - invoice_vals['invoice_line_ids'].append((0, 0, pending_section._prepare_account_move_line())) + invoice_vals['invoice_line_ids'].append((0, 0, pending_section._prepare_account_move_line_from_mr(po_line, qty))) pending_section = None - invoice_vals['invoice_line_ids'].append((0, 0, line._prepare_account_move_line())) + invoice_vals['invoice_line_ids'].append((0, 0, line._prepare_account_move_line_from_mr(po_line, qty))) invoice_vals_list.append(invoice_vals) if not invoice_vals_list: |
