[MERGE] lp:~openerp-dev/openobject-addons/trunk-addons-issues4-warehouse-pso
bzr revid: stw@openerp.com-20120810091218-t1w5ejk29dg730y1
This commit is contained in:
commit
b619fb2c0c
|
@ -309,5 +309,18 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="product_form_view_procurement_button">
|
||||||
|
<field name="name">product.product.procurement</field>
|
||||||
|
<field name="model">product.product</field>
|
||||||
|
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='image_medium']" position="after">
|
||||||
|
<div class='oe_right oe_button_box'>
|
||||||
|
<button string="Procurement Request" name="%(act_make_procurement)d" type="action"/>
|
||||||
|
</div>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -27,18 +27,6 @@ class make_procurement(osv.osv_memory):
|
||||||
_name = 'make.procurement'
|
_name = 'make.procurement'
|
||||||
_description = 'Make Procurements'
|
_description = 'Make Procurements'
|
||||||
|
|
||||||
def onchange_product_id(self, cr, uid, ids, prod_id):
|
|
||||||
""" On Change of Product ID getting the value of related UoM.
|
|
||||||
@param self: The object pointer.
|
|
||||||
@param cr: A database cursor
|
|
||||||
@param uid: ID of the user currently logged in
|
|
||||||
@param ids: List of IDs selected
|
|
||||||
@param prod_id: Changed ID of Product
|
|
||||||
@return: A dictionary which gives the UoM of the changed Product
|
|
||||||
"""
|
|
||||||
product = self.pool.get('product.product').browse(cr, uid, prod_id)
|
|
||||||
return {'value': {'uom_id': product.uom_id.id}}
|
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'qty': fields.float('Quantity', digits=(16,2), required=True),
|
'qty': fields.float('Quantity', digits=(16,2), required=True),
|
||||||
'product_id': fields.many2one('product.product', 'Product', required=True, readonly=1),
|
'product_id': fields.many2one('product.product', 'Product', required=True, readonly=1),
|
||||||
|
@ -113,9 +101,10 @@ class make_procurement(osv.osv_memory):
|
||||||
record_id = context and context.get('active_id', False) or False
|
record_id = context and context.get('active_id', False) or False
|
||||||
|
|
||||||
res = super(make_procurement, self).default_get(cr, uid, fields, context=context)
|
res = super(make_procurement, self).default_get(cr, uid, fields, context=context)
|
||||||
product_id = self.pool.get('product.product').browse(cr, uid, record_id, context=context).id
|
warehouse_id = self.pool.get('stock.warehouse').search(cr, uid, [], context=context)
|
||||||
if 'product_id' in fields:
|
product_uom_id = self.pool.get('product.product').browse(cr, uid, record_id, context=context).uom_id.id
|
||||||
res.update({'product_id':product_id})
|
warehouse_id = warehouse_id and warehouse_id[0] or False
|
||||||
|
res.update({'uom_id':product_uom_id, 'warehouse_id': warehouse_id})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
make_procurement()
|
make_procurement()
|
||||||
|
|
|
@ -12,11 +12,10 @@
|
||||||
<form string="Procurement Request" version="7.0">
|
<form string="Procurement Request" version="7.0">
|
||||||
<group col="4" string="This wizard will plan the procurement for this product. This procurement may generate task, production orders or purchase orders."/>
|
<group col="4" string="This wizard will plan the procurement for this product. This procurement may generate task, production orders or purchase orders."/>
|
||||||
<group>
|
<group>
|
||||||
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
|
||||||
<field name="qty"/>
|
<field name="qty"/>
|
||||||
<field name="uom_id"/>
|
<field name="uom_id" groups="product.group_uom"/>
|
||||||
<field name="date_planned"/>
|
<field name="date_planned"/>
|
||||||
<field name="warehouse_id"/>
|
<field name="warehouse_id" groups="stock.group_locations"/>
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
<button name="make_procurement" string="Ask New Products" type="object" class="oe_highlight" />
|
<button name="make_procurement" string="Ask New Products" type="object" class="oe_highlight" />
|
||||||
|
|
|
@ -602,6 +602,8 @@ class product_product(osv.osv):
|
||||||
def name_get(self, cr, user, ids, context=None):
|
def name_get(self, cr, user, ids, context=None):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
|
if isinstance(ids, (int, long)):
|
||||||
|
ids = [ids]
|
||||||
if not len(ids):
|
if not len(ids):
|
||||||
return []
|
return []
|
||||||
def _name_get(d):
|
def _name_get(d):
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('product_id','=',active_id),('picking_id.type','=','in')]</field>
|
<field name="domain">[('picking_id.type','=','in')]</field>
|
||||||
<field name="view_id" ref="view_move_tree_reception_picking"/>
|
<field name="view_id" ref="view_move_tree_reception_picking"/>
|
||||||
<field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
|
<field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
|
||||||
<field name="search_view_id" ref="view_move_search_reception_incoming_picking"/>
|
<field name="search_view_id" ref="view_move_search_reception_incoming_picking"/>
|
||||||
|
@ -152,7 +152,7 @@
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('product_id','=',active_id),('picking_id.type','=','out')]</field>
|
<field name="domain">[('picking_id.type','=','out')]</field>
|
||||||
<field name="view_id" ref="view_move_tree_reception_picking"/>
|
<field name="view_id" ref="view_move_tree_reception_picking"/>
|
||||||
<field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
|
<field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
|
||||||
<field name="search_view_id" ref="view_move_search_reception_outcoming_picking"/>
|
<field name="search_view_id" ref="view_move_search_reception_outcoming_picking"/>
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
<div class="oe_product_desc">
|
<div class="oe_product_desc">
|
||||||
<h4><a type="edit"><field name="name"></field></a></h4>
|
<h4><a type="edit"><field name="name"></field></a></h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Code: <field name="code"/></li>
|
<li t-if="record.code.raw_value">Code: <field name="code"/></li>
|
||||||
<li t-if="record.type.raw_value != 'service'">Stock on hand: <field name="qty_available"/> <field name="uom_id"/></li>
|
<li t-if="record.type.raw_value != 'service'">Stock on hand: <field name="qty_available"/> <field name="uom_id"/></li>
|
||||||
<li t-if="record.type.raw_value != 'service'">Stock available: <field name="virtual_available"/> <field name="uom_id"/></li>
|
<li t-if="record.type.raw_value != 'service'">Stock available: <field name="virtual_available"/> <field name="uom_id"/></li>
|
||||||
<li>Price: <field name="lst_price"></field></li>
|
<li>Price: <field name="lst_price"></field></li>
|
||||||
|
|
|
@ -22,6 +22,7 @@ access_stock_production_lot_user,stock.production.lot user,model_stock_productio
|
||||||
access_stock_production_lot_revision,stock.production.lot.revision,model_stock_production_lot_revision,stock.group_stock_user,1,1,1,1
|
access_stock_production_lot_revision,stock.production.lot.revision,model_stock_production_lot_revision,stock.group_stock_user,1,1,1,1
|
||||||
access_stock_move_manager,stock.move manager,model_stock_move,stock.group_stock_manager,1,1,0,0
|
access_stock_move_manager,stock.move manager,model_stock_move,stock.group_stock_manager,1,1,0,0
|
||||||
access_stock_move_user,stock.move user,model_stock_move,stock.group_stock_user,1,0,0,0
|
access_stock_move_user,stock.move user,model_stock_move,stock.group_stock_user,1,0,0,0
|
||||||
|
access_stock_move_warehouse_manager,stock.move.manager,model_stock_move,stock.group_stock_manager,1,1,1,1
|
||||||
access_stock_inventory_user,stock.inventory user,model_stock_inventory,stock.group_stock_user,1,0,0,0
|
access_stock_inventory_user,stock.inventory user,model_stock_inventory,stock.group_stock_user,1,0,0,0
|
||||||
access_stock_inventory_manager,stock.inventory manager,model_stock_inventory,stock.group_stock_manager,1,1,1,1
|
access_stock_inventory_manager,stock.inventory manager,model_stock_inventory,stock.group_stock_manager,1,1,1,1
|
||||||
access_stock_inventory_line_user,stock.inventory.line user,model_stock_inventory_line,stock.group_stock_user,1,0,0,0
|
access_stock_inventory_line_user,stock.inventory.line user,model_stock_inventory_line,stock.group_stock_user,1,0,0,0
|
||||||
|
|
|
Loading…
Reference in New Issue