bzr revid: fp@tinyerp.com-20100614114911-z2c17zol480zsz4c
This commit is contained in:
Fabien Pinckaers
2010-06-14 13:49:11 +02:00
parent 0bd31a32e3
commit 8056010771
3 changed files with 42 additions and 13 deletions
+41
View File
@@ -856,5 +856,46 @@
<menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_mrp_configuration" sequence="1"/>
<menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_mrp" sequence="1"/>
<!-- Display the BoMs in the product form -->
<record model="ir.ui.view" id="view_product_form_expiry">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="type">form</field>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Bill of Materials">
<field name="bom_ids" colspan="4" nolabel="1" widget="one2many_form">
<group colspan="4" col="6">
<field name="name" select="1" colspan="4"/>
<field name="code" select="1" string="BoM Reference" groups="base.group_extended"/>
<newline/>
<field name="product_uom"/>
<field name="product_qty"/>
<field name="routing_id" groups="base.group_extended"/>
<newline/>
<field name="product_uos" groups="product.group_uos"/>
<field name="product_uos_qty" groups="product.group_uos" />
<newline/>
<field name="type" groups="base.group_extended"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
</group>
<field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list">
<tree string="Components" editable="bottom">
<field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
<field name="product_uom"/>
<field name="product_qty"/>
<field name="name" invisible="1"/>
<field name="date_start"/>
<field name="date_stop"/>
</tree>
</field>
</field>
</page>
</notebook>
</field>
</record>
</data>
</openerp>
-8
View File
@@ -1427,14 +1427,6 @@ class stock_move(osv.osv):
default = default.copy()
return super(stock_move, self).copy(cr, uid, id, default, context)
def create(self, cr, user, vals, context=None):
# Check that the stock.move is in draft state at creation to force
# passing through button_confirm
if vals.get('state','draft') not in ('draft','done','waiting'):
logger = netsvc.Logger()
logger.notifyChannel("code", netsvc.LOG_WARNING, "All new stock.move must be in state draft at the creation !")
return super(stock_move, self).create(cr, user, vals, context)
def _auto_init(self, cursor, context):
res = super(stock_move, self)._auto_init(cursor, context)
cursor.execute('SELECT indexname \
+1 -5
View File
@@ -240,15 +240,11 @@ class split_in_production_lot(osv.osv_memory):
default_val = {
'product_qty': quantity,
'product_uos_qty': uos_qty,
'state': 'draft'
'state': move.state
}
if quantity_rest > 0:
current_move = move_obj.copy(cr, uid, move.id, default_val)
move_obj.action_confirm(cr, uid, [current_move])
if move.state=='assigned':
move_obj.force_assign(cr, uid, [current_move])
elif move.state<>'confirmed':
move_obj.write(cr, uid, [current_move], {'state': move.state})
new_move.append(current_move)
if quantity_rest == 0:
current_move = move.id