[IMP] Update manufacturing
This commit is contained in:
parent
2518767005
commit
bdfdba0de4
|
@ -1039,13 +1039,31 @@
|
|||
<record model="ir.ui.view" id="product_template_form_view_bom_button">
|
||||
<field name="name">product.template.procurement</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="inherit_id" ref="product.product_template_form_view_only"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="buttons" position="inside">
|
||||
<button class="oe_inline oe_stat_button" name="%(product_open_bom)d" type="action"
|
||||
groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
|
||||
<field string="Bill of Materials" name="bom_count" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button" name="action_view_mos" type="object"
|
||||
groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
|
||||
<field string="Manufacturing" name="mo_count" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="product_normal_form_view_bom_button">
|
||||
<field name="name">product.product.mrp.button</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="buttons" position="inside">
|
||||
<button class="oe_inline oe_stat_button" name="action_view_bom" type="object"
|
||||
groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
|
||||
<field string="Bill of Materials" name="bom_count" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button" name="%(act_product_mrp_production)d" type="action"
|
||||
groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
|
||||
<field string="Manufacturing" name="mo_count" widget="statinfo" />
|
||||
|
|
|
@ -51,7 +51,16 @@ class product_template(osv.osv):
|
|||
_defaults = {
|
||||
'produce_delay': 1,
|
||||
}
|
||||
|
||||
|
||||
def action_view_mos(self, cr, uid, ids, context=None):
|
||||
products = self._get_products(cr, uid, ids, context=context)
|
||||
result = self._get_act_window_dict(cr, uid, 'mrp','act_product_mrp_production', context=context)
|
||||
result['domain'] = "[('product_id','in',[" + ','.join(map(str, products)) + "])]"
|
||||
result['context'] = "{}"
|
||||
return result
|
||||
|
||||
|
||||
|
||||
class product_product(osv.osv):
|
||||
_inherit = "product.product"
|
||||
|
@ -65,6 +74,15 @@ class product_product(osv.osv):
|
|||
_columns = {
|
||||
'mo_count': fields.function(_bom_orders_count, string='# Manufacturing Orders', type='integer'),
|
||||
}
|
||||
|
||||
|
||||
def action_view_bom(self, cr, uid, ids, context=None):
|
||||
tmpl_obj = self.pool.get("product.template")
|
||||
products = set()
|
||||
for product in self.browse(cr, uid, ids, context=context):
|
||||
products.add(product.product_tmpl_id.id)
|
||||
result = tmpl_obj._get_act_window_dict(cr, uid, 'mrp','product_open_bom', context=context)
|
||||
result['context'] = "{}"
|
||||
result['domain'] = "[('product_tmpl_id','in',[" + ','.join(map(str, list(products))) + "])]"
|
||||
return result
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -46,8 +46,8 @@ class stock_move(osv.osv):
|
|||
return res
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
default = default or {}
|
||||
context = context or {}
|
||||
if not default.get('split_from') and not context.get('split'):
|
||||
#we don't want to propagate the link to the purchase order line except in case of move split
|
||||
default['purchase_line_id'] = False
|
||||
|
|
|
@ -417,13 +417,14 @@ class product_template(osv.osv):
|
|||
products = self._get_products(cr, uid, ids, context=context)
|
||||
result = self._get_act_window_dict(cr, uid, 'stock','product_open_quants', context=context)
|
||||
result['domain'] = "[('product_id','in',[" + ','.join(map(str, products)) + "])]"
|
||||
print "Result open quants:", result
|
||||
result['context'] = "{'search_default_locationgroup': 1, 'search_default_internal_loc': 1}"
|
||||
return result
|
||||
|
||||
def action_view_orderpoints(self, cr, uid, ids, context=None):
|
||||
products = self._get_products(cr, uid, ids, context=context)
|
||||
result = self._get_act_window_dict(cr, uid, 'stock','product_open_orderpoint', context=context)
|
||||
result['domain'] = "[('product_id','in',[" + ','.join(map(str, products)) + "])]"
|
||||
result['context'] = "{}"
|
||||
return result
|
||||
|
||||
|
||||
|
@ -431,6 +432,7 @@ class product_template(osv.osv):
|
|||
products = self._get_products(cr, uid, ids, context=context)
|
||||
result = self._get_act_window_dict(cr, uid, 'stock','act_product_stock_move_open', context=context)
|
||||
result['domain'] = "[('product_id','in',[" + ','.join(map(str, products)) + "])]"
|
||||
result['context'] = "{}"
|
||||
return result
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue