diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-05-16 07:22:09 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-05-16 07:22:09 +0000 |
| commit | d48f46e37e4ef86452c2ba2ab0d4732fb91a32a0 (patch) | |
| tree | 7f6f28397b4ad871131f7f28ea698117bcf1fe0f /indoteknik_custom/models | |
| parent | 4360e1fd9f3af2c18b19463773047d9939716069 (diff) | |
| parent | 05305c6bf12da58cfadac7f1a901ef825d09cb61 (diff) | |
Merged in date-hold-so (pull request #307)
Date hold so
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order_line.py | 3 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py index 033469b8..315795d5 100755 --- a/indoteknik_custom/models/purchase_order_line.py +++ b/indoteknik_custom/models/purchase_order_line.py @@ -385,3 +385,6 @@ class PurchaseOrderLine(models.Model): line.delivery_amt_line = delivery_amt * contribution else: line.delivery_amt_line = 0 + + + diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index b4582f00..fcef8906 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -4,6 +4,7 @@ from odoo import fields, models, api, _ from odoo.exceptions import UserError, ValidationError from datetime import datetime, timedelta import logging, random, string, requests, math, json, re, qrcode, base64 +import pytz from io import BytesIO from collections import defaultdict @@ -330,6 +331,10 @@ class SaleOrder(models.Model): ('hold', 'Hold'), ('approve', 'Approve') ], tracking=True, string='State Cancel', copy=False) + date_hold = fields.Datetime(string='Date Hold', tracking=True, readonly=True, help='Waktu ketika SO di Hold' + ) + date_unhold = fields.Datetime(string='Date Unhold', tracking=True, readonly=True, help='Waktu ketika SO di Unhold' + ) def _compute_total_margin_excl_third_party(self): for order in self: @@ -368,9 +373,10 @@ class SaleOrder(models.Model): } } - def hold_unhold_qty_outgoing_so(self): + def hold_unhold_qty_outgoing_so(self): if self.hold_outgoing == True: self.hold_outgoing = False + self.date_unhold = fields.Datetime.now() else: pick = self.env['stock.picking'].search([ ('sale_id', '=', self.id), @@ -380,6 +386,8 @@ class SaleOrder(models.Model): for picking in pick: picking.do_unreserve() self.hold_outgoing = True + self.date_hold = fields.Datetime.now() + def _validate_uniform_taxes(self): for order in self: |
