summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-08-13 14:08:54 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-08-13 14:08:54 +0700
commit8eaffe2f3590e52b90835fada67460e119032dee (patch)
tree03ffa1d15450d8a7164ab3b116fd584b6e15ad30
parent7772fcd29c37b03ba0b23c233aa8e030a82a0d81 (diff)
approval date doc
-rw-r--r--indoteknik_custom/models/stock_picking.py11
-rw-r--r--indoteknik_custom/views/stock_picking.xml5
2 files changed, 13 insertions, 3 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index c151a543..47ac3166 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -26,7 +26,6 @@ class StockPicking(models.Model):
# Delivery Order
driver_departure_date = fields.Datetime(
string='Driver Departure Date',
- readonly=True,
copy=False
)
driver_arrival_date = fields.Datetime(
@@ -91,6 +90,16 @@ class StockPicking(models.Model):
date_availability = fields.Datetime(string="Date Availability", copy=False, tracking=True)
sale_order = fields.Char(string='Matches SO', copy=False)
printed_sj = fields.Boolean('Printed Surat Jalan', help='flag which is internal use or not')
+ invoice_status = fields.Selection([
+ ('upselling', 'Upselling Opportunity'),
+ ('invoiced', 'Fully Invoiced'),
+ ('to invoice', 'To Invoice'),
+ ('no', 'Nothing to Invoice')
+ ], string='Invoice Status', related="sale_id.invoice_status")
+
+ @api.constrains('driver_departure_date')
+ def constrains_driver_departure_date(self):
+ self.date_doc_kirim = self.driver_departure_date
def reset_status_printed(self):
for rec in self:
diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml
index 7567dda2..a58f3003 100644
--- a/indoteknik_custom/views/stock_picking.xml
+++ b/indoteknik_custom/views/stock_picking.xml
@@ -71,7 +71,8 @@
<field name="origin" position="after">
<field name="purchase_id"/>
<field name="sale_order"/>
- <field name="date_doc_kirim"/>
+ <field name="invoice_status"/>
+ <field name="date_doc_kirim" attrs="{'readonly':[('invoice_status', '=', 'invoiced')]}"/>
<field name="summary_qty_operation"/>
<field name="count_line_operation"/>
<field name="account_id"
@@ -118,7 +119,7 @@
<group>
<group>
<field name="note_logistic"/>
- <field name="driver_departure_date"/>
+ <field name="driver_departure_date" attrs="{'readonly':[('invoice_status', '=', 'invoiced')]}"/>
<field name="driver_arrival_date"/>
<field name="delivery_tracking_no"/>
<field name="driver_id"/>