Bugfix in csv import

Better origin computations
Workflow in activities

bzr revid: fp@tinyerp.com-e8f16f465ef9056c2c122593431e416686b40538
This commit is contained in:
Fabien Pinckaers 2007-10-18 06:45:27 +00:00
parent 47ccfc54b9
commit 2a8141bb37
5 changed files with 13 additions and 16 deletions

View File

@ -501,7 +501,7 @@ class mrp_production(osv.osv):
self.action_compute(cr, uid, [production.id])
production = self.browse(cr, uid, [production.id])[0]
picking_id = self.pool.get('stock.picking').create(cr, uid, {
'origin': (production.origin or '') +':'+production.name,
'origin': (production.origin or '').split(':')[0] +':'+production.name,
'type': 'internal',
'move_type': 'one',
'state': 'auto',
@ -557,8 +557,8 @@ class mrp_production(osv.osv):
'state': 'waiting',
})
proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
'name': production.name+':'+ (production.origin or ''),
'origin': production.name+':'+ (production.origin or ''),
'name': (production.origin or '').split(':')[0] + ':' + production.name,
'origin': (production.origin or '').split(':')[0] + ':' + production.name,
'date_planned': newdate,
'product_id': line.product_id.id,
'product_qty': line.product_qty,
@ -821,7 +821,6 @@ class mrp_procurement(osv.osv):
loc_id = procurement.location_id.id
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0)
produce_id = self.pool.get('mrp.production').create(cr, uid, {
#'name': procurement.name,
'origin': procurement.origin,
'product_id': procurement.product_id.id,
'product_qty': procurement.product_qty,

View File

@ -339,13 +339,11 @@
<field name="arch" type="xml">
<tree string="Production orders" colors="red:date_planned&lt;current_date and state not in ('done','cancel')">
<field name="name"/>
<field name="priority"/>
<field name="product_id"/>
<field name="product_qty"/>
<field name="date_planned"/>
<field name="date_start"/>
<field name="date_finnished"/>
<field name="origin"/>
<field name="state"/>
</tree>
</field>

View File

@ -110,10 +110,10 @@
<field name="date_order"/>
<field name="partner_id"/>
<field name="location_id"/>
<field name="origin"/>
<field name="invoiced" string="Paid"/>
<field name="shipped"/>
<field name="amount_untaxed"/>
<field name="origin"/>
<field name="state"/>
</tree>
</field>

View File

@ -113,7 +113,7 @@
<field name="product_id" ref="product.product_product_cpu1"/>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="inventory_id" ref="stock_inventory_0"/>
<field name="product_qty">12.0</field>
<field name="product_qty">22.0</field>
<field name="location_id" ref="stock_location_components"/>
</record>
<record id="stock_inventory_line_5" model="stock.inventory.line">

View File

@ -455,10 +455,10 @@
<tree string="Packing list" color="red:state=='cancel'">
<field name="name" select="1" colspan="4"/>
<field name="date" select="1"/>
<field name="origin" select="1"/>
<field name="loc_move_id" select="1"/>
<field name="address_id" select="1"/>
<field name="invoice_state" readonly="1"/>
<field name="origin" select="1"/>
<field name="state" readonly="1"/>
</tree>
</field>
@ -519,9 +519,9 @@
<field name="state" readonly="1"/>
<button name="button_confirm" string="Confirm" states="draft"/>
<button name="action_assign" string="Assign" states="confirmed" type="object"/>
<button name="force_assign" string="Force assignations" states="confirmed" type="object"/>
<button name="cancel_assign" string="Cancel assignations" states="assigned" type="object"/>
<button type="action" name="%(partial_picking)d" string="Make Packing" states="assigned"/>
<button name="force_assign" string="Force Assignation" states="confirmed" type="object"/>
<button name="cancel_assign" string="Cancel Assignation" states="assigned" type="object"/>
<button type="action" name="%(partial_picking)d" string="Validate" states="assigned"/>
<button name="button_cancel" string="Cancel" states="assigned,confirmed,draft"/>
</group>
</page><page string="Notes">
@ -578,7 +578,7 @@
<field name="domain">[('state','=','confirmed'),('type','=','out')]</field>
<field name="context">{'contact_display': 'partner'}</field>
</record>
<menuitem name="Inventory Control/Packing Lists/Sending Goods/Confirmed Packings Waiting Products" id="menu_action_picking_tree3" action="action_picking_tree3"/>
<menuitem name="Inventory Control/Packing Lists/Sending Goods/Confirmed Packings Waiting Assignation" id="menu_action_picking_tree3" action="action_picking_tree3"/>
<record model="ir.actions.act_window" id="action_picking_tree4">
@ -600,7 +600,7 @@
<field name="domain">[('state','=','assigned'),('type','=','in')]</field>
<field name="context">{'contact_display': 'partner'}</field>
</record>
<menuitem name="Inventory Control/Packing Lists/Getting Goods/Packings to Process" id="menu_action_picking_tree5" action="action_picking_tree5"/>
<menuitem name="Inventory Control/Packing Lists/Getting Goods/Packings to be Received" id="menu_action_picking_tree5" action="action_picking_tree5"/>
<record model="ir.actions.act_window" id="action_picking_tree6">
<field name="name">Internal packing lists</field>
@ -631,7 +631,7 @@
<field name="domain">[('state','=','confirmed'),('type','=','internal')]</field>
<field name="context">{'contact_display': 'partner'}</field>
</record>
<menuitem name="Inventory Control/Packing Lists/Internal/Confirmed Packings Waiting Products" id="menu_action_picking_tree8" action="action_picking_tree8"/>
<menuitem name="Inventory Control/Packing Lists/Internal/Confirmed Packings Waiting Assignation" id="menu_action_picking_tree8" action="action_picking_tree8"/>
<record model="ir.actions.act_window" id="action_picking_tree9">
<field name="name">Draft packings (internal)</field>
<field name="res_model">stock.picking</field>