[FIX] purchase_custom_stock: access to ir.module.module
This commit is contained in:
parent
06065cbb9e
commit
379fccd719
|
|
@ -48,7 +48,7 @@ class PurchaseRequest(models.Model):
|
|||
rec.edit_locations = False
|
||||
|
||||
def action_confirm(self):
|
||||
init_active = self.env['ir.module.module'].search([('name', '=', 'initial_engagement_budget'), ('state', '=', 'installed')], limit=1)
|
||||
init_active = self.env['ir.module.module'].sudo().search([('name', '=', 'initial_engagement_budget'), ('state', '=', 'installed')], limit=1)
|
||||
init_budget = True if init_active else False
|
||||
if len(self.line_ids) == 0:
|
||||
raise ValidationError(_("Can't Confirm Request With No Item!"))
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class PurcahseRefues(models.TransientModel):
|
|||
picking_vals.update({'move_lines': move_vals})
|
||||
picking_id = self.env['stock.picking'].create(picking_vals)
|
||||
self.request_id.picking_id = picking_id.id
|
||||
init_active = self.env['ir.module.module'].search(
|
||||
init_active = self.env['ir.module.module'].sudo().search(
|
||||
[('name', '=', 'initial_engagement_budget'), ('state', '=', 'installed')], limit=1)
|
||||
init_budget = True if init_active else False
|
||||
for line in self.request_line_ids.filtered(lambda line: line.product_id.type not in ['product', 'consu']):
|
||||
|
|
@ -97,7 +97,7 @@ class PurcahseRefues(models.TransientModel):
|
|||
picking_vals.update({'move_lines': move_vals})
|
||||
picking_id = self.env['stock.picking'].create(picking_vals)
|
||||
self.request_id.picking_id = picking_id.id
|
||||
init_active = self.env['ir.module.module'].search(
|
||||
init_active = self.env['ir.module.module'].sudo().search(
|
||||
[('name', '=', 'initial_engagement_budget'), ('state', '=', 'installed')], limit=1)
|
||||
init_budget = True if init_active else False
|
||||
for line in self.request_line_ids:
|
||||
|
|
|
|||
Loading…
Reference in New Issue