未齐套提示
This commit is contained in:
@@ -380,7 +380,7 @@ class sf_production_plan(models.Model):
|
|||||||
if line.product_id in raw_materials
|
if line.product_id in raw_materials
|
||||||
)
|
)
|
||||||
record.hide_action_purchase_orders = total_purchase_quantity < record.product_uom_qty and pr_ids.state != 'done'
|
record.hide_action_purchase_orders = total_purchase_quantity < record.product_uom_qty and pr_ids.state != 'done'
|
||||||
elif record.supply_method == 'purchase':
|
elif record.supply_method in ('purchase', 'outsourcing'):
|
||||||
purchase_orders = self.env['purchase.order'].sudo().search([
|
purchase_orders = self.env['purchase.order'].sudo().search([
|
||||||
('state', 'in', ('purchase', 'done')),
|
('state', 'in', ('purchase', 'done')),
|
||||||
('order_line.product_id', '=', record.product_id.id)
|
('order_line.product_id', '=', record.product_id.id)
|
||||||
@@ -443,7 +443,7 @@ class sf_production_plan(models.Model):
|
|||||||
first_mp = self.env['mrp.production'].search(
|
first_mp = self.env['mrp.production'].search(
|
||||||
[('origin', '=', self.sale_order_id.name)], limit=1, order='id asc')
|
[('origin', '=', self.sale_order_id.name)], limit=1, order='id asc')
|
||||||
domain = [('origin', 'like', first_mp.name)]
|
domain = [('origin', 'like', first_mp.name)]
|
||||||
elif self.supply_method == 'purchase':
|
elif self.supply_method in ('purchase', 'outsourcing'):
|
||||||
domain = [('origin', 'like', self.sale_order_id.name)]
|
domain = [('origin', 'like', self.sale_order_id.name)]
|
||||||
pr_ids = self.env['purchase.request'].sudo().search(domain)
|
pr_ids = self.env['purchase.request'].sudo().search(domain)
|
||||||
action = {
|
action = {
|
||||||
|
|||||||
Reference in New Issue
Block a user