bzr revid: fp@tinyerp.com-20080827234815-8sz0qnm7w2d3sm38
This commit is contained in:
Fabien Pinckaers 2008-08-28 01:48:15 +02:00
parent 656f7f76e5
commit d315518200
6 changed files with 122 additions and 70 deletions

View File

@ -305,7 +305,7 @@ class mrp_production(osv.osv):
_description = 'Production'
_date_name = 'date_planned'
_columns = {
'name': fields.char('Name', size=64, required=True),
'name': fields.char('Reference', size=64, required=True),
'origin': fields.char('Origin', size=64),
'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority'),
@ -315,8 +315,8 @@ class mrp_production(osv.osv):
'product_uos_qty': fields.float('Product Qty'),
'product_uos': fields.many2one('product.uom', 'Product UOM'),
'location_src_id': fields.many2one('stock.location', 'Production Location', required=True),
'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True),
'location_src_id': fields.many2one('stock.location', 'Raw Products Location', required=True),
'location_dest_id': fields.many2one('stock.location', 'Finnished Products Location', required=True),
'date_planned': fields.date('Scheduled date', required=True),
'date_start': fields.datetime('Start Date'),
@ -337,6 +337,7 @@ class mrp_production(osv.osv):
_defaults = {
'priority': lambda *a: '1',
'state': lambda *a: 'draft',
'date_planned': lambda *a: time.strftime('%Y-%m-%d'),
'product_qty': lambda *a: 1.0,
'name': lambda x,y,z,c: x.pool.get('ir.sequence').get(y,z,'mrp.production') or '/',
}
@ -676,7 +677,7 @@ class mrp_procurement(osv.osv):
'close_move': fields.boolean('Close Move at end', required=True),
'location_id': fields.many2one('stock.location', 'Location', required=True),
'procure_method': fields.selection([('make_to_stock','from stock'),('make_to_order','on order')], 'Procurement Method', states={'draft':[('readonly',False)], 'confirmed':[('readonly',False)]}, readonly=True),
'procure_method': fields.selection([('make_to_stock','from stock'),('make_to_order','on order')], 'Procurement Method', states={'draft':[('readonly',False)], 'confirmed':[('readonly',False)]}, readonly=True, required=True),
'purchase_id': fields.many2one('purchase.order', 'Purchase Order'),
'purchase_line_id': fields.many2one('purchase.order.line', 'Purchase Order Line'),
@ -689,6 +690,7 @@ class mrp_procurement(osv.osv):
_defaults = {
'state': lambda *a: 'draft',
'priority': lambda *a: '1',
'date_planned': lambda *a: time.strftime('%Y-%m-%d'),
'close_move': lambda *a: 0,
'procure_method': lambda *a: 'make_to_order',
}

View File

