summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-10-21 14:57:48 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-10-21 14:57:48 +0700
commit3e609fe132724bc8d477f48ebe3abc1a90aacfa0 (patch)
tree97d72ea30f84d292e47f49a88cfeb057938b6e1a
parentd0af9ab71c65f6e7e1280b2978ebac2d0d514a45 (diff)
parenteadc70481dd65dd7483aa2ae5c9bcc68bb274f3e (diff)
Merge remote-tracking branch 'origin/production' into feature/generate_url
-rw-r--r--indoteknik_api/controllers/api_v1/user.py2
-rwxr-xr-xindoteknik_custom/models/purchase_order.py2
-rwxr-xr-xindoteknik_custom/models/sale_order.py9
-rw-r--r--indoteknik_custom/models/stock_picking.py4
-rw-r--r--indoteknik_custom/models/vendor_approval.py2
-rw-r--r--indoteknik_custom/views/stock_picking.xml3
6 files changed, 14 insertions, 8 deletions
diff --git a/indoteknik_api/controllers/api_v1/user.py b/indoteknik_api/controllers/api_v1/user.py
index e4f8b97f..3be874fa 100644
--- a/indoteknik_api/controllers/api_v1/user.py
+++ b/indoteknik_api/controllers/api_v1/user.py
@@ -95,7 +95,7 @@ class User(controller.Controller):
user = request.env['res.users'].create(user_data)
user.partner_id.email = email
user.partner_id.customer_type = 'nonpkp'
- user.partner_id.npwp = '0.000.000.0-000.000'
+ user.partner_id.npwp = '00.000.000.0-000.000'
user.partner_id.sppkp = '-'
user.partner_id.nama_wajib_pajak = user.name
user.partner_id.user_id = 3222
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index f8af409f..f924174a 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -511,7 +511,7 @@ class PurchaseOrder(models.Model):
if self.total_percent_margin < self.total_so_percent_margin and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
raise UserError("Beda Margin dengan Sales, harus approval Merchandise")
if not self.from_apo:
- if not self.sale_order_id and self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
+ if not self.sale_order_id and not self.env.user.has_group('indoteknik_custom.group_role_merchandiser') and not self.env.user.is_leader:
raise UserError("Tidak ada link dengan SO, harus approval Merchandise")
send_email = False
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 22130ac3..891482cb 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -873,6 +873,9 @@ class SaleOrder(models.Model):
}).send()
def validate_different_vendor(self):
+ if self.vendor_approval_id and self.vendor_approval:
+ return False
+
different_vendor = self.order_line.filtered(lambda l: l.vendor_id and l.vendor_md_id and l.vendor_id.id != l.vendor_md_id.id)
if self.vendor_approval_id and self.vendor_approval_id.state == 'draft':
@@ -1314,7 +1317,7 @@ class SaleOrder(models.Model):
def create(self, vals):
# Ensure partner details are updated when a sale order is created
order = super(SaleOrder, self).create(vals)
- order._update_partner_details()
+ # order._update_partner_details()
return order
def write(self, vals):
@@ -1322,8 +1325,8 @@ class SaleOrder(models.Model):
res = super(SaleOrder, self).write(vals)
# Check if the update is coming from a save operation
- if any(field in vals for field in ['sppkp', 'npwp', 'email', 'customer_type']):
- self._update_partner_details()
+ # if any(field in vals for field in ['sppkp', 'npwp', 'email', 'customer_type']):
+ # self._update_partner_details()
return res
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 1b2baea7..a5482f9d 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -73,10 +73,8 @@ class StockPicking(models.Model):
('hold', 'Hold by Sales'),
('not_paid', 'Customer belum bayar'),
('partial', 'Kirim Parsial'),
- ('not_complete', 'Belum Lengkap'),
('indent', 'Indent'),
('self_pickup', 'Barang belum di pickup Customer'),
- ('delivery_route', 'Belum masuk rute pengiriman'),
('expedition_closed', 'Eskpedisi belum buka')
], string='Note Logistic', help='jika field ini diisi maka tidak akan dihitung ke lead time')
waybill_id = fields.One2many(comodel_name='airway.bill', inverse_name='do_id', string='Airway Bill')
@@ -94,6 +92,8 @@ 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')
+ printed_sj_retur = fields.Boolean('Printed Surat Jalan Retur', help='flag which is internal use or not')
+ date_printed_sj_retur = fields.Datetime(string='Status Printed Surat Jalan Retur', copy=False, tracking=True)
invoice_status = fields.Selection([
('upselling', 'Upselling Opportunity'),
('invoiced', 'Fully Invoiced'),
diff --git a/indoteknik_custom/models/vendor_approval.py b/indoteknik_custom/models/vendor_approval.py
index e540b8fc..b0d58b85 100644
--- a/indoteknik_custom/models/vendor_approval.py
+++ b/indoteknik_custom/models/vendor_approval.py
@@ -29,7 +29,7 @@ class VendorApproval(models.Model):
raise UserError('Hanya Merchandiser yang bisa approve')
self.state = 'done'
- self.order_id.update({'vendor_approval': True})
+ self.order_id.vendor_approval = True
self.order_id.action_confirm()
message = "Vendor Approval approved by %s" % (self.env.user.name)
self.order_id.message_post(body=message)
diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml
index af1af563..d713edbc 100644
--- a/indoteknik_custom/views/stock_picking.xml
+++ b/indoteknik_custom/views/stock_picking.xml
@@ -16,6 +16,7 @@
<field name="driver_arrival_date" optional="hide"/>
<field name="note_logistic" optional="hide"/>
<field name="note" optional="hide"/>
+ <field name="date_reserved" optional="hide"/>
<field name="state_reserve" optional="hide"/>
</field>
<field name="partner_id" position="after">
@@ -92,6 +93,8 @@
<field name="status_printed"/>
<field name="printed_sj"/>
<field name="date_printed_sj"/>
+ <field name="printed_sj_retur"/>
+ <field name="date_printed_sj_retur"/>
<field name="date_printed_list"/>
<field name="is_internal_use"
string="Internal Use"