[MERGE] trunk-addons7 (fix functional issues, mostly in mrp)

bzr revid: rco@openerp.com-20120912144021-6h1u2w2gc9370jw0
This commit is contained in:
Raphael Collet
2012-09-12 16:40:21 +02:00
19 changed files with 130 additions and 209 deletions
+3 -1
View File
@@ -75,7 +75,9 @@ class crm_case_stage(osv.osv):
'requirements': fields.text('Requirements'),
'section_ids':fields.many2many('crm.case.section', 'section_stage_rel', 'stage_id', 'section_id', string='Sections',
help="Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."),
'state': fields.selection(AVAILABLE_STATES, 'State', required=True, help="The related state for the stage. The state of your document will automatically change regarding the selected stage. For example, if a stage is related to the state 'Close', when your document reaches this stage, it will be automatically have the 'closed' state."),
'state': fields.selection(AVAILABLE_STATES, 'Related Status', required=True,
help="The status of your document will automatically change regarding the selected stage. " \
"For example, if a stage is related to the state 'Close', when your document reaches this stage, it is automatically closed."),
'case_default': fields.boolean('Common to All Teams',
help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."),
'fold': fields.boolean('Hide in Views when Empty',
+1 -1
View File
@@ -183,7 +183,7 @@
<form string="Stage" version="7.0">
<group col="4">
<field name="name"/>
<field name="state" string="Related State" />
<field name="state" />
<field name="probability"/>
<field name="type"/>
<field name="on_change"/>
-55
View File
@@ -196,11 +196,6 @@ msgstr ""
msgid "For purchased material"
msgstr ""
#. module: mrp
#: field:mrp.bom.revision,indice:0
msgid "Revision"
msgstr ""
#. module: mrp
#: model:ir.actions.act_window,help:mrp.product_form_config_action
msgid "Create a product form for everything you buy or sell. Specify a supplier if the product can be purchased."
@@ -435,11 +430,6 @@ msgstr ""
msgid "For Services."
msgstr ""
#. module: mrp
#: field:mrp.bom.revision,date:0
msgid "Modification Date"
msgstr ""
#. module: mrp
#: help:mrp.workcenter,costs_cycle_account_id:0
#: help:mrp.workcenter,costs_hour_account_id:0
@@ -493,11 +483,6 @@ msgstr ""
msgid "Force Reservation"
msgstr ""
#. module: mrp
#: field:mrp.bom.revision,author_id:0
msgid "Author"
msgstr ""
#. module: mrp
#: field:report.mrp.inout,value:0
msgid "Stock value"
@@ -761,11 +746,6 @@ msgstr ""
msgid "Ready to Produce"
msgstr ""
#. module: mrp
#: field:mrp.bom.revision,name:0
msgid "Modification name"
msgstr ""
#. module: mrp
#: view:mrp.bom:0
#: view:mrp.production:0
@@ -1294,11 +1274,6 @@ msgstr ""
msgid "Work Center Loads"
msgstr ""
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_bom_revision
msgid "Bill of Material Revision"
msgstr ""
#. module: mrp
#: help:mrp.production,origin:0
msgid "Reference of the document that generated this production order request."
@@ -1772,12 +1747,6 @@ msgstr ""
msgid "Orange Juice"
msgstr ""
#. module: mrp
#: field:mrp.bom.revision,bom_id:0
#: field:procurement.order,bom_id:0
msgid "BoM"
msgstr ""
#. module: mrp
#: model:ir.model,name:mrp.model_report_mrp_inout
#: view:report.mrp.inout:0
@@ -1795,17 +1764,6 @@ msgstr ""
msgid "Waiting Goods"
msgstr ""
#. module: mrp
#: field:mrp.bom.revision,last_indice:0
msgid "last indice"
msgstr ""
#. module: mrp
#: field:mrp.bom,revision_ids:0
#: view:mrp.bom.revision:0
msgid "BoM Revisions"
msgstr ""
#. module: mrp
#: field:report.mrp.inout,date:0
#: field:report.workcenter.load,name:0
@@ -1987,19 +1945,6 @@ msgstr ""
msgid "Change Product Qty"
msgstr ""
#. module: mrp
#: view:mrp.bom.revision:0
#: field:mrp.bom.revision,description:0
#: view:mrp.property:0
#: view:mrp.property.group:0
#: field:mrp.routing,note:0
#: view:mrp.routing.workcenter:0
#: field:mrp.routing.workcenter,note:0
#: view:mrp.workcenter:0
#: field:mrp.workcenter,note:0
msgid "Description"
msgstr ""
#. module: mrp
#: view:board.board:0
msgid "Manufacturing board"
+46 -49
View File
@@ -47,13 +47,13 @@ class mrp_workcenter(osv.osv):
'time_start': fields.float('Time before prod.', help="Time in hours for the setup."),
'time_stop': fields.float('Time after prod.', help="Time in hours for the cleaning."),
'costs_hour': fields.float('Cost per hour', help="Specify Cost of Work Center per hour."),
'costs_hour_account_id': fields.many2one('account.analytic.account', 'Hour Account', domain=[('type','<>','view')],
'costs_hour_account_id': fields.many2one('account.analytic.account', 'Hour Account', domain=[('type','!=','view')],
help="Fill this only if you want automatic analytic accounting entries on production orders."),
'costs_cycle': fields.float('Cost per cycle', help="Specify Cost of Work Center per cycle."),
'costs_cycle_account_id': fields.many2one('account.analytic.account', 'Cycle Account', domain=[('type','<>','view')],
'costs_cycle_account_id': fields.many2one('account.analytic.account', 'Cycle Account', domain=[('type','!=','view')],
help="Fill this only if you want automatic analytic accounting entries on production orders."),
'costs_journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal'),
'costs_general_account_id': fields.many2one('account.account', 'General Account', domain=[('type','<>','view')]),
'costs_general_account_id': fields.many2one('account.account', 'General Account', domain=[('type','!=','view')]),
'resource_id': fields.many2one('resource.resource','Resource', ondelete='cascade', required=True),
'product_id': fields.many2one('product.product','Work Center Product', help="Fill this product to easily track your production costs in the analytic accounting."),
}
@@ -214,7 +214,6 @@ class mrp_bom(osv.osv):
'bom_id': fields.many2one('mrp.bom', 'Parent BoM', ondelete='cascade', select=True),
'routing_id': fields.many2one('mrp.routing', 'Routing', help="The list of operations (list of work centers) to produce the finished product. The routing is mainly used to compute work center costs during operations and to plan future loads on work centers based on production planning."),
'property_ids': fields.many2many('mrp.property', 'mrp_bom_property_rel', 'bom_id','property_id', 'Properties'),
'revision_ids': fields.one2many('mrp.bom.revision', 'bom_id', 'BoM Revisions'),
'child_complete_ids': fields.function(_child_compute, relation='mrp.bom', string="BoM Hierarchy", type='many2many'),
'company_id': fields.many2one('res.company','Company',required=True),
}
@@ -374,26 +373,6 @@ class mrp_bom(osv.osv):
mrp_bom()
class mrp_bom_revision(osv.osv):
_name = 'mrp.bom.revision'
_description = 'Bill of Material Revision'
_columns = {
'name': fields.char('Modification name', size=64, required=True),
'description': fields.text('Description'),
'date': fields.date('Modification Date'),
'indice': fields.char('Revision', size=16),
'last_indice': fields.char('last indice', size=64),
'author_id': fields.many2one('res.users', 'Author'),
'bom_id': fields.many2one('mrp.bom', 'BoM', select=True),
}
_defaults = {
'author_id': lambda x, y, z, c: z,
'date': fields.date.context_today,
}
mrp_bom_revision()
def rounding(f, r):
import math
if not r:
@@ -457,41 +436,59 @@ class mrp_production(osv.osv):
return dest_location_id.id
_columns = {
'name': fields.char('Reference', size=64, required=True),
'origin': fields.char('Source Document', size=64, help="Reference of the document that generated this production order request."),
'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority', select=True),
'name': fields.char('Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}),
'origin': fields.char('Source Document', size=64, readonly=True, states={'draft': [('readonly', False)]},
help="Reference of the document that generated this production order request."),
'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority',
select=True, readonly=True, states=dict.fromkeys(['draft', 'confirmed'], [('readonly', False)])),
'product_id': fields.many2one('product.product', 'Product', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'product_qty': fields.float('Product Quantity', digits_compute=dp.get_precision('Product Unit of Measure'), required=True, states={'draft':[('readonly',False)]}, readonly=True),
'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True, states={'draft':[('readonly',False)]}, readonly=True),
'product_uos_qty': fields.float('Product UoS Quantity', states={'draft':[('readonly',False)]}, readonly=True),
'product_uos': fields.many2one('product.uom', 'Product UoS', states={'draft':[('readonly',False)]}, readonly=True),
'product_id': fields.many2one('product.product', 'Product', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'product_qty': fields.float('Product Quantity', digits_compute=dp.get_precision('Product Unit of Measure'), required=True, readonly=True, states={'draft':[('readonly',False)]}),
'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'product_uos_qty': fields.float('Product UoS Quantity', readonly=True, states={'draft': [('readonly', False)]}),
'product_uos': fields.many2one('product.uom', 'Product UoS', readonly=True, states={'draft': [('readonly', False)]}),
'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', required=True,
readonly=True, states={'draft':[('readonly',False)]}, help="Location where the system will look for components."),
readonly=True, states={'draft':[('readonly',False)]},
help="Location where the system will look for components."),
'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=True,
readonly=True, states={'draft':[('readonly',False)]}, help="Location where the system will stock the finished products."),
readonly=True, states={'draft':[('readonly',False)]},
help="Location where the system will stock the finished products."),
'date_planned_end': fields.function(_production_date_end, type='date', string='Scheduled End Date'),
'date_planned_date': fields.function(_production_date, type='date', string='Scheduled Date'),
'date_planned': fields.datetime('Scheduled Date', required=True, select=1),
'date_start': fields.datetime('Start Date', select=True),
'date_finished': fields.datetime('End Date', select=True),
'date_planned': fields.datetime('Scheduled Date', required=True, select=1, readonly=True, states={'draft':[('readonly',False)]}),
'date_start': fields.datetime('Start Date', select=True, readonly=True),
'date_finished': fields.datetime('End Date', select=True, readonly=True),
'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)], readonly=True, states={'draft':[('readonly',False)]}),
'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null', readonly=True, states={'draft':[('readonly',False)]}, help="The list of operations (list of work centers) to produce the finished product. The routing is mainly used to compute work center costs during operations and to plan future loads on work centers based on production plannification."),
'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null', readonly=True, states={'draft':[('readonly',False)]},
help="The list of operations (list of work centers) to produce the finished product. The routing is mainly used to compute work center costs during operations and to plan future loads on work centers based on production plannification."),
'picking_id': fields.many2one('stock.picking', 'Picking List', readonly=True, ondelete="restrict",
help="This is the Internal Picking List that brings the finished product to the production plan"),
'move_prod_id': fields.many2one('stock.move', 'Product Move', readonly=True),
'move_lines': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Products to Consume', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}),
'move_lines2': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Consumed Products', domain=[('state','in', ('done', 'cancel'))]),
'move_created_ids': fields.one2many('stock.move', 'production_id', 'Products to Produce', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}),
'move_created_ids2': fields.one2many('stock.move', 'production_id', 'Produced Products', domain=[('state','in', ('done', 'cancel'))]),
'product_lines': fields.one2many('mrp.production.product.line', 'production_id', 'Scheduled goods'),
'workcenter_lines': fields.one2many('mrp.production.workcenter.line', 'production_id', 'Work Centers Utilisation'),
'state': fields.selection([('draft','New'),('cancel','Cancelled'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','Production Started'),('done','Done')],'Status', readonly=True,
help='When the production order is created the state is set to \'Draft\'.\n If the order is confirmed the state is set to \'Waiting Goods\'.\n If any exceptions are there, the state is set to \'Picking Exception\'.\
\nIf the stock is available then the state is set to \'Ready to Produce\'.\n When the production gets started then the state is set to \'In Production\'.\n When the production is over, the state is set to \'Done\'.'),
'move_lines': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Products to Consume',
domain=[('state','not in', ('done', 'cancel'))], readonly=True, states={'draft':[('readonly',False)]}),
'move_lines2': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Consumed Products',
domain=[('state','in', ('done', 'cancel'))], readonly=True, states={'draft':[('readonly',False)]}),
'move_created_ids': fields.one2many('stock.move', 'production_id', 'Products to Produce',
domain=[('state','not in', ('done', 'cancel'))], readonly=True, states={'draft':[('readonly',False)]}),
'move_created_ids2': fields.one2many('stock.move', 'production_id', 'Produced Products',
domain=[('state','in', ('done', 'cancel'))], readonly=True, states={'draft':[('readonly',False)]}),
'product_lines': fields.one2many('mrp.production.product.line', 'production_id', 'Scheduled goods',
readonly=True, states={'draft':[('readonly',False)]}),
'workcenter_lines': fields.one2many('mrp.production.workcenter.line', 'production_id', 'Work Centers Utilisation',
readonly=True, states={'draft':[('readonly',False)]}),
'state': fields.selection(
[('draft', 'New'), ('cancel', 'Cancelled'), ('picking_except', 'Picking Exception'), ('confirmed', 'Waiting Goods'),
('ready', 'Ready to Produce'), ('in_production', 'Production Started'), ('done', 'Done')],
string='Status', readonly=True,
help="When the production order is created the state is set to 'Draft'.\n\
If the order is confirmed the state is set to 'Waiting Goods'.\n\
If any exceptions are there, the state is set to 'Picking Exception'.\n\
If the stock is available then the state is set to 'Ready to Produce'.\n\
When the production gets started then the state is set to 'In Production'.\n\
When the production is over, the state is set to 'Done'."),
'hour_total': fields.function(_production_calc, type='float', string='Total Hours', multi='workorder', store=True),
'cycle_total': fields.function(_production_calc, type='float', string='Total Cycles', multi='workorder', store=True),
'user_id':fields.many2one('res.users', 'Responsible'),
@@ -728,7 +725,7 @@ class mrp_production(osv.osv):
produced_qty = 0
for produced_product in production.move_created_ids2:
if (produced_product.scrapped) or (produced_product.product_id.id <> production.product_id.id):
if (produced_product.scrapped) or (produced_product.product_id.id != production.product_id.id):
continue
produced_qty += produced_product.product_qty
if production_mode in ['consume','consume_produce']:
@@ -935,7 +932,7 @@ class mrp_production(osv.osv):
# If usage of routing location is a internal, make outgoing shipment otherwise internal shipment
if production.bom_id.routing_id and production.bom_id.routing_id.location_id:
routing_loc = production.bom_id.routing_id.location_id
if routing_loc.usage <> 'internal':
if routing_loc.usage != 'internal':
pick_type = 'out'
partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False
+35 -62
View File
@@ -345,28 +345,14 @@
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<form string="Bill of Material" version="7.0">
<label for="product_id" string="Product and Quantity" class="oe_edit_only"/>
<h1>
<field name="product_id" on_change="onchange_product_id(product_id, name, context)" class="oe_inline"/>:
<field name="product_qty" class="oe_inline"/>
<field name="product_uom" class="oe_inline" groups="product.group_uom"/>
</h1>
<div groups="mrp.group_mrp_routings">
<label for="routing_id" class="oe_edit_only"/>
<h2><field name="routing_id" class="oe_inline"/></h2>
</div>
<group>
<group>
<field name="name"/>
<field name="code" string="Reference"/>
</group>
<group>
<field name="type"/>
<p colspan="2" class="oe_grey" attrs="{'invisible': [('type','=','normal')]}">
When processing a sale order for this product, the delivery order
will contain the raw materials, instead of the finished product.
</p>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="product_id" on_change="onchange_product_id(product_id, name, context)" class="oe_inline"/>
<label for="product_qty" string="Quantity"/>
<div>
<field name="product_qty" class="oe_inline"/>
<field name="product_uom" class="oe_inline" groups="product.group_uom"/>
</div>
<label for="product_uos_qty" groups="product.group_uos"/>
<div groups="product.group_uos" >
<field name="product_uos_qty"
@@ -374,6 +360,20 @@
<label string="-" attrs="{'invisible':[('product_uos','=',False)]}" class="oe_inline"/>
<field name="product_uos" class="oe_inline"/>
</div>
<div groups="mrp.group_mrp_routings">
<label for="routing_id" class="oe_edit_only"/>
<h2><field name="routing_id" class="oe_inline"/></h2>
</div>
</group>
<group>
<field name="name" class="oe_inline"/>
<field name="code" string="Reference"/>
<field name="type"/>
<p colspan="2" class="oe_grey" attrs="{'invisible': [('type','=','normal')]}">
When processing a sale order for this product, the delivery order
will contain the raw materials, instead of the finished product.
</p>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
</group>
<notebook>
@@ -389,9 +389,6 @@
</tree>
</field>
</page>
<page string="Revisions" attrs="{'invisible': [('bom_id','!=',False)]}">
<field name="revision_ids"/>
</page>
<page string="Properties" groups="product.group_mrp_properties">
<group>
<group>
@@ -411,6 +408,10 @@
<field name="property_ids" widget="many2many_tags"/>
</page>
</notebook>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
</div>
</form>
</field>
</record>
@@ -543,35 +544,6 @@
<field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
</record>
<record id="mrp_bom_revision_tree" model="ir.ui.view">
<field name="name">mrp.bom.revision</field>
<field name="model">mrp.bom.revision</field>
<field name="arch" type="xml">
<tree string="BoM Revisions">
<field name="indice"/>
<field name="author_id"/>
<field name="date"/>
<field colspan="4" name="name"/>
</tree>
</field>
</record>
<record id="mrp_bom_revision_form" model="ir.ui.view">
<field name="name">mrp.bom.revision</field>
<field name="model">mrp.bom.revision</field>
<field name="arch" type="xml">
<form string="BoM Revisions" version="7.0">
<group col="4">
<field name="name"/>
<field name="indice"/>
<field name="date"/>
<field name="author_id" readonly="1"/>
</group>
<separator string="Description"/>
<field name="description"/>
</form>
</field>
</record>
<!--
Production Management
-->
@@ -653,7 +625,7 @@
</div>
<group>
<group>
<field name="product_id" on_change="product_id_change(product_id)" domain="[('bom_ids','&lt;&gt;',False),('bom_ids.bom_id','=',False)]" class="oe_inline"/>
<field name="product_id" on_change="product_id_change(product_id)" domain="[('bom_ids','!=',False),('bom_ids.bom_id','=',False)]" class="oe_inline" context='{"default_supply_method":"produce", "default_type": "product"}'/>
<label for="product_qty"/>
<div>
<field name="product_qty" class="oe_inline"/>
@@ -661,7 +633,7 @@
<button type="action"
icon="terp-accessories-archiver+"
name="%(mrp.action_change_production_qty)d"
string="(Update)" states="ready,confirmed" class="oe_edit_only oe_link"/>
string="(Update)" states="confirmed" class="oe_edit_only oe_link"/>
</div>
<label for="product_uos_qty" groups="product.group_uos"/>
<div groups="product.group_uos">
@@ -686,12 +658,12 @@
<page string="Consumed Products">
<group>
<group string="Products to Consume">
<field name="move_lines" domain="[('state','&lt;&gt;', ('done', 'cancel'))]" nolabel="1">
<field name="move_lines" nolabel="1">
<tree colors="blue:state == 'draft';black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
<field name="product_id"/>
<field name="product_qty" string="Quantity"/>
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
<field name="location_id" string="Source Loc." groups="stock.group_locations"/>
<field name="prodlot_id" groups="stock.group_production_lot"/>
<field name="state" invisible="1"/>
<button name="%(stock.move_consume)d"
string="Consume Products" type="action"
@@ -701,7 +673,8 @@
name="%(stock.track_line)d"
string="Split in Serial Numbers"
type="action" icon="gtk-justify-fill"
states="draft,waiting,confirmed,assigned"/>
states="draft,waiting,confirmed,assigned"
groups="stock.group_production_lot"/>
<button name="%(stock.move_scrap)d"
string="Scrap Products" type="action"
icon="gtk-convert" context="{'scrap': True}"
@@ -710,12 +683,12 @@
</field>
</group>
<group string="Consumed Product">
<field name="move_lines2" domain="[('state','in', ('done', 'cancel'))]" nolabel="1">
<field name="move_lines2" nolabel="1">
<tree colors="red:scrapped==True;blue:state == 'draft';black:state in('picking_except','confirmed','ready','in_production');gray:state == 'cancel' " string="Consumed Products" editable="bottom">
<field name="product_id" readonly="1"/>
<field name="product_qty" readonly="1"/>
<field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
<field name="prodlot_id" context="{'product_id': product_id}"/>
<field name="prodlot_id" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
<field name="state" invisible="1"/>
<field name="scrapped" invisible="1"/>
<button
@@ -731,7 +704,7 @@
<page string="Finished Products">
<group>
<group string="Products to Produce">
<field name="move_created_ids" domain="[('state','&lt;&gt;', ('done', 'cancel'))]" nolabel="1">
<field name="move_created_ids" nolabel="1">
<tree string="Products to Finish">
<field name="product_id"/>
<field name="product_qty"/>
@@ -749,13 +722,13 @@
</field>
</group>
<group string="Produced Products">
<field name="move_created_ids2" domain="[('state','in', ('done', 'cancel'))]" nolabel="1">
<field name="move_created_ids2" nolabel="1">
<tree colors="red:scrapped==True;blue:state == 'draft';black:state in('picking_except','confirmed','ready','in_production');gray:state in('cancel','done') " string="Finished Products">
<field name="product_id" readonly="1"/>
<field name="product_qty" readonly="1"/>
<field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
<field name="location_dest_id" readonly="1" string="Destination Loc." widget="selection" groups="stock.group_locations"/>
<field name="prodlot_id" context="{'product_id': product_id}"/>
<field name="prodlot_id" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
<field name="scrapped" invisible="1"/>
<field name="state" invisible="1"/>
<button name="%(stock.track_line)d"
+1 -1
View File
@@ -65,7 +65,7 @@ class mrp_config_settings(osv.osv_memory):
help="""Routings allow you to create and manage the manufacturing operations that should be followed
within your work centers in order to produce a product. They are attached to bills of materials
that will define the required raw materials."""),
'group_mrp_properties': fields.boolean("allow several bill of materials per products",
'group_mrp_properties': fields.boolean("allow several bill of materials per products using properties",
implied_group='product.group_mrp_properties',
help="""The selection of the right Bill of Material to use will depend on the properties specified on the sale order and the Bill of Material."""),
'module_product_manufacturer': fields.boolean("define manufacturers on products ",
+3
View File
@@ -12,6 +12,9 @@
<field name="type">automatic</field>
<field name="sequence">100</field>
</record>
<record id="purchase.todo_open_purchase_menu" model="ir.actions.todo">
<field name="state">done</field>
</record>
</data>
<data>
<record id="view_mrp_config" model="ir.ui.view">
-2
View File
@@ -3,7 +3,6 @@ access_mrp_workcenter,mrp.workcenter,model_mrp_workcenter,mrp.group_mrp_user,1,0
access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0
access_mrp_routing_workcenter,mrp.routing.workcenter,model_mrp_routing_workcenter,mrp.group_mrp_user,1,0,0,0
access_mrp_bom,mrp.bom,model_mrp_bom,group_mrp_user,1,0,0,0
access_mrp_bom_revision,mrp.bom.revision,model_mrp_bom_revision,group_mrp_user,1,0,0,0
access_mrp_production,mrp.production user,model_mrp_production,mrp.group_mrp_user,1,1,1,1
access_mrp_production_salesman,mrp.production salesman,model_mrp_production,base.group_sale_salesman,1,1,1,0
access_mrp_production_product_line_salesman,mrp.production.product.line salesman,model_mrp_production_product_line,base.group_sale_salesman,1,0,1,0
@@ -16,7 +15,6 @@ access_mrp_workcenter_manager,mrp.workcenter.manager,model_mrp_workcenter,mrp.gr
access_mrp_routing_manager,mrp.routing.manager,model_mrp_routing,mrp.group_mrp_manager,1,1,1,1
access_mrp_routing_workcenter_manager,mrp.routing.workcenter.manager,model_mrp_routing_workcenter,mrp.group_mrp_manager,1,1,1,1
access_mrp_bom_manager,mrp.bom.manager,model_mrp_bom,mrp.group_mrp_manager,1,1,1,1
access_mrp_bom_revision_manager,mrp.bom.revision.manager,model_mrp_bom_revision,mrp.group_mrp_manager,1,1,1,1
access_stock_location_mrp_worker,stock.location mrp_worker,stock.model_stock_location,mrp.group_mrp_user,1,0,0,0
access_stock_move_mrp_worker,stock.move mrp_worker,stock.model_stock_move,mrp.group_mrp_user,1,1,1,0
access_stock_picking_mrp_worker,stock.picking mrp_worker,stock.model_stock_picking,mrp.group_mrp_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
3 access_mrp_routing mrp.routing model_mrp_routing mrp.group_mrp_user 1 0 0 0
4 access_mrp_routing_workcenter mrp.routing.workcenter model_mrp_routing_workcenter mrp.group_mrp_user 1 0 0 0
5 access_mrp_bom mrp.bom model_mrp_bom group_mrp_user 1 0 0 0
access_mrp_bom_revision mrp.bom.revision model_mrp_bom_revision group_mrp_user 1 0 0 0
6 access_mrp_production mrp.production user model_mrp_production mrp.group_mrp_user 1 1 1 1
7 access_mrp_production_salesman mrp.production salesman model_mrp_production base.group_sale_salesman 1 1 1 0
8 access_mrp_production_product_line_salesman mrp.production.product.line salesman model_mrp_production_product_line base.group_sale_salesman 1 0 1 0
15 access_mrp_routing_manager mrp.routing.manager model_mrp_routing mrp.group_mrp_manager 1 1 1 1
16 access_mrp_routing_workcenter_manager mrp.routing.workcenter.manager model_mrp_routing_workcenter mrp.group_mrp_manager 1 1 1 1
17 access_mrp_bom_manager mrp.bom.manager model_mrp_bom mrp.group_mrp_manager 1 1 1 1
access_mrp_bom_revision_manager mrp.bom.revision.manager model_mrp_bom_revision mrp.group_mrp_manager 1 1 1 1
18 access_stock_location_mrp_worker stock.location mrp_worker stock.model_stock_location mrp.group_mrp_user 1 0 0 0
19 access_stock_move_mrp_worker stock.move mrp_worker stock.model_stock_move mrp.group_mrp_user 1 1 1 0
20 access_stock_picking_mrp_worker stock.picking mrp_worker stock.model_stock_picking mrp.group_mrp_user 1 1 1 1
+1 -1
View File
@@ -71,7 +71,7 @@
partner_id = False
if order.bom_id.routing_id and order.bom_id.routing_id.location_id:
routing_loc = order.bom_id.routing_id.location_id
if routing_loc.usage <> 'internal':
if routing_loc.usage != 'internal':
pick_type = 'out'
partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False
routing_loc = routing_loc.id
+10 -5
View File
@@ -68,12 +68,12 @@ class change_production_qty(osv.osv_memory):
assert record_id, _('Active Id not found')
prod_obj = self.pool.get('mrp.production')
bom_obj = self.pool.get('mrp.bom')
move_obj = self.pool.get('stock.move')
for wiz_qty in self.browse(cr, uid, ids, context=context):
prod = prod_obj.browse(cr, uid, record_id, context=context)
prod_obj.write(cr, uid, [prod.id], {'product_qty': wiz_qty.product_qty})
prod_obj.action_compute(cr, uid, [prod.id])
move_lines_obj = self.pool.get('stock.move')
for move in prod.move_lines:
bom_point = prod.bom_id
bom_id = prod.bom_id.id
@@ -88,12 +88,17 @@ class change_production_qty(osv.osv_memory):
raise osv.except_osv(_('Error!'), _("Cannot find bill of material for this product."))
factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
for r in res[0]:
product_details, workcenter_details = \
bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
product_move = dict((mv.product_id.id, mv.id) for mv in prod.picking_id.move_lines)
for r in product_details:
if r['product_id'] == move.product_id.id:
move_lines_obj.write(cr, uid, [move.id], {'product_qty' : r['product_qty']})
move_obj.write(cr, uid, [move.id], {'product_qty': r['product_qty']})
if r['product_id'] in product_move:
move_obj.write(cr, uid, [product_move[r['product_id']]], {'product_qty': r['product_qty']})
if prod.move_prod_id:
move_obj.write(cr, uid, [prod.move_prod_id.id], {'product_qty' : wiz_qty.product_qty})
self._update_product_to_produce(cr, uid, prod, wiz_qty.product_qty, context=context)
return {}
change_production_qty()
+4 -3
View File
@@ -41,8 +41,9 @@ class project_task_type(osv.osv):
'case_default': fields.boolean('Common to All Projects',
help="If you check this field, this stage will be proposed by default on each new project. It will not assign this stage to existing projects."),
'project_ids': fields.many2many('project.project', 'project_task_type_rel', 'type_id', 'project_id', 'Projects'),
'state': fields.selection(_TASK_STATE, 'State', required=True,
help="The related state for the stage. The state of your document will automatically change regarding the selected stage. Example, a stage is related to the state 'Close', when your document reach this stage, it will be automatically closed."),
'state': fields.selection(_TASK_STATE, 'Related Status', required=True,
help="The status of your document is automatically changed regarding the selected stage. " \
"For example, if a stage is related to the status 'Close', when your document reaches this stage, it is automatically closed."),
'fold': fields.boolean('Hide in views if empty',
help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."),
}
@@ -727,7 +728,7 @@ class task(base_stage, osv.osv):
When the case is over, the state is set to \'Done\'.\
If the case needs to be reviewed then the state is \
set to \'Pending\'.'),
'categ_ids': fields.many2many('project.category', string='Categories'),
'categ_ids': fields.many2many('project.category', string='Tags'),
'kanban_state': fields.selection([('normal', 'Normal'),('blocked', 'Blocked'),('done', 'Ready To Pull')], 'Kanban State',
help="A task's kanban state indicates special situations affecting it:\n"
" * Normal is the default situation\n"
+1 -1
View File
@@ -779,7 +779,7 @@
<field name="case_default"/>
</group>
<group>
<field name="state" string="Related State"/>
<field name="state"/>
<field name="sequence"/>
<field name="fold"/>
</group>
+2 -1
View File
@@ -85,7 +85,8 @@
icon="terp-graph"
id="menu_board_purchase"
parent="base.menu_reporting_dashboard"
sequence="20"/>
sequence="20"
groups="purchase.group_purchase_user"/>
</data>
</openerp>
@@ -2,4 +2,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_mrp_bom_user,mrp.bom,mrp.model_mrp_bom,base.group_sale_salesman,1,0,0,0
access_sale_order_manufacturing_user,sale.order manufacturing.user,sale.model_sale_order,mrp.group_mrp_user,1,1,0,0
access_sale_order_line_manufacturing_user,sale.order.line manufacturing.user,sale.model_sale_order_line,mrp.group_mrp_user,1,1,0,0
access_mrp_bom_revision_salesman,mrp.bom.revision,mrp.model_mrp_bom_revision,base.group_sale_salesman,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_mrp_bom_user mrp.bom mrp.model_mrp_bom base.group_sale_salesman 1 0 0 0
3 access_sale_order_manufacturing_user sale.order manufacturing.user sale.model_sale_order mrp.group_mrp_user 1 1 0 0
4 access_sale_order_line_manufacturing_user sale.order.line manufacturing.user sale.model_sale_order_line mrp.group_mrp_user 1 1 0 0
access_mrp_bom_revision_salesman mrp.bom.revision mrp.model_mrp_bom_revision base.group_sale_salesman 1 0 0 0
-5
View File
@@ -2545,11 +2545,6 @@ class stock_move(osv.osv):
}
self.write(cr, uid, [move.id], update_val)
product_obj = self.pool.get('product.product')
for new_move in self.browse(cr, uid, res, context=context):
message = _("Product has been consumed with '%s' quantity.") % (new_move.product_qty)
product_obj.message_post(cr, uid, [new_move.product_id.id], body=message, context=context)
self.action_done(cr, uid, res, context=context)
return res
+3 -3
View File
@@ -164,14 +164,14 @@
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
<field name="prodlot_id" groups="stock.group_production_lot"/>
<button name="%(track_line)d" string="Split in serial numbers" type="action"
<button name="%(track_line)d" string="Split in serial numbers" type="action"
icon="terp-stock_effects-object-colorize"
attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}"
states="draft,done,cancel"
context="{'inventory_id':parent.id}"
groups="stock.group_production_lot"/>
<field groups="stock.group_tracking_lot" name="tracking_id"/>
<button name="%(split_into)d" string="Put in a new pack" type="action"
<field groups="stock.group_tracking_lot" name="tracking_id"/>
<button name="%(split_into)d" string="Put in a new pack" type="action"
groups="stock.group_tracking_lot"
icon="terp-stock_effects-object-colorize"
context="{'inventory_id':parent.id}"
@@ -5,7 +5,7 @@
<field name="name">Split Inventory Line</field>
<field name="model">stock.inventory.line.split</field>
<field name="arch" type="xml">
<form string="Split in Lots" version="7.0">
<form string="Split in Serial Numbers" version="7.0">
<group>
<field name="product_id" colspan="4" readonly="1"/>
<label for="qty"/>
+4 -3
View File
@@ -170,7 +170,8 @@ class split_in_production_lot(osv.osv_memory):
'product_uom': fields.many2one('product.uom', 'Unit of Measure'),
'line_ids': fields.one2many('stock.move.split.lines', 'wizard_id', 'Serial Numbers'),
'line_exist_ids': fields.one2many('stock.move.split.lines', 'wizard_exist_id', 'Serial Numbers'),
'use_exist' : fields.boolean('Existing Lots', help="Check this option to select existing lots in the list below, otherwise you should enter new ones line by line."),
'use_exist' : fields.boolean('Existing Serial Numbers',
help="Check this option to select existing serial numbers in the list below, otherwise you should enter new ones line by line."),
'location_id': fields.many2one('stock.location', 'Source Location')
}
@@ -271,8 +272,8 @@ class stock_move_split_lines_exist(osv.osv_memory):
}
def onchange_lot_id(self, cr, uid, ids, prodlot_id=False, product_qty=False,
loc_id=False, product_id=False, uom_id=False):
loc_id=False, product_id=False, uom_id=False,context=None):
return self.pool.get('stock.move').onchange_lot_id(cr, uid, [], prodlot_id, product_qty,
loc_id, product_id, uom_id)
loc_id, product_id, uom_id, context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+15 -14
View File
@@ -12,10 +12,10 @@
<field name="product_id" readonly="1"/>
<label for="product_qty"/>
<div>
<field name="product_qty"/>
<field name="product_uom" nolabel="1" readonly="1"/>
<field name="product_qty" class="oe_inline"/>
<field name="product_uom" class="oe_inline" readonly="1" groups="product.group_uom"/>
</div>
<field name="location_id"/>
<field name="location_id" groups="stock.group_locations"/>
</group>
<footer>
<button name="do_move_consume" string="Ok" type="object" class="oe_highlight"/>
@@ -46,9 +46,10 @@
<label for="product_qty"/>
<div>
<field name="product_qty" class="oe_inline"/>
<field name="product_uom" class="oe_inline" readonly="1"/>
<field name="product_uom" class="oe_inline" readonly="1" groups="product.group_uom"/>
</div>
<field name="location_id" string="Scrap Location" domain="[('usage','&lt;&gt;','view'),('scrap_location','=',True)]" widget="selection"/>
<field name="location_id" string="Scrap Location" widget="selection"
domain="[('usage','!=','view'),('scrap_location','=',True)]" groups="stock.group_locations"/>
</group>
<footer>
<button name="move_scrap" string="Ok" type="object" class="oe_highlight" />
@@ -69,10 +70,10 @@
</record>
<record id="view_split_in_lots" model="ir.ui.view">
<field name="name">Split in lots</field>
<field name="name">Split in Serial Numbers</field>
<field name="model">stock.move.split</field>
<field name="arch" type="xml">
<form string="Split in Lots" version="7.0">
<form string="Split in Serial Numbers" version="7.0">
<group>
<field name="product_id" readonly="1"/>
<label for="qty"/>
@@ -85,25 +86,25 @@
</group>
<field name="line_ids" attrs="{'invisible':[('use_exist','=',True)]}">
<tree string="Serial Numbers" editable="bottom">
<field name="name" string="Lots"/>
<field name="name"/>
<field name="quantity" />
</tree>
<form string="Serial Number" version="7.0">
<group>
<field name="name" string="Lot number"/>
<field name="name"/>
<field name="quantity" />
</group>
</form>
</field>
<field name="line_exist_ids" attrs="{'invisible':[('use_exist','!=',True)]}">
<tree string="Serial Numbers" editable="bottom">
<field name="prodlot_id" string="Lot number" domain="[('product_id','=',parent.product_id)]" on_change="onchange_lot_id(prodlot_id, quantity, parent.location_id, parent.product_id, parent.product_uom)"/>
<field name="quantity" on_change="onchange_lot_id(prodlot_id, quantity, parent.location_id, parent.product_id, parent.product_uom)" />
<field name="prodlot_id" string="Serial Number" quick_create="false" domain="[('product_id','=',parent.product_id)]" on_change="onchange_lot_id(prodlot_id, quantity, parent.location_id, parent.product_id, parent.product_uom, context)" context="{'product_id': parent.product_id}"/>
<field name="quantity" on_change="onchange_lot_id(prodlot_id, quantity, parent.location_id, parent.product_id, parent.product_uom,context)" />
</tree>
<form string="Serial Number" version="7.0">
<group>
<field name="prodlot_id" string="Lot number" domain="[('product_id','=',parent.product_id)]" on_change="onchange_lot_id(prodlot_id, quantity, parent.location_id, parent.product_id, parent.product_uom)"/>
<field name="quantity" on_change="onchange_lot_id(prodlot_id, quantity, parent.location_id, parent.product_id, parent.product_uom)" />
<field name="prodlot_id" domain="[('product_id','=',parent.product_id)]" on_change="onchange_lot_id(prodlot_id, quantity, parent.location_id, parent.product_id, parent.product_uom, context)"/>
<field name="quantity" on_change="onchange_lot_id(prodlot_id, quantity, parent.location_id, parent.product_id, parent.product_uom, context)" />
</group>
</form>
</field>
@@ -115,7 +116,7 @@
</record>
<record id="track_line" model="ir.actions.act_window">
<field name="name">Split in lots</field>
<field name="name">Split in Serial Numbers</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.move.split</field>
<field name="view_type">form</field>