@ -381,24 +381,28 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Production orders">
<notebook>
<page string="General">
<field colspan="4" name="name" select="1"/>
<field name="date_planned" select="1"/>
<field name="priority"/>
<field name="product_id" on_change="product_id_change(product_id)" select="1"/>
<field name="product_qty"/>
<field name="product_uom"/>
<!--
<field name="product_uos_qty"/>
<field name="product_uos"/>
-->
<field name="bom_id" select="2"/>
<newline/>
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="date_planned" select="1"/>
<field name="priority"/>
<field name="product_id" on_change="product_id_change(product_id)" select="1"/>
<field name="product_qty"/>
<field name="product_uom"/>
<group colspan="6" col="6">
<label string="" colspan="2"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="product_uos" groups="product.group_uos"/>
</group>
</group>
<notebook colspan="4">
<page string="Consumed Products">
<field name="location_src_id" select="2"/>
<field name="location_dest_id"/>
<field name="bom_id" select="2"/>
<field name="origin" select="1"/>
<newline/>
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list"/>
<group col="9" colspan="4">
@ -412,20 +416,20 @@
<button name="button_recreate" states="picking_except" string="Recreate Picking"/>
</group>
</page>
<page string="Scheduled goods">
<page string="Scheduled Products">
<field colspan="4" name="product_lines" nolabel="1" widget="one2many_list"/>
</page>
<page string="Finnished Products">
<field colspan="4" name="move_created_ids" nolabel="1"/>
</page>
<page string="Workcenters">
<field colspan="4" name="workcenter_lines" nolabel="1" widget="one2many_list"/>
</page>
<page string="Other Info">
<page string="Extra Information">
<field name="date_start" select="2"/>
<field name="date_finnished"/>
<field name="picking_id"/>
<field name="origin" select="1"/>
<field name="move_prod_id"/>
<newline/>
<field colspan="4" name="move_created_ids" nolabel="1"/>
</page>
</notebook>
</form>
@ -446,7 +450,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">tree,form,calendar</field>
<field name="domain">[('state','=','ready')]</field>
</record>
<menuitem action="mrp_production_action2" id="menu_production_orders_start" parent="menu_mrp_production_action"/>
@ -455,20 +459,29 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">tree,form,calendar</field>
<field name="domain">[('state','=','in_production')]</field>
</record>
<menuitem action="mrp_production_action3" id="menu_mrp_production_action3" parent="menu_mrp_production_action"/>
<record id="mrp_production_action4" model="ir.actions.act_window">
<field name="name">Production orders waiting goods</field>
<field name="name">Production Orders Waiting Products</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">tree,form,calendar</field>
<field name="domain">[('state','=','confirmed')]</field>
</record>
<menuitem action="mrp_production_action4" id="menu_production_orders_waiting4" parent="mrp.menu_mrp_production_action"/>
<record id="mrp_production_new" model="ir.actions.act_window">
<field name="name">New Production Order</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree,calendar</field>
</record>
<menuitem action="mrp_production_new" id="menu_production_orders_new" parent="mrp.menu_mrp_production_action"/>
<record id="mrp_production_workcenter_form_view" model="ir.ui.view">
<field name="name">mrp.production.workcenter.line.form</field>
<field name="model">mrp.production.workcenter.line</field>
@ -538,7 +551,7 @@
<field name="model">mrp.production.product.line</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Scheduled goods">
<form string="Scheduled Products">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty"/>
@ -553,7 +566,7 @@
<field name="model">mrp.production.product.line</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Scheduled goods">
<tree string="Scheduled Products">
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom"/>
@ -591,34 +604,51 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Procurement">
<separator colspan="4" string="General Information"/>
<field colspan="4" name="name" select="1"/>
<field name="priority"/>
<field name="date_planned" select="1"/>
<field name="procure_method" select="2"/>
<field name="date_close" select="2"/>
<newline/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="product_uos_qty"/>
<field name="product_uos"/>
<field name="product_id" select="1"/>
<field name="location_id" select="2"/>
<newline/>
<field name="origin" select="2"/>
<field name="move_id"/>
<newline/>
<field colspan="4" name="message"/>
<separator colspan="4" string="Properties"/>
<field colspan="4" name="property_ids" nolabel="1"/>
<group col="7" colspan="4">
<field name="state" readonly="1" select="2"/>
<button name="button_confirm" states="draft" string="Confirm"/>
<button name="button_restart" states="exception" string="Retry"/>
<button name="button_cancel" states="exception,waiting" string="Cancel"/>
<button name="button_check" states="confirmed" string="Run procurement"/>
<button name="button_cancel" states="draft,running" string="Cancel"/>
</group>
<notebook>
<page string="Procurement Details">
<group col="2" colspan="2">
<separator colspan="2" string="References"/>
<field name="name" select="1" string="Procurement Reason"/>
<field name="origin" select="2"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Planification"/>
<field name="date_planned" select="1"/>
<field name="procure_method" select="2"/>
<field name="priority"/>
</group>
<separator colspan="4" string="Product &amp; Location"/>
<field name="product_id" select="1"/>
<field name="location_id" select="2"/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="product_uos" groups="product.group_uos"/>
<separator colspan="4" string="Status"/>
<field colspan="4" name="message" readonly="1"/>
<field name="state" readonly="1" select="2"/>
<group col="7" colspan="2">
<button name="button_confirm" states="draft" string="Confirm"/>
<button name="button_restart" states="exception" string="Retry"/>
<button name="button_cancel" states="exception,waiting" string="Cancel"/>
<button name="button_check" states="confirmed" string="Run procurement"/>
<button name="button_cancel" states="draft,running" string="Cancel"/>
</group>
</page>
<page string="Extra Information">
<separator colspan="4" string="Details"/>
<field name="bom_id" select="2"/>
<field name="move_id"/>
<field name="date_close" select="2"/>
<field name="close_move"/>
<field name="purchase_id"/>
<separator colspan="4" string="Properties"/>
<field colspan="4" name="property_ids" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
@ -627,7 +657,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.procurement</field>
<field name="view_type">form</field>
<field name="view_id" ref="mrp_procurement_form_view"/>
<field name="view_id" eval="False"/>
</record>
<menuitem action="mrp_procurement_action" id="menu_mrp_procurement_action" parent="mrp.menu_mrp_root"/>
@ -680,6 +710,15 @@
</record>
<menuitem action="mrp_procurement_action11" id="menu_mrp_procurement_action11" parent="mrp.menu_mrp_procurement_action5"/>
<record id="mrp_procurement_new" model="ir.actions.act_window">
<field name="name">New Procurement</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.procurement</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
</record>
<menuitem action="mrp_procurement_new" id="menu_mrp_procurement_new" parent="mrp.menu_mrp_procurement_action5"/>
<!-- Order Point -->
<record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree</field>

View File

@ -2,6 +2,6 @@
<terp>
<data>
<report auto="False" id="report_purchase_quotation" model="purchase.order" name="purchase.quotation" rml="purchase/report/request_quotation.rml" string="Request for Quotation"/>
<report auto="False" id="report_purchase_order" model="purchase.order" name="purchase.order" rml="purchase/report/order.rml" string="Print Order"/>
<report auto="False" id="report_purchase_order" model="purchase.order" name="purchase.order" rml="purchase/report/order.rml" string="Purchase Order"/>
</data>
</terp>
</terp>

View File

@ -45,11 +45,14 @@
<button name="invoice_ok" states="except_invoice" string="Invoice Done"/>
</group>
</page>
<page string="Extra Infos">
<page string="Delivery &amp; Invoices">
<separator string="Delivery" colspan="2"/>
<separator string="Invoice Control" colspan="2"/>
<field name="dest_address_id" on_change="onchange_dest_address_id(dest_address_id)"/>
<field name="location_id"/>
<field name="invoice_method"/>
<field name="location_id"/>
<newline/>
<separator string="Purchase Control" colspan="4"/>
<field name="validator"/>
<field name="date_approve"/>
</page>

View File

@ -478,6 +478,13 @@ class stock_picking(osv.osv):
# TODO: Check locations to see if in the same location ?
return True
def button_confirm(self, cr, uid, ids, *args):
for id in ids:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', id, 'button_confirm', cr)
self.force_assign(cr, uid, ids, *args)
return True
def action_assign(self, cr, uid, ids, *args):
for pick in self.browse(cr, uid, ids):
move_ids = [x.id for x in pick.move_lines if x.state=='confirmed']

View File

@ -62,13 +62,13 @@
<field colspan="4" name="inventory_line_id" nolabel="1" widget="one2many_list"/>
</page><page string="Posted Inventory">
<field colspan="4" name="move_ids" nolabel="1"/>
<field name="state" select="1"/>
<group col="2" colspan="2">
<button name="action_done" states="draft" string="Confirm Inventory" type="object"/>
<button name="action_cancel" states="done" string="Cancel Inventory" type="object"/>
</group>
</page>
</notebook>
<field name="state" select="1"/>
<group col="2" colspan="2">
<button name="action_done" states="draft" string="Confirm Inventory" type="object"/>
<button name="action_cancel" states="done" string="Cancel Inventory" type="object"/>
</group>
</form>
</field>
</record>
@ -927,7 +927,7 @@
</group>
<group col="8" colspan="4">
<field name="state" readonly="1"/>
<button name="button_confirm" states="draft" string="Confirm"/>
<button name="button_confirm" states="draft" string="Confirm" type="object"/>
<button name="action_assign" states="confirmed" string="Assign" type="object"/>
<button name="force_assign" states="confirmed" string="Force Assignation" type="object"/>
<button name="cancel_assign" states="assigned" string="Cancel Assignation" type="object"/>
@ -997,6 +997,7 @@
<field name="res_model">stock.picking</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="view_id" ref="view_picking_in_form"/>
<field name="context">{'contact_display': 'partner'}</field>
<field name="domain">[('type','=','in')]</field>