diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-07-25 09:56:00 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-07-25 09:56:00 +0700 |
| commit | 6983b0f81beb28b0df43c78e50dbcf310235a9dd (patch) | |
| tree | eeb1a60de318cf4ec3d3e5ba9cfe21c5af4f3bd5 /indoteknik_custom/models/purchase_order.py | |
| parent | 414b741f6fdd3ba37754db516c695231e3fbca6e (diff) | |
| parent | 36a53535dbdc5777266fd9276b4c557259dab6be (diff) | |
<hafid> merge tukar guling
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index a46c51d1..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'] |
