summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-02-16 09:42:49 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-02-16 09:42:49 +0700
commit19f823c479d8a8f7c0a5c4486ed124d7f4a9c40c (patch)
treece0bfbeaf1ea295c19ca824e14b168808381be11
parent6e1b1715764630631cf6ee78fd0d6407a3185e9c (diff)
add last tgl kirim in sale order
-rwxr-xr-xindoteknik_custom/models/sale_order.py1
-rw-r--r--indoteknik_custom/models/stock_picking.py6
-rwxr-xr-xindoteknik_custom/views/sale_order.xml4
3 files changed, 11 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index f21554f7..a8eed411 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -66,6 +66,7 @@ class SaleOrder(models.Model):
('partial_chargeback', 'Partial Chargeback'),
('authorize', 'Authorize'),
], string='Payment Status', help='Payment Gateway Status / Midtrans / Web, https://docs.midtrans.com/en/after-payment/status-cycle')
+ date_doc_kirim = fields.Datetime(string='Tanggal Kirim di SJ', help="Tanggal Kirim di cetakan SJ yang terakhir, tidak berpengaruh ke Accounting")
def calculate_line_no(self):
line_no = 0
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index a3b5c6ef..1dba31a3 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -58,6 +58,12 @@ class StockPicking(models.Model):
], string='Approval Return Status', readonly=True, copy=False, index=True, tracking=3, help="Approval Status untuk Return")
date_doc_kirim = fields.Datetime(string='Tanggal Kirim di SJ', help="Tanggal Kirim di cetakan SJ, tidak berpengaruh ke Accounting")
+ @api.onchange('date_doc_kirim')
+ def update_date_doc_kirim_so(self):
+ if not self.sale_id:
+ return
+ self.sale_id.date_doc_kirim = self.date_doc_kirim
+
def action_assign(self):
res = super(StockPicking, self).action_assign()
self.real_shipping_id = self.sale_id.real_shipping_id
diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml
index 1b6f31aa..ff684451 100755
--- a/indoteknik_custom/views/sale_order.xml
+++ b/indoteknik_custom/views/sale_order.xml
@@ -29,6 +29,9 @@
<field name="sales_tax_id" domain="[('type_tax_use','=','sale')]" required="1"/>
<field name="carrier_id" required="1"/>
</field>
+ <field name="source_id" position="after">
+ <field name="date_doc_kirim" readonly="1"/>
+ </field>
<xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_unit']" position="attributes">
<attribute name="attrs">
{
@@ -101,6 +104,7 @@
<field name="approval_status" />
<field name="client_order_ref"/>
<field name="so_status"/>
+ <field name="date_doc_kirim" string="Tgl Kirim"/>
</field>
</field>
</record>