[IMP] purchase_stock: add to existing PO w/o user_id
Product purchases triggered by a stock rule currently searches existing draft RFQs for matching 'partner_id' and 'company_id'. This commit makes it so it also takes into account 'user_id' (i.e. "Purchase Representative") and only selects ones without a user_id so as to not randomly add lines to POs of different Purchase Representatives. Supports Task: 2041853
This commit is contained in:
@@ -290,6 +290,7 @@ class StockRule(models.Model):
|
||||
('state', '=', 'draft'),
|
||||
('picking_type_id', '=', self.picking_type_id.id),
|
||||
('company_id', '=', company_id.id),
|
||||
('user_id', '=', False),
|
||||
)
|
||||
if values.get('orderpoint_id'):
|
||||
procurement_date = fields.Date.to_date(values['date_planned']) - relativedelta(days=int(values['supplier'].delay) + company_id.po_lead)
|
||||
|
||||
Reference in New Issue
Block a user