summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-07-26 11:58:32 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-07-26 11:58:32 +0700
commite09e59db22d65fa144c2a43cd8f6959fada49484 (patch)
tree0567b1a8f0c8c57efb2d0d38ae489da26a55c245 /indoteknik_custom/models/purchase_order.py
parentfff5507cf7c0f360a5c68068e77fa84b1d6340c5 (diff)
parent77e76f376b78733cad58aa196e3ead3c6a04ff42 (diff)
(andri) fix conflict
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 5b9e1acb..45134939 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -17,6 +17,7 @@ _logger = logging.getLogger(__name__)
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
+ vcm_id = fields.Many2one('tukar.guling.po', string='Doc VCM', readonly=True, compute='_has_vcm', copy=False)
order_sales_match_line = fields.One2many('purchase.order.sales.match', 'purchase_order_id', string='Sales Match Lines', states={'cancel': [('readonly', True)], 'done': [('readonly', True)]}, copy=True)
sale_order_id = fields.Many2one('sale.order', string='Sale Order')
procurement_status = fields.Char(string='Procurement Status', compute='get_procurement_status', readonly=True)
@@ -99,6 +100,10 @@ class PurchaseOrder(models.Model):
)
manufacturing_id = fields.Many2one('mrp.production', string='Manufacturing Orders')
+ def _has_vcm(self):
+ if self.id:
+ self.vcm_id = self.env['tukar.guling.po'].search([('origin', '=', self.name)], limit=1)
+
@api.depends('name')
def _compute_bu_related_count(self):
StockPicking = self.env['stock.picking']
@@ -1043,7 +1048,7 @@ class PurchaseOrder(models.Model):
for line in self.order_line:
if line.taxes_id != reference_taxes:
- raise UserError("PPN harus sama untuk semua baris pada line.")
+ raise UserError(f"PPN harus sama untuk semua baris pada line {line.product_id.name}")
def check_data_vendor(self):
vendor = self.partner_id