diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-10-15 10:06:12 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-10-15 10:06:12 +0700 |
| commit | a831d928c740497c777b966020aa2f198bf0066a (patch) | |
| tree | 2a3ed3458d7ce18f37d28af28cfa10240981d9f2 /indoteknik_custom/models | |
| parent | e2860d19aebbd64b4c38fb18dd18d6dbcc932744 (diff) | |
add line number in stock picking (DO and Receipt)
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/stock_move.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py index c2786762..869053d7 100644 --- a/indoteknik_custom/models/stock_move.py +++ b/indoteknik_custom/models/stock_move.py @@ -4,6 +4,8 @@ from odoo import fields, models class StockMove(models.Model): _inherit = 'stock.move' + line_no = fields.Integer('No', default=0) + def _create_account_move_line(self, credit_account_id, debit_account_id, journal_id, qty, description, svl_id, cost): self.ensure_one() if self.picking_id.is_internal_use: diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index fb17d142..221aff31 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -43,6 +43,15 @@ class StockPicking(models.Model): copy=False ) + def calculate_line_no(self): + line_no = 0 + for picking in self: + for line in picking.move_ids_without_package: + if line.product_id.type == 'product': + line_no += 1 + line.line_no = line_no + # _logger.info('Calculate PO Line No %s' % line.id) + def _compute_summary_qty(self): sum_qty_detail = sum_qty_operation = count_line_detail = count_line_operation = 0 for picking in self: |
