planned_output_hour = fields.Float(string='Sản lượng kế hoạch/giờ') so_volume = fields.Float(string='Khối lượng đơn hàng(thùng)') mix_volume = fields.Float(string="Khối lượng trộn") planned_output = fields.Float(string='Sản lượng kế hoạch (kg)') actual_output_bin = fields.Float(string='Sản lượng thực tế (thùng)') actual_output_kg = fields.Float(string ='Sản lượng thực tế(kg)') completion_rate =fields.Float(string='Tỉ lệ hoàn thành(%)',compute='_compute_completion_rate',store=True)
@api.depends('production_record_id.operation_id') def _compute_is_operation_tron(self): for rec in self: if rec.production_record_id: if rec.production_record_id.operation_id.name == 'Trộn': rec.is_operation_tron = True else: rec.is_operation_tron = False
i can't invisible this column :
and i got this error: Caused by: EvalError: Can not evaluate python expression: (bool(is_operation_tron != False))
Error: Name 'is_operation_tron' is not defined but my default for is_operation_tron is False