consu & asset_ok
This commit is contained in:
parent
93aefd1913
commit
693a677a90
|
|
@ -101,8 +101,13 @@ class PurcahseRefues(models.TransientModel):
|
||||||
self.request_id.write({'state': 'wait_for_send' if init_budget else 'waiting'})
|
self.request_id.write({'state': 'wait_for_send' if init_budget else 'waiting'})
|
||||||
|
|
||||||
def convert_purchase(self):
|
def convert_purchase(self):
|
||||||
if not self.request_id.location_id:
|
all_consu_assets = all(
|
||||||
raise UserError(_("Please select the warehouse or location."))
|
line.product_id.type == 'consu' and line.product_id.asset_ok
|
||||||
|
for line in self.request_line_ids
|
||||||
|
)
|
||||||
|
if not all_consu_assets:
|
||||||
|
if not self.request_id.location_id:
|
||||||
|
raise UserError(_("Please select the warehouse or location."))
|
||||||
|
|
||||||
if self.request_line_ids.filtered(
|
if self.request_line_ids.filtered(
|
||||||
lambda line: line.product_id.type in ('product', 'consu') and (
|
lambda line: line.product_id.type in ('product', 'consu') and (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue