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_move.py | |
| parent | 60d0b36cf33785c0cf6bea1d10b344dcdb37695a (diff) | |
| parent | 20eebfe836dcd6e971ccd0676b6294a2f3b06e5a (diff) | |
Merged in release (pull request #29)
Release
Diffstat (limited to 'indoteknik_custom/models/stock_move.py')
| -rw-r--r-- | indoteknik_custom/models/stock_move.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py index 22a73010..bdbb0227 100644 --- a/indoteknik_custom/models/stock_move.py +++ b/indoteknik_custom/models/stock_move.py @@ -6,6 +6,39 @@ class StockMove(models.Model): line_no = fields.Integer('No', default=0) + def _prepare_account_move_line_from_mr(self, po_line, qty, move=False): + po_line.ensure_one() + aml_currency = move and move.currency_id or po_line.currency_id + date = move and move.date or fields.Date.today() + res = { + 'display_type': po_line.display_type, + 'sequence': po_line.sequence, + 'name': '%s: %s' % (po_line.order_id.name, po_line.name), + 'product_id': po_line.product_id.id, + 'product_uom_id': po_line.product_uom.id, + 'quantity': qty, + 'price_unit': po_line.currency_id._convert(po_line.price_unit, aml_currency, po_line.company_id, date, round=False), + 'tax_ids': [(6, 0, po_line.taxes_id.ids)], + 'analytic_account_id': po_line.account_analytic_id.id, + 'analytic_tag_ids': [(6, 0, po_line.analytic_tag_ids.ids)], + 'purchase_line_id': po_line.id, + } + if not move: + return res + + if self.currency_id == move.company_id.currency_id: + currency = False + else: + currency = move.currency_id + + res.update({ + 'move_id': move.id, + 'currency_id': currency and currency.id or False, + 'date_maturity': move.invoice_date_due, + 'partner_id': move.partner_id.id, + }) + return res + 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: |
