[MERGE] usability improvements among several modules/screens

bzr revid: qdp-launchpad@openerp.com-20140214145712-j8dmf06wy49x9l50
This commit is contained in:
Quentin (OpenERP) 2014-02-14 15:57:12 +01:00
commit 9550c32409
13 changed files with 104 additions and 104 deletions

View File

@ -27,15 +27,13 @@
</h1> </h1>
</div> </div>
<group> <group>
<group name="general"> <field name="active"/>
</group>
<group name="general">
<group string="General Information">
<field name="partner_id"/> <field name="partner_id"/>
<field name="product_id"/> <field name="product_id"/>
</group> </group>
<group>
<field name="active"/>
</group>
</group>
<group col="4">
<group string="Pricing Information"> <group string="Pricing Information">
<field name="normal_price" attrs="{'readonly':[('use_detailed_pricelist', '=', True)]}"/> <field name="normal_price" attrs="{'readonly':[('use_detailed_pricelist', '=', True)]}"/>
<label for="free_if_more_than"/> <label for="free_if_more_than"/>
@ -43,10 +41,12 @@
<field name="free_if_more_than" attrs="{'readonly':[('use_detailed_pricelist', '=', True)]}"/> <field name="free_if_more_than" attrs="{'readonly':[('use_detailed_pricelist', '=', True)]}"/>
<field name="amount" attrs="{'required':[('free_if_more_than','&lt;&gt;',False)], 'invisible':[('free_if_more_than','=',False)]}"/> <field name="amount" attrs="{'required':[('free_if_more_than','&lt;&gt;',False)], 'invisible':[('free_if_more_than','=',False)]}"/>
</div> </div>
</group>
<newline/> <newline/>
<field name="use_detailed_pricelist"/> <field name="use_detailed_pricelist"/>
</group>
</group> </group>
<field name="pricelist_ids" attrs="{'invisible':[('use_detailed_pricelist','=',False)]}" mode="tree"> <field name="pricelist_ids" attrs="{'invisible':[('use_detailed_pricelist','=',False)]}" mode="tree">
<tree string="Delivery grids"> <tree string="Delivery grids">
<field name="sequence"/> <field name="sequence"/>
@ -235,13 +235,13 @@
<group> <group>
<field name="carrier_id"/> <field name="carrier_id"/>
<field name="carrier_tracking_ref"/> <field name="carrier_tracking_ref"/>
<field name="number_of_packages"/>
</group> </group>
<group> <group>
<label for="weight" string="Weight"/> <label for="weight" string="Weight"/>
<div> <div>
<field name="weight" class="oe_inline"/> <field name="weight" class="oe_inline"/>
<field name="weight_uom_id" nolabel="1" class="oe_inline"/> <field name="weight_uom_id" nolabel="1" class="oe_inline"/>
<field name="number_of_packages"/>
</div> </div>
<field name="weight_net" groups="base.group_no_one"/> <field name="weight_net" groups="base.group_no_one"/>
</group> </group>

View File

@ -259,11 +259,12 @@ class stock_warehouse(osv.osv):
all_routes += [warehouse.manufacture_pull_id.route_id.id] all_routes += [warehouse.manufacture_pull_id.route_id.id]
return all_routes return all_routes
def _handle_renaming(self, cr, uid, warehouse, name, context=None): def _handle_renaming(self, cr, uid, warehouse, name, code, context=None):
res = super(stock_warehouse, self)._handle_renaming(cr, uid, warehouse, name, context=context) res = super(stock_warehouse, self)._handle_renaming(cr, uid, warehouse, name, code, context=context)
pull_obj = self.pool.get('procurement.rule') pull_obj = self.pool.get('procurement.rule')
#change the manufacture pull rule name #change the manufacture pull rule name
pull_obj.write(cr, uid, warehouse.manufacture_pull_id.id, {'name': warehouse.manufacture_pull_id.name.replace(warehouse.name, name, 1)}, context=context) if warehouse.manufacture_pull_id:
pull_obj.write(cr, uid, warehouse.manufacture_pull_id.id, {'name': warehouse.manufacture_pull_id.name.replace(warehouse.name, name, 1)}, context=context)
return res return res
def _get_all_products_to_resupply(self, cr, uid, warehouse, context=None): def _get_all_products_to_resupply(self, cr, uid, warehouse, context=None):

View File

