diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-07-24 10:38:04 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-07-24 10:38:04 +0000 |
| commit | 36a53535dbdc5777266fd9276b4c557259dab6be (patch) | |
| tree | 9717b2e9019a184249500f4c3c4c3c03c0b574d9 /indoteknik_custom/models/purchase_order.py | |
| parent | 19ac8961c8163322f759f9eb021df368a8950010 (diff) | |
| parent | b8efc85091fe0af596872bffeb3cf6c78fe2beed (diff) | |
Merged in tukar_guling (pull request #363)
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'] |
