diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-07-23 14:03:51 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-07-23 14:03:51 +0700 |
| commit | f8b95c402ca5850448fa6fd4fd59cdd21e49850b (patch) | |
| tree | 6dff6e932b61dcf77b9a147e34a9d358cf1081e4 /indoteknik_custom/models | |
| parent | 2b1ee134a0465f3982692c6b8d6a8ac4f60f4487 (diff) | |
<miqdad> show vcm in PO
Diffstat (limited to 'indoteknik_custom/models')
| -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 5b9e1acb..d157dc30 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'] |