@ -130,7 +130,7 @@ class product_uom(osv.osv):
_order = "name" _order = "name"
_columns = { _columns = {
'name': fields.char('Unit of Measure', required=True, translate=True), 'name': fields.char('Unit of Measure', required=True, translate=True),
'category_id': fields.many2one('product.uom.categ', 'Category', required=True, ondelete='cascade', 'category_id': fields.many2one('product.uom.categ', 'Product Category', required=True, ondelete='cascade',
help="Conversion between Units of Measure can only occur if they belong to the same category. The conversion will be made based on the ratios."), help="Conversion between Units of Measure can only occur if they belong to the same category. The conversion will be made based on the ratios."),
'factor': fields.float('Ratio', required=True,digits=(12, 12), 'factor': fields.float('Ratio', required=True,digits=(12, 12),
help='How much bigger or smaller this unit is compared to the reference Unit of Measure for this category:\n'\ help='How much bigger or smaller this unit is compared to the reference Unit of Measure for this category:\n'\
@ -578,7 +578,7 @@ class product_product(osv.osv):
if context is None: if context is None:
context = {} context = {}
product = self.browse(cr, uid, product_id, context=context) product = self.browse(cr, uid, product_id, context=context)
date = context.get('history_date', time.strftime('%Y-%m-%d %H:%M:%s')) date = context.get('history_date', time.strftime('%Y-%m-%d %H:%M:%S'))
prices_history_obj = self.pool.get('prices.history') prices_history_obj = self.pool.get('prices.history')
history_ids = prices_history_obj.search(cr, uid, [('company_id', '=', company_id), ('product_template_id', '=', product.product_tmpl_id.id), ('datetime', '<=', date)], limit=1) history_ids = prices_history_obj.search(cr, uid, [('company_id', '=', company_id), ('product_template_id', '=', product.product_tmpl_id.id), ('datetime', '<=', date)], limit=1)
if history_ids: if history_ids:

View File

@ -148,11 +148,12 @@ class stock_warehouse(osv.osv):
break break
return res return res
def _handle_renaming(self, cr, uid, warehouse, name, context=None): def _handle_renaming(self, cr, uid, warehouse, name, code, context=None):
res = super(stock_warehouse, self)._handle_renaming(cr, uid, warehouse, name, context=context) res = super(stock_warehouse, self)._handle_renaming(cr, uid, warehouse, name, code, context=context)
pull_obj = self.pool.get('procurement.rule') pull_obj = self.pool.get('procurement.rule')
#change the buy pull rule name #change the buy pull rule name
pull_obj.write(cr, uid, warehouse.buy_pull_id.id, {'name': warehouse.buy_pull_id.name.replace(warehouse.name, name, 1)}, context=context) if warehouse.buy_pull_id:
pull_obj.write(cr, uid, warehouse.buy_pull_id.id, {'name': warehouse.buy_pull_id.name.replace(warehouse.name, name, 1)}, context=context)
return res return res
def change_route(self, cr, uid, ids, warehouse, new_reception_step=False, new_delivery_step=False, context=None): def change_route(self, cr, uid, ids, warehouse, new_reception_step=False, new_delivery_step=False, context=None):

View File

@ -30,17 +30,6 @@
</xpath> </xpath>
</field> </field>
</record> </record>
<record id="stock_location_route_tree_inherit" model="ir.ui.view">
<field name="name">stock.location.route.tree.inherit</field>
<field name="inherit_id" ref="stock.stock_location_route_tree"/>
<field name="model">stock.location.route</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='warehouse_selectable']" position="after">
<field name="sale_selectable"/>
</xpath>
</field>
</record>
</data> </data>
</openerp> </openerp>

View File

@ -82,6 +82,19 @@ class stock_location(osv.osv):
context_with_inactive['active_test'] = False context_with_inactive['active_test'] = False
return self.search(cr, uid, [('id', 'child_of', ids)], context=context_with_inactive) return self.search(cr, uid, [('id', 'child_of', ids)], context=context_with_inactive)
def _name_get(self, cr, uid, location, context=None):
name = location.name
while location.location_id and location.usage != 'view':
location = location.location_id
name = location.name + '/' + name
return name
def name_get(self, cr, uid, ids, context=None):
res = []
for location in self.browse(cr, uid, ids, context=context):
res.append((location.id, self._name_get(cr, uid, location, context=context)))
return res
_columns = { _columns = {
'name': fields.char('Location Name', size=64, required=True, translate=True), 'name': fields.char('Location Name', size=64, required=True, translate=True),
'active': fields.boolean('Active', help="By unchecking the active field, you may hide a location without deleting it."), 'active': fields.boolean('Active', help="By unchecking the active field, you may hide a location without deleting it."),
@ -2398,7 +2411,7 @@ class stock_warehouse(osv.osv):
_description = "Warehouse" _description = "Warehouse"
_columns = { _columns = {
'name': fields.char('Name', size=128, required=True, select=True), 'name': fields.char('Warehouse Name', size=128, required=True, select=True),
'company_id': fields.many2one('res.company', 'Company', required=True, select=True), 'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
'partner_id': fields.many2one('res.partner', 'Address'), 'partner_id': fields.many2one('res.partner', 'Address'),
'view_location_id': fields.many2one('stock.location', 'View Location', required=True, domain=[('usage', '=', 'view')]), 'view_location_id': fields.many2one('stock.location', 'View Location', required=True, domain=[('usage', '=', 'view')]),
@ -2756,7 +2769,7 @@ class stock_warehouse(osv.osv):
#create view location for warehouse #create view location for warehouse
wh_loc_id = location_obj.create(cr, uid, { wh_loc_id = location_obj.create(cr, uid, {
'name': _(vals.get('name')), 'name': _(vals.get('code')),
'usage': 'view', 'usage': 'view',
'location_id': data_obj.get_object_reference(cr, uid, 'stock', 'stock_location_locations')[1] 'location_id': data_obj.get_object_reference(cr, uid, 'stock', 'stock_location_locations')[1]
}, context=context) }, context=context)
@ -2913,14 +2926,14 @@ class stock_warehouse(osv.osv):
'pick_pack_ship': (_('Pick + Pack + Ship'), [(warehouse.lot_stock_id, warehouse.wh_pack_stock_loc_id, warehouse.pick_type_id.id), (warehouse.wh_pack_stock_loc_id, warehouse.wh_output_stock_loc_id, warehouse.pack_type_id.id), (warehouse.wh_output_stock_loc_id, customer_loc, warehouse.out_type_id.id)]), 'pick_pack_ship': (_('Pick + Pack + Ship'), [(warehouse.lot_stock_id, warehouse.wh_pack_stock_loc_id, warehouse.pick_type_id.id), (warehouse.wh_pack_stock_loc_id, warehouse.wh_output_stock_loc_id, warehouse.pack_type_id.id), (warehouse.wh_output_stock_loc_id, customer_loc, warehouse.out_type_id.id)]),
} }
def _handle_renaming(self, cr, uid, warehouse, name, context=None): def _handle_renaming(self, cr, uid, warehouse, name, code, context=None):
location_obj = self.pool.get('stock.location') location_obj = self.pool.get('stock.location')
route_obj = self.pool.get('stock.location.route') route_obj = self.pool.get('stock.location.route')
pull_obj = self.pool.get('procurement.rule') pull_obj = self.pool.get('procurement.rule')
push_obj = self.pool.get('stock.location.path') push_obj = self.pool.get('stock.location.path')
#rename location #rename location
location_id = warehouse.lot_stock_id.location_id.id location_id = warehouse.lot_stock_id.location_id.id
location_obj.write(cr, uid, location_id, {'name': name}, context=context) location_obj.write(cr, uid, location_id, {'name': code}, context=context)
#rename route and push-pull rules #rename route and push-pull rules
for route in warehouse.route_ids: for route in warehouse.route_ids:
route_obj.write(cr, uid, route.id, {'name': route.name.replace(warehouse.name, name, 1)}, context=context) route_obj.write(cr, uid, route.id, {'name': route.name.replace(warehouse.name, name, 1)}, context=context)
@ -2948,12 +2961,13 @@ class stock_warehouse(osv.osv):
self.switch_location(cr, uid, warehouse.id, warehouse, vals.get('reception_steps', False), vals.get('delivery_steps', False), context=context) self.switch_location(cr, uid, warehouse.id, warehouse, vals.get('reception_steps', False), vals.get('delivery_steps', False), context=context)
# switch between route # switch between route
self.change_route(cr, uid, ids, warehouse, vals.get('reception_steps', False), vals.get('delivery_steps', False), context=context_with_inactive) self.change_route(cr, uid, ids, warehouse, vals.get('reception_steps', False), vals.get('delivery_steps', False), context=context_with_inactive)
warehouse.refresh()
if vals.get('code') or vals.get('name'): if vals.get('code') or vals.get('name'):
name = warehouse.name name = warehouse.name
#rename sequence #rename sequence
if vals.get('name'): if vals.get('name'):
name = vals.get('name') name = vals.get('name', warehouse.name)
self._handle_renaming(cr, uid, warehouse, name, context=context_with_inactive) self._handle_renaming(cr, uid, warehouse, name, vals.get('code', warehouse.code), context=context_with_inactive)
seq_obj.write(cr, uid, warehouse.in_type_id.sequence_id.id, {'name': name + _(' Sequence in'), 'prefix': vals.get('code', warehouse.code) + '\IN\\'}, context=context) seq_obj.write(cr, uid, warehouse.in_type_id.sequence_id.id, {'name': name + _(' Sequence in'), 'prefix': vals.get('code', warehouse.code) + '\IN\\'}, context=context)
seq_obj.write(cr, uid, warehouse.out_type_id.sequence_id.id, {'name': name + _(' Sequence out'), 'prefix': vals.get('code', warehouse.code) + '\OUT\\'}, context=context) seq_obj.write(cr, uid, warehouse.out_type_id.sequence_id.id, {'name': name + _(' Sequence out'), 'prefix': vals.get('code', warehouse.code) + '\OUT\\'}, context=context)
seq_obj.write(cr, uid, warehouse.pack_type_id.sequence_id.id, {'name': name + _(' Sequence packing'), 'prefix': vals.get('code', warehouse.code) + '\PACK\\'}, context=context) seq_obj.write(cr, uid, warehouse.pack_type_id.sequence_id.id, {'name': name + _(' Sequence packing'), 'prefix': vals.get('code', warehouse.code) + '\PACK\\'}, context=context)
@ -3773,7 +3787,7 @@ class stock_picking_type(osv.osv):
return res and res[0] or False return res and res[0] or False
_columns = { _columns = {
'name': fields.char('Name', translate=True, required=True), 'name': fields.char('Picking Type Name', translate=True, required=True),
'complete_name': fields.function(_get_name, type='char', string='Name'), 'complete_name': fields.function(_get_name, type='char', string='Name'),
'auto_force_assign': fields.boolean('Automatic Availability', help='This picking type does\'t need to check for the availability in source location.'), 'auto_force_assign': fields.boolean('Automatic Availability', help='This picking type does\'t need to check for the availability in source location.'),
'color': fields.integer('Color'), 'color': fields.integer('Color'),

View File

@ -585,16 +585,6 @@
<menuitem action="action_location_form" id="menu_action_location_form" groups="stock.group_locations" <menuitem action="action_location_form" id="menu_action_location_form" groups="stock.group_locations"
parent="menu_stock_configuration" sequence="5"/> parent="menu_stock_configuration" sequence="5"/>
<record id="view_location_tree" model="ir.ui.view">
<field name="name">stock.location.tree</field>
<field name="model">stock.location</field>
<field name="field_parent">child_ids</field>
<field name="arch" type="xml">
<tree toolbar="1" string="Locations" >
<field name="name"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_product_location_tree"> <record model="ir.actions.act_window" id="action_product_location_tree">
<field name="context">{'product_id': active_id}</field> <field name="context">{'product_id': active_id}</field>
<field name="name">Stock by Location</field> <field name="name">Stock by Location</field>
@ -605,29 +595,6 @@
<field name="name">Moves</field> <field name="name">Moves</field>
<field name="res_model">stock.move</field> <field name="res_model">stock.move</field>
</record> </record>
<record id="action_location_tree" model="ir.actions.act_window">
<field name="name">Inventory by Location</field>
<field name="res_model">stock.location</field>
<field name="type">ir.actions.act_window</field>
<field name="domain">[('location_id','=',False)]</field>
<field name="view_type">tree</field>
<field name="view_id" ref="view_location_tree"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a location.
</p><p>
This is the structure of your company's warehouses and
locations. You can click on a location to get the list of the
products and their stock level in this particular location and
all its children.
</p>
</field>
</record>
<menuitem action="action_location_tree"
id="menu_action_location_tree"
parent="menu_stock_inventory_control"
groups="stock.group_locations"
sequence="20"/>
<record id="view_warehouse" model="ir.ui.view"> <record id="view_warehouse" model="ir.ui.view">
<field name="name">stock.warehouse</field> <field name="name">stock.warehouse</field>
@ -816,11 +783,10 @@
<field name="note" placeholder="Add an internal note..." class="oe_inline"/> <field name="note" placeholder="Add an internal note..." class="oe_inline"/>
</page> </page>
<page string="Additional Info"> <page string="Additional Info">
<group> <group string="General Informations">
<group> <group>
<field name="move_type"/> <field name="move_type"/>
<field name="picking_type_id"/> <field name="picking_type_id"/>
<field name="priority"/>
<field name="picking_type_code" invisible="1"/> <field name="picking_type_code" invisible="1"/>
<field name="quant_reserved_exist" invisible="1"/> <field name="quant_reserved_exist" invisible="1"/>
</group> </group>
@ -828,6 +794,7 @@
<field name="company_id" groups="base.group_multi_company" widget="selection"/> <field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="date_done" groups="base.group_no_one"/> <field name="date_done" groups="base.group_no_one"/>
<field name="group_id"/> <field name="group_id"/>
<field name="priority"/>
</group> </group>
</group> </group>
</page> </page>
@ -1016,6 +983,18 @@
</field> </field>
</record> </record>
<record id="view_move_graph" model="ir.ui.view">
<field name="name">stock.move.graph</field>
<field name="model">stock.move</field>
<field name="arch" type="xml">
<graph string="Stock Moves Analysis" type="pivot">
<field name="product_id" type="row"/>
<field name="location_dest_id" groups="stock.group_locations" type="row"/>
<field name="product_uom_qty" type="measure"/>
</graph>
</field>
</record>
<record id="view_move_tree" model="ir.ui.view"> <record id="view_move_tree" model="ir.ui.view">
<field name="name">stock.move.tree</field> <field name="name">stock.move.tree</field>
<field name="model">stock.move</field> <field name="model">stock.move</field>
@ -1254,6 +1233,13 @@
<field name="act_window_id" ref="action_move_form2"/> <field name="act_window_id" ref="action_move_form2"/>
</record> </record>
<record model="ir.actions.act_window.view" id="action_stock_move_graph_all">
<field name="sequence" eval="3"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_move_graph"/>
<field name="act_window_id" ref="action_move_form2"/>
</record>
<menuitem action="action_move_form2" id="menu_action_move_form2" parent="menu_traceability" sequence="3" groups="stock.group_locations"/> <menuitem action="action_move_form2" id="menu_action_move_form2" parent="menu_traceability" sequence="3" groups="stock.group_locations"/>
<record id="action_stock_stock_ui" model="ir.actions.client"> <record id="action_stock_stock_ui" model="ir.actions.client">
@ -2069,9 +2055,6 @@
<tree string="Routes"> <tree string="Routes">
<field name="sequence" widget="handle" /> <field name="sequence" widget="handle" />
<field name="name"/> <field name="name"/>
<field name="product_selectable"/>
<field name="product_categ_selectable"/>
<field name="warehouse_selectable"/>
</tree> </tree>
</field> </field>
</record> </record>
@ -2090,10 +2073,10 @@
<group> <group>
<group> <group>
<field name="company_id" groups="base.group_multi_company" widget="selection"/> <field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="sequence" string="Sequence" groups="base.group_no_one"/> <field name="active" groups="stock.group_adv_location" />
</group> </group>
<group> <group>
<field name="active" groups="stock.group_adv_location" /> <field name="sequence" string="Sequence" groups="base.group_no_one"/>
</group> </group>
</group> </group>
<separator string="Applicable On"/> <separator string="Applicable On"/>

View File

@ -7,8 +7,7 @@
<field name="name">Scrap Move</field> <field name="name">Scrap Move</field>
<field name="model">stock.move.scrap</field> <field name="model">stock.move.scrap</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Scrap Move" version="7.0"> <form string="Scrap Products" version="7.0">
<separator string="Scrap Products"/>
<group> <group>
<field name="product_id" readonly="1"/> <field name="product_id" readonly="1"/>
<label for="product_qty"/> <label for="product_qty"/>
@ -22,7 +21,7 @@
domain="[('usage','!=','view'),('scrap_location','=',True)]" groups="stock.group_locations"/> domain="[('usage','!=','view'),('scrap_location','=',True)]" groups="stock.group_locations"/>
</group> </group>
<footer> <footer>
<button name="move_scrap" string="Ok" type="object" class="oe_highlight" /> <button name="move_scrap" string="Scrap" type="object" class="oe_highlight" />
or or
<button string="Cancel" class="oe_link" special="cancel" /> <button string="Cancel" class="oe_link" special="cancel" />
</footer> </footer>

View File

@ -8,10 +8,12 @@ class wizard_valuation_history(osv.osv_memory):
_name = 'wizard.valuation.history' _name = 'wizard.valuation.history'
_description = 'Wizard that opens the stock valuation history table' _description = 'Wizard that opens the stock valuation history table'
_columns = { _columns = {
'choose_date': fields.boolean('Choose a Particular Date'),
'date': fields.datetime('Date', required=True), 'date': fields.datetime('Date', required=True),
} }
_defaults = { _defaults = {
'choose_date': False,
'date': fields.datetime.now, 'date': fields.datetime.now,
} }
@ -27,7 +29,7 @@ class wizard_valuation_history(osv.osv_memory):
'domain': "[('date', '<=', '" + data['date'] + "')]", 'domain': "[('date', '<=', '" + data['date'] + "')]",
'name': _('Stock Value At Date'), 'name': _('Stock Value At Date'),
'view_type': 'form', 'view_type': 'form',
'view_mode': 'tree', 'view_mode': 'tree, graph',
'res_model': 'stock.history', 'res_model': 'stock.history',
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'context': ctx, 'context': ctx,
@ -68,7 +70,7 @@ class stock_history(osv.osv):
'location_id': fields.many2one('stock.location', 'Location', required=True), 'location_id': fields.many2one('stock.location', 'Location', required=True),
'product_id': fields.many2one('product.product', 'Product', required=True), 'product_id': fields.many2one('product.product', 'Product', required=True),
'product_categ_id': fields.many2one('product.category', 'Product Category', required=True), 'product_categ_id': fields.many2one('product.category', 'Product Category', required=True),
'quantity': fields.integer('Quantity'), 'quantity': fields.integer('Product Quantity'),
'date': fields.datetime('Operation Date'), 'date': fields.datetime('Operation Date'),
'price_unit_on_quant': fields.float('Value'), 'price_unit_on_quant': fields.float('Value'),
'cost_method': fields.char('Cost Method'), 'cost_method': fields.char('Cost Method'),

View File

@ -7,14 +7,18 @@
<field name="model">wizard.valuation.history</field> <field name="model">wizard.valuation.history</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Choose your date" version="7.0"> <form string="Choose your date" version="7.0">
<p class="oe_gray"> <p class="oe_gray" attrs="{'invisible': [('choose_date', '=', False)]}">
Choose the date for wich you want to get the stock valuation of your products. Choose the date for wich you want to get the stock valuation of your products.
This will filter the stock operation that weren't done at the selected date, to retreive the quantity This will filter the stock operation that weren't done at the selected date, to retreive the quantity
you had, and gives you the inventory value according to the standard price used at that time. you had, and gives you the inventory value according to the standard price used at that time.
</p> </p>
<p class="oe_gray" attrs="{'invisible': [('choose_date', '=', True)]}">
Retrieve the stock valuation of your products at current day
</p>
<group> <group>
<field name="date"/> <field name="choose_date"/>
<field name="date" attrs="{'invisible': [('choose_date', '=', False)]}"/>
</group> </group>
<footer> <footer>
<button name="open_table" string="Retrieve the Inventory Value" type="object" class="oe_highlight" /> <button name="open_table" string="Retrieve the Inventory Value" type="object" class="oe_highlight" />
@ -49,6 +53,18 @@
</tree> </tree>
</field> </field>
</record> </record>
<record id="view_stock_history_report_graph" model="ir.ui.view">
<field name="name">stock.history.value.graph</field>
<field name="model">stock.history</field>
<field name="arch" type="xml">
<graph string="Stock Value At Date" type="pivot">
<field name="product_id" type="row"/>
<field name="inventory_value" type="measure"/>
<field name="quantity" type="measure"/>
<field name="location_id" type="row"/>
</graph>
</field>
</record>
<record id="view_stock_history_report_search" model="ir.ui.view"> <record id="view_stock_history_report_search" model="ir.ui.view">
<field name="name">stock.history.report.search</field> <field name="name">stock.history.report.search</field>
<field name="model">stock.history</field> <field name="model">stock.history</field>
@ -67,6 +83,21 @@
</search> </search>
</field> </field>
</record> </record>
<record id="action_history_tree" model="ir.actions.act_window">
<field name="name">Current Inventory Valuation</field>
<field name="res_model">stock.history</field>
<field name="type">ir.actions.act_window</field>
<field name="domain">[('date','&lt;=',time.strftime('%Y-%m-%d %H:%M:%S'))]</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="view_id" ref="view_stock_history_report_tree"/>
</record>
<menuitem action="action_history_tree"
id="menu_action_history_tree"
parent="stock.menu_stock_inventory_control"
groups="stock.group_locations"
sequence="20"/>
</data> </data>
</openerp> </openerp>

View File

@ -6,13 +6,10 @@ class stock_picking_wave(osv.osv):
_name = "stock.picking.wave" _name = "stock.picking.wave"
_order = "name desc" _order = "name desc"
_columns = { _columns = {
'name': fields.char('name', required=True, help='Name of the picking wave'), 'name': fields.char('Picking Wave Name', required=True, help='Name of the picking wave'),
'user_id': fields.many2one('res.users', 'Responsible', help='Person responsible for this wave'), 'user_id': fields.many2one('res.users', 'Responsible', help='Person responsible for this wave'),
'time': fields.float('Time', help='Time it will take to perform the wave'),
'picking_ids': fields.one2many('stock.picking', 'wave_id', 'Pickings', help='List of picking associated to this wave'), 'picking_ids': fields.one2many('stock.picking', 'wave_id', 'Pickings', help='List of picking associated to this wave'),
'capacity': fields.float('Capacity', help='The capacity of the transport used to get the goods'), 'state': fields.selection([('draft', 'Draft'), ('in_progress', 'Running'), ('done', 'Done'), ('cancel', 'Cancelled')], string="State", required=True),
'capacity_uom': fields.many2one('product.uom', 'Unit of Measure', help='The Unity Of Measure of the transport capacity'),
'state': fields.selection([('draft', 'Draft'), ('in_progress', 'Running'), ('done', 'Done'), ('cancel', 'Cancelled')], required=True),
} }
_defaults = { _defaults = {

View File

@ -6,15 +6,11 @@
--> -->
<record id="stock_picking_wave_dry_1" model="stock.picking.wave"> <record id="stock_picking_wave_dry_1" model="stock.picking.wave">
<field name="name">Picking Dry for John</field> <field name="name">Picking Dry for John</field>
<field name="capacity">15</field>
<field name="capacity_uom" ref="product.product_uom_ton" />
<field name="state">in_progress</field> <field name="state">in_progress</field>
</record> </record>
<record id="stock_picking_wave_freeze_1" model="stock.picking.wave"> <record id="stock_picking_wave_freeze_1" model="stock.picking.wave">
<field name="name">Picking Freeze for Mickael</field> <field name="name">Picking Freeze for Mickael</field>
<field name="capacity">600</field>
<field name="capacity_uom" ref="product.product_uom_kgm" />
<field name="state">in_progress</field> <field name="state">in_progress</field>
</record> </record>

View File

@ -21,17 +21,7 @@
</h1> </h1>
</div> </div>
<group> <group>
<group> <field name="user_id"/>
<field name="user_id"/>
</group>
<group>
<label for="capacity"/>
<div>
<field name="capacity" class="oe_inline"/>
<field name="capacity_uom" class="oe_inline"/>
</div>
<field name="time" widget="float_time"/>
</group>
</group> </group>
<separator string="Pickings"/> <separator string="Pickings"/>
<field name="picking_ids" widget="many2many" domain="[('state', 'not in', ('done', 'cancel'))]"> <field name="picking_ids" widget="many2many" domain="[('state', 'not in', ('done', 'cancel'))]">
@ -60,9 +50,6 @@
<tree string="Stock Picking Waves" colors="black:state in ('in_progress','done');grey: state=='cancel'"> <tree string="Stock Picking Waves" colors="black:state in ('in_progress','done');grey: state=='cancel'">
<field name="name"/> <field name="name"/>
<field name="user_id"/> <field name="user_id"/>
<field name="capacity"/>
<field name="capacity_uom"/>
<field name="time" widget="float_time"/>
<field name="state"/> <field name="state"/>
</tree> </tree>
</field> </field>