summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <it@fixcomart.co.id>2025-09-19 14:05:47 +0700
committerFIN-IT_AndriFP <it@fixcomart.co.id>2025-09-19 14:05:47 +0700
commit2f1673133969bf72268ab61e186a28732d8f5439 (patch)
tree1752312cd95033823e2e3917e2378083f126a976
parentef5418ec79e17a4b233e6ea51ba66126a97ab0eb (diff)
parentb07468846b95803f21b81191013651fac2d9adb4 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into stj-po
-rwxr-xr-xindoteknik_custom/models/sale_order.py2
-rw-r--r--indoteknik_custom/models/tukar_guling_po.py24
-rw-r--r--indoteknik_custom/report/purchase_report.xml2
-rw-r--r--indoteknik_custom/views/stock_picking.xml2
4 files changed, 16 insertions, 14 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 94c5f041..2d8567b0 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -1877,6 +1877,8 @@ class SaleOrder(models.Model):
})
def open_form_multi_update_status(self):
+ if self.env.user.id != 688 or self.env.user.has_group('indoteknik_custom.group_role_it'):
+ raise UserError("Hanya Finance nya yang bisa approve.")
action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_sale_orders_multi_update')
action['context'] = {
'sale_ids': [x.id for x in self]
diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py
index f61b3828..2a5ca3dd 100644
--- a/indoteknik_custom/models/tukar_guling_po.py
+++ b/indoteknik_custom/models/tukar_guling_po.py
@@ -353,18 +353,18 @@ class TukarGulingPO(models.Model):
# self._check_bill_on_retur_po()
tipe = vals.get('return_type', self.return_type)
- if self.operations and self.operations.picking_type_id.id == 28 and tipe == 'tukar_guling':
- group = self.operations.group_id
- if group:
- # Cari BU/PUT dalam group yang sama
- bu_put = self.env['stock.picking'].search([
- ('group_id', '=', group.id),
- ('picking_type_id.id', '=', 75), # 75 = ID BU/PUT
- ('state', '=', 'done')
- ], limit=1)
-
- if bu_put:
- raise UserError("❌ Tidak bisa retur BU/INPUT karena BU/PUT sudah Done!")
+ # if self.operations and self.operations.picking_type_id.id == 28 and tipe == 'tukar_guling':
+ # group = self.operations.group_id
+ # if group:
+ # # Cari BU/PUT dalam group yang sama
+ # bu_put = self.env['stock.picking'].search([
+ # ('group_id', '=', group.id),
+ # ('picking_type_id.id', '=', 75), # 75 = ID BU/PUT
+ # ('state', '=', 'done')
+ # ], limit=1)
+ #
+ # if bu_put:
+ # raise UserError("❌ Tidak bisa retur BU/INPUT karena BU/PUT sudah Done!")
if self.operations.picking_type_id.id == 28 and tipe == 'tukar_guling':
raise UserError("❌ BU/INPUT tidak boleh di retur tukar guling")
diff --git a/indoteknik_custom/report/purchase_report.xml b/indoteknik_custom/report/purchase_report.xml
index dd19340d..9ff7e718 100644
--- a/indoteknik_custom/report/purchase_report.xml
+++ b/indoteknik_custom/report/purchase_report.xml
@@ -9,7 +9,7 @@
<field name="report_name">indoteknik_custom.report_purchaseorder_website</field>
<field name="report_file">indoteknik_custom.report_purchaseorder_website</field>
<field name="print_report_name">
- ('PO - %s - %s' % (object.partner_id.name, object.name))
+ ('%s - %s' % (object.name, object.partner_id.name))
</field>
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
<field name="binding_type">report</field>
diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml
index abaf347d..0e2eb9e4 100644
--- a/indoteknik_custom/views/stock_picking.xml
+++ b/indoteknik_custom/views/stock_picking.xml
@@ -35,7 +35,7 @@
<field name="partner_id" position="after">
<field name="area_name" optional="hide"/>
<field name="purchase_representative_id"/>
- <field name="status_printed"/>
+ <field name="status_printed" optional="hide"/>
</field>
</field>
</record>