Merge pull request #2964 from expsa/younes_dev_odex25_purchase
correct asset qty
This commit is contained in:
commit
4b9313d21c
|
|
@ -191,14 +191,16 @@ class PurchaseRequest(models.Model):
|
|||
lambda line: line.product_id.type == 'consu' and not line.product_id.asset_ok)
|
||||
non_storable_product = self.line_ids - storable_product_lines - asset_product_lines - consu_product_not_asset_lines
|
||||
if any(storable_product_lines.filtered(lambda line: line.available_qty > 0)) or any(
|
||||
consu_product_not_asset_lines.filtered(lambda line: line.available_qty > 0)):
|
||||
consu_product_not_asset_lines.filtered(lambda line: line.available_qty > 0)) or any(
|
||||
asset_product_lines.filtered(lambda line: line.available_qty > 0)):
|
||||
available = True
|
||||
if any(storable_product_lines.filtered(
|
||||
lambda store_line: store_line.qty > store_line.available_qty)) or any(
|
||||
asset_product_lines.filtered(lambda asset_line: asset_line.qty > asset_line.available_qty)) or any(
|
||||
consu_product_not_asset_lines.filtered(lambda asset_line: asset_line.qty > asset_line.available_qty)):
|
||||
if self.has_asset_product_line:
|
||||
if not self.asset_request_line_ids and any(asset_product_lines.filtered(lambda line: line.available_qty > 0)):
|
||||
if not self.asset_request_line_ids and any(
|
||||
asset_product_lines.filtered(lambda line: line.available_qty > 0)):
|
||||
raise Warning(_('Please Select an asset'))
|
||||
self.create_asset_operation()
|
||||
context = {}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
<button class="oe_stat_button" type="action"
|
||||
groups="exp_asset_base.group_assets_manager,stock.group_stock_manager"
|
||||
name="%(action_account_asset_assignment)d" icon="fa-pencil"
|
||||
attrs="{'invisible':['|',('state' , 'not in' , ('done','employee')),('asset_assign_count','=',0)]}"
|
||||
attrs="{'invisible':['|',('state' , 'not in' , ('done','employee','waiting','wait_for_send','initial')),('asset_assign_count','=',0)]}"
|
||||
>
|
||||
<field name="asset_assign_count" string="Assignments" widget="statinfo"/>
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue