summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2025-05-16 07:22:09 +0000
committerIT Fixcomart <it@fixcomart.co.id>2025-05-16 07:22:09 +0000
commitd48f46e37e4ef86452c2ba2ab0d4732fb91a32a0 (patch)
tree7f6f28397b4ad871131f7f28ea698117bcf1fe0f
parent4360e1fd9f3af2c18b19463773047d9939716069 (diff)
parent05305c6bf12da58cfadac7f1a901ef825d09cb61 (diff)
Merged in date-hold-so (pull request #307)
Date hold so
-rwxr-xr-xindoteknik_custom/models/purchase_order_line.py3
-rwxr-xr-xindoteknik_custom/models/sale_order.py10
-rwxr-xr-xindoteknik_custom/views/purchase_order.xml1
-rwxr-xr-xindoteknik_custom/views/sale_order.xml8
4 files changed, 17 insertions, 5 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:
diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml
index b58139c6..0fbbb5e7 100755
--- a/indoteknik_custom/views/purchase_order.xml
+++ b/indoteknik_custom/views/purchase_order.xml
@@ -36,7 +36,6 @@
</button>
<button name="button_unlock" position="after">
<button name="create_bill_pelunasan" string="Create Bill Pelunasan" type="object" class="oe_highlight" attrs="{'invisible': [('state', 'not in', ('purchase', 'done')), ('bills_pelunasan_id', '!=', False)]}"/>
-
</button>
<field name="date_order" position="before">
<field name="sale_order_id" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml
index 10682e93..a599a7b8 100755
--- a/indoteknik_custom/views/sale_order.xml
+++ b/indoteknik_custom/views/sale_order.xml
@@ -96,9 +96,11 @@
<attribute name="invisible">1</attribute>
</field>
<field name="user_id" position="after">
- <field name="hold_outgoing" readonly="1"/>
- <field name="helper_by_id" readonly="1"/>
- <field name="compute_fullfillment" invisible="1"/>
+ <field name="hold_outgoing" readonly="1" />
+ <field name="date_hold" readonly="1" widget="datetime" />
+ <field name="date_unhold" readonly="1" widget="datetime" />
+ <field name="helper_by_id" readonly="1" />
+ <field name="compute_fullfillment" invisible="1" />
</field>
<field name="tag_ids" position="after">
<field name="eta_date_start"/>