[MERGE] forward port of branch saas-5 up to 7d7f6fe
This commit is contained in:
commit
625aa7e75d
|
@ -239,16 +239,27 @@ class mrp_bom(osv.osv):
|
|||
"""
|
||||
if properties is None:
|
||||
properties = []
|
||||
domain = None
|
||||
if product_id:
|
||||
domain = ['|',('product_id', '=', product_id),('product_tmpl_id.product_variant_ids', '=', product_id)]
|
||||
else:
|
||||
if not product_tmpl_id:
|
||||
product_tmpl_id = self.pool['product.product'].browse(cr, uid, product_id).product_tmpl_id.id
|
||||
domain = [
|
||||
'|',
|
||||
('product_id', '=', product_id),
|
||||
'&',
|
||||
('product_id', '=', False),
|
||||
('product_tmpl_id', '=', product_tmpl_id)
|
||||
]
|
||||
elif product_tmpl_id:
|
||||
domain = [('product_id', '=', False), ('product_tmpl_id', '=', product_tmpl_id)]
|
||||
else:
|
||||
# neither product nor template, makes no sense to search
|
||||
return False
|
||||
if product_uom:
|
||||
domain += [('product_uom','=',product_uom)]
|
||||
domain = domain + [ '|', ('date_start', '=', False), ('date_start', '<=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)),
|
||||
'|', ('date_stop', '=', False), ('date_stop', '>=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))]
|
||||
ids = self.search(cr, uid, domain)
|
||||
# order to prioritize bom with product_id over the one without
|
||||
ids = self.search(cr, uid, domain, order='product_id')
|
||||
for bom in self.pool.get('mrp.bom').browse(cr, uid, ids):
|
||||
if not set(map(int,bom.property_ids or [])) - set(properties or []):
|
||||
return bom.id
|
||||
|
|
|
@ -587,7 +587,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<div name="options" position="inside">
|
||||
<div>
|
||||
<field name="purchase_ok" attrs="{'readonly': [('is_product_variant', '=', False)]}"/>
|
||||
<field name="purchase_ok"/>
|
||||
<label for="purchase_ok"/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
<ul class="oe_dropdown_menu oe_kanban_group_dropdown">
|
||||
<li><a data-action="toggle_fold" href="#">Fold</a></li>
|
||||
<t t-if="widget.view.grouped_by_m2o and widget.value">
|
||||
<li t-if="parent.is_action_enabled('group_edit')"><a data-action="edit" href="#">Edit</a></li>
|
||||
<li t-if="parent.is_action_enabled('group_delete')"><a data-action="delete" href="#">Delete</a></li>
|
||||
<li t-if="parent && parent.is_action_enabled('group_edit')"><a data-action="edit" href="#">Edit</a></li>
|
||||
<li t-if="parent && parent.is_action_enabled('group_delete')"><a data-action="delete" href="#">Delete</a></li>
|
||||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue