[IMP] Improve and fix according to review FP
bzr revid: jke@openerp.com-20131105161517-zm1ks2m8fkcf7v7i
This commit is contained in:
parent
473d530b3e
commit
5308a926d2
|
@ -127,7 +127,8 @@ class procurement_order(osv.osv):
|
|||
('running', 'Running'),
|
||||
('done', 'Done')
|
||||
], 'Status', required=True, track_visibility='onchange'),
|
||||
'message': fields.text('Latest error', help="Exception occurred while computing procurement orders.", track_visibility='onchange'),
|
||||
# TODO REMOVE IF NO IMPACT
|
||||
#'message': fields.text('Latest error', help="Exception occurred while computing procurement orders.", track_visibility='onchange'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
|
|
@ -51,13 +51,11 @@
|
|||
</group>
|
||||
<newline/>
|
||||
<group>
|
||||
<field name="rule_id"/>
|
||||
<field name="date_planned"/>
|
||||
<field name="priority"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="group_id"/>
|
||||
<field name="origin" class="oe_inline" placeholder="e.g. SO005"/>
|
||||
</group>
|
||||
</group>
|
||||
|
@ -65,8 +63,12 @@
|
|||
<page string="Extra Information">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<field name="name" placeholder="External note..."/>
|
||||
<label for="message" class="oe_edit_only"/>
|
||||
<field name="message"/>
|
||||
<!--<label for="message" class="oe_edit_only"/>
|
||||
<field name="message"/> -->
|
||||
</page>
|
||||
<page string="Advanced Information" name="adv_info">
|
||||
<field name="group_id"/>
|
||||
<field name="rule_id"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
@ -137,12 +139,14 @@
|
|||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a procurement order.
|
||||
</p><p>
|
||||
A procurement order is used to record a need for a specific
|
||||
</p>
|
||||
<p>
|
||||
A <b>procurement order</b> is used to record a need for a specific
|
||||
product at a specific location. Procurement orders are usually
|
||||
created automatically from sales orders, pull logistic rules or
|
||||
minimum stock rules.
|
||||
</p><p>
|
||||
created automatically from <i>sales orders, pull logistic rules or
|
||||
minimum stock rules.</i>
|
||||
</p>
|
||||
<p>
|
||||
When the procurement order is confirmed, it automatically
|
||||
creates the necessary operations to fullfil the need: purchase
|
||||
order proposition, manufacturing order, etc.
|
||||
|
@ -159,8 +163,18 @@
|
|||
<field name="context">{}</field>
|
||||
<field name="search_view_id" ref="view_procurement_filter"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a Procurement.
|
||||
</p>
|
||||
<p>
|
||||
Procurement Orders represent the need for a certain quantity of products, at a given time, in a given location. Sales Orders are one typical source of Procurement Orders (but these are distinct documents). Depending on the procurement parameters and the product configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, ordering products from a supplier, or passing a manufacturing order, etc. A Procurement Exception occurs when the system cannot find a way to fulfill a procurement. Some exceptions will resolve themselves automatically, but others require manual intervention (those are identified by a specific error message).
|
||||
<b>Procurement Orders</b> represent the need for a certain quantity of products, at a given time, in a given location.
|
||||
</p>
|
||||
<p>
|
||||
<b>Sales Orders</b> are one typical source of Procurement Orders (but these are distinct documents).
|
||||
<br/>Depending on the procurement parameters and the product configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, ordering products from a supplier, or passing a manufacturing order, etc...
|
||||
</p>
|
||||
<p>
|
||||
A <b>Procurement Exception</b> occurs when the system cannot find a way to fulfill a procurement. Some exceptions will resolve themselves automatically, but others require manual intervention (those are identified by a specific error message in the chatter).
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -384,11 +384,20 @@
|
|||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="context">{'categ_id':active_id, 'search_default_categ_id':active_id}</field>
|
||||
</record>
|
||||
|
||||
<record id="product_category_action_tree" model="ir.actions.act_window">
|
||||
<field name="name">Products</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.product</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="context">{'categ_id':active_id, 'search_default_categ_id':active_id}</field>
|
||||
</record>
|
||||
<record id="ir_product_category_open" model="ir.values">
|
||||
<field eval="'tree_but_open'" name="key2"/>
|
||||
<field eval="'product.category'" name="model"/>
|
||||
<field name="name">Products by Categories</field>
|
||||
<field eval="'ir.actions.act_window,%d'%product_normal_action_tree" name="value"/>
|
||||
<field eval="'ir.actions.act_window,%d'%product_category_action_tree" name="value"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
|
|
@ -443,5 +443,5 @@ class stock_move(osv.osv):
|
|||
class stock_location_route(osv.osv):
|
||||
_inherit = "stock.location.route"
|
||||
_columns = {
|
||||
'sale_selectable':fields.boolean("Selectable on Sales Order Line")
|
||||
'sale_selectable':fields.boolean("Applicable on Sales Order Line")
|
||||
}
|
||||
|
|
|
@ -378,9 +378,10 @@ class procurement_order(osv.osv):
|
|||
if qty <= 0:
|
||||
continue
|
||||
if op.product_id.type not in ('consu'):
|
||||
if op.procurement_draft_ids:
|
||||
procurement_draft_ids = orderpoint_obj.get_draft_procurements(cr,uid,op.id,context=context)
|
||||
if procurement_draft_ids:
|
||||
# Check draft procurement related to this order point
|
||||
pro_ids = [x.id for x in op.procurement_draft_ids]
|
||||
pro_ids = [x.id for x in procurement_draft_ids]
|
||||
procure_datas = procurement_obj.read(
|
||||
cr, uid, pro_ids, ['id', 'product_qty'], context=context)
|
||||
to_generate = qty
|
||||
|
|
|
@ -172,9 +172,9 @@ class stock_location_route(osv.osv):
|
|||
'pull_ids': fields.one2many('procurement.rule', 'route_id', 'Pull Rules'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the route without removing it."),
|
||||
'push_ids': fields.one2many('stock.location.path', 'route_id', 'Push Rules'),
|
||||
'product_selectable': fields.boolean('Selectable on Product'),
|
||||
'product_categ_selectable': fields.boolean('Selectable on Product Category'),
|
||||
'warehouse_selectable': fields.boolean('Selectable on Warehouse'),
|
||||
'product_selectable': fields.boolean('Applicable on Product'),
|
||||
'product_categ_selectable': fields.boolean('Applicable on Product Category'),
|
||||
'warehouse_selectable': fields.boolean('Applicable on Warehouse'),
|
||||
'supplied_wh_id': fields.many2one('stock.warehouse', 'Supplied Warehouse'),
|
||||
'supplier_wh_id': fields.many2one('stock.warehouse', 'Supplier Warehouse'),
|
||||
}
|
||||
|
@ -1947,6 +1947,44 @@ class stock_inventory(osv.osv):
|
|||
res[inv.id] = True
|
||||
return res
|
||||
|
||||
def _getFilter(self,cr,uid,context=None):
|
||||
"""
|
||||
This function will return the list of filter allowed according to
|
||||
the option checked in Configuration -> Warehouse
|
||||
|
||||
It replace the older selection field 'filter' :
|
||||
'filter': fields.selection(
|
||||
[('product', 'Product'), ('owner', 'Owner'),
|
||||
('product_owner','Product & Owner'),
|
||||
('lot','Lot/Serial Number'), ('pack','Pack'), ('none', 'None')]
|
||||
, 'Selection Filter'),
|
||||
|
||||
@return: List of tuple for a field of type selecttion
|
||||
"""
|
||||
res_filter = [
|
||||
('none', ' All products of a whole location'),
|
||||
('product', 'One product only'),
|
||||
]
|
||||
|
||||
obj_set = self.pool.get('stock.config.settings')
|
||||
config_browse = obj_set.search(cr,uid,[],limit=1, order='id DESC',context=context);
|
||||
|
||||
#If we don't have updated config until now, all fields are by defaut false and so should be not dipslay
|
||||
if not config_browse:
|
||||
return res_filter
|
||||
|
||||
group_rights = obj_set.browse(cr,uid,config_browse[0],context=context);
|
||||
|
||||
if group_rights.group_stock_tracking_owner:
|
||||
res_filter.append(('owner', 'One owner only'))
|
||||
res_filter.append(('product_owner','One product for a specific owner'))
|
||||
if group_rights.group_stock_production_lot:
|
||||
res_filter.append(('lot','One Lot/Serial Number'))
|
||||
if group_rights.group_stock_tracking_lot:
|
||||
res_filter.append(('pack','A Pack'))
|
||||
|
||||
return res_filter
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Inventory Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Name."),
|
||||
'date': fields.datetime('Inventory Date', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Create Date."),
|
||||
|
@ -1961,7 +1999,7 @@ class stock_inventory(osv.osv):
|
|||
'partner_id': fields.many2one('res.partner', 'Owner', readonly=True, states={'draft': [('readonly', False)]}, help="Specify Owner to focus your inventory on a particular Owner."),
|
||||
'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number', readonly=True, states={'draft': [('readonly', False)]}, help="Specify Lot/Serial Number to focus your inventory on a particular Lot/Serial Number."),
|
||||
'move_ids_exist': fields.function(_get_move_ids_exist, type='boolean', string=' Stock Move Exists?', help='technical field for attrs in view'),
|
||||
'filter': fields.selection([('product', 'Product'), ('owner', 'Owner'), ('product_owner','Product & Owner'), ('lot','Lot/Serial Number'), ('pack','Pack'), ('none', 'None')], 'Selection Filter'),
|
||||
'filter': fields.selection(_getFilter, 'Selection Filter'),
|
||||
}
|
||||
|
||||
def _default_stock_location(self, cr, uid, context=None):
|
||||
|
@ -2238,6 +2276,11 @@ class stock_warehouse(osv.osv):
|
|||
'resupply_wh_ids': fields.many2many('stock.warehouse', 'stock_wh_resupply_table', 'supplied_wh_id', 'supplier_wh_id', 'Resupply Warehouses'),
|
||||
'resupply_route_ids': fields.one2many('stock.location.route', 'supplied_wh_id', 'Resupply Routes'),
|
||||
'default_resupply_wh_id': fields.many2one('stock.warehouse', 'Default Resupply Warehouse'),
|
||||
'color': fields.selection([
|
||||
(0,'White'),(1,'Gray'),(2,'Red'),
|
||||
(3,'Yellow'), (4,'Spring green'), (5,'Green'),
|
||||
(6,'Aqua'), (7,'Blue'), (8,'Violet'), (9,'Pink'),
|
||||
]),
|
||||
}
|
||||
|
||||
def onchange_filter_default_resupply_wh_id(self, cr, uid, ids, default_resupply_wh_id, resupply_wh_ids, context=None):
|
||||
|
@ -2305,11 +2348,21 @@ class stock_warehouse(osv.osv):
|
|||
except:
|
||||
return False
|
||||
|
||||
def _default_color(self,cr,uid,context=None):
|
||||
all_used_colors = self.search_read(cr, uid, [('color','!=',False)], ['color'], order='color')
|
||||
if not len(all_used_colors):
|
||||
return 0
|
||||
not_used_colors = list(set(range(1, 10)) - set([x['color'] for x in all_used_colors]))
|
||||
#Rem : if not_used_colors[0] == 0 ==> return XXX from "or XXX"
|
||||
color = not_used_colors and not_used_colors[0] or 1
|
||||
return color
|
||||
|
||||
_defaults = {
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c),
|
||||
'lot_stock_id': _default_stock_id,
|
||||
'reception_steps': 'one_step',
|
||||
'delivery_steps': 'ship_only',
|
||||
'color': _default_color,
|
||||
}
|
||||
_sql_constraints = [
|
||||
('warehouse_name_uniq', 'unique(name, company_id)', 'The name of the warehouse must be unique per company!'),
|
||||
|
@ -2396,7 +2449,7 @@ class stock_warehouse(osv.osv):
|
|||
try:
|
||||
mto_route_id = data_obj.get_object_reference(cr, uid, 'stock', 'route_warehouse0_mto')[1]
|
||||
except:
|
||||
mto_route_id = route_obj.search(cr, uid, [('name', 'like', _('MTO'))], context=context)
|
||||
mto_route_id = route_obj.search(cr, uid, ['|',('name', 'like', _('MTO')),('name', 'like', _('Buy/Product on Order'))], context=context)
|
||||
mto_route_id = mto_route_id and mto_route_id[0] or False
|
||||
if not mto_route_id:
|
||||
raise osv.except_osv(_('Error!'), _('Can\'t find any generic MTO route.'))
|
||||
|
@ -2549,8 +2602,9 @@ class stock_warehouse(osv.osv):
|
|||
}, context=context)
|
||||
vals['view_location_id'] = wh_loc_id
|
||||
#create all location
|
||||
reception_steps = vals.get('reception_steps', False)
|
||||
delivery_steps = vals.get('delivery_steps', False)
|
||||
def_values = self.default_get(cr,uid,{'reception_steps','delivery_steps'})
|
||||
reception_steps = vals.get('reception_steps', def_values['reception_steps'])
|
||||
delivery_steps = vals.get('delivery_steps', def_values['delivery_steps'])
|
||||
context_with_inactive = context.copy()
|
||||
context_with_inactive['active_test'] = False
|
||||
sub_locations = [
|
||||
|
@ -2589,17 +2643,15 @@ class stock_warehouse(osv.osv):
|
|||
customer_loc, supplier_loc = self._get_partner_locations(cr, uid, new_id, context=context)
|
||||
|
||||
#create in, out, internal picking types for warehouse
|
||||
input_loc = wh_input_stock_loc
|
||||
if warehouse.reception_steps == 'one_step':
|
||||
input_loc = wh_stock_loc
|
||||
output_loc = wh_output_stock_loc
|
||||
else:
|
||||
input_loc = wh_input_stock_loc
|
||||
|
||||
if warehouse.delivery_steps == 'ship_only':
|
||||
output_loc = wh_stock_loc
|
||||
|
||||
#choose the next available color for the picking types of this warehouse
|
||||
all_used_colors = self.pool.get('stock.picking.type').search_read(cr, uid, [('warehouse_id', '!=', False), ('color', '!=', False)], ['color'], order='color')
|
||||
not_used_colors = list(set(range(1, 10)) - set([x['color'] for x in all_used_colors]))
|
||||
color = not_used_colors and not_used_colors[0] or 1
|
||||
else:
|
||||
output_loc = wh_output_stock_loc
|
||||
|
||||
in_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Receptions'),
|
||||
|
@ -2609,7 +2661,7 @@ class stock_warehouse(osv.osv):
|
|||
'sequence_id': in_seq_id,
|
||||
'default_location_src_id': supplier_loc.id,
|
||||
'default_location_dest_id': input_loc.id,
|
||||
'color': color}, context=context)
|
||||
}, context=context)
|
||||
out_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Delivery Orders'),
|
||||
'warehouse_id': new_id,
|
||||
|
@ -2618,7 +2670,7 @@ class stock_warehouse(osv.osv):
|
|||
'delivery': True,
|
||||
'default_location_src_id': output_loc.id,
|
||||
'default_location_dest_id': customer_loc.id,
|
||||
'color': color}, context=context)
|
||||
}, context=context)
|
||||
int_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Internal Transfers'),
|
||||
'warehouse_id': new_id,
|
||||
|
@ -2628,7 +2680,7 @@ class stock_warehouse(osv.osv):
|
|||
'default_location_dest_id': wh_stock_loc.id,
|
||||
'active': reception_steps != 'one_step',
|
||||
'pack': False,
|
||||
'color': color}, context=context)
|
||||
}, context=context)
|
||||
pack_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Pack'),
|
||||
'warehouse_id': new_id,
|
||||
|
@ -2638,7 +2690,7 @@ class stock_warehouse(osv.osv):
|
|||
'default_location_dest_id': output_loc.id,
|
||||
'active': delivery_steps == 'pick_pack_ship',
|
||||
'pack': True,
|
||||
'color': color}, context=context)
|
||||
}, context=context)
|
||||
pick_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Pick'),
|
||||
'warehouse_id': new_id,
|
||||
|
@ -2648,7 +2700,7 @@ class stock_warehouse(osv.osv):
|
|||
'default_location_dest_id': wh_pack_stock_loc.id,
|
||||
'active': delivery_steps != 'ship_only',
|
||||
'pack': False,
|
||||
'color': color}, context=context)
|
||||
}, context=context)
|
||||
|
||||
#write picking types on WH
|
||||
vals = {
|
||||
|
@ -3034,6 +3086,8 @@ class stock_package(osv.osv):
|
|||
res['domain'] = [('id', 'in', quants_ids)]
|
||||
return res
|
||||
|
||||
|
||||
|
||||
def _get_product_total_qty(self, cr, uid, package_record, product_id, context=None):
|
||||
''' find the total of given product 'product_id' inside the given package 'package_id'''
|
||||
quant_obj = self.pool.get('stock.quant')
|
||||
|
@ -3147,15 +3201,14 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
_name = "stock.warehouse.orderpoint"
|
||||
_description = "Minimum Inventory Rule"
|
||||
|
||||
def _get_draft_procurements(self, cr, uid, ids, field_name, arg, context=None):
|
||||
def get_draft_procurements(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
result = {}
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
for orderpoint in self.browse(cr, uid, ids, context=context):
|
||||
procurement_ids = procurement_obj.search(cr, uid, [('state', '=', 'draft'), ('product_id', '=', orderpoint.product_id.id), ('location_id', '=', orderpoint.location_id.id)])
|
||||
result[orderpoint.id] = procurement_ids
|
||||
return result
|
||||
procurement_ids = procurement_obj.search(cr, uid, [('state', '=', 'draft'), ('product_id', '=', orderpoint.product_id.id), ('location_id', '=', orderpoint.location_id.id)],context=context)
|
||||
return procurement_ids
|
||||
|
||||
def _check_product_uom(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
|
@ -3170,6 +3223,17 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
|
||||
return True
|
||||
|
||||
def action_view_po_to_process(self, cr, uid, ids, context=None):
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
draft_ids = set([r for r in self.get_draft_procurements(cr, uid, ids, context=context)])
|
||||
result = mod_obj.get_object_reference(cr, uid, 'procurement', 'do_view_procurements')
|
||||
id = result and result[1] or False
|
||||
|
||||
result = act_obj.read(cr, uid, [id], context=context)[0]
|
||||
result['domain'] = "[('id','in',[" + ','.join(map(str, draft_ids)) + "])]"
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=32, required=True),
|
||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the orderpoint without removing it."),
|
||||
|
@ -3187,9 +3251,7 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
'qty_multiple': fields.integer('Qty Multiple', required=True,
|
||||
help="The procurement quantity will be rounded up to this multiple."),
|
||||
'procurement_id': fields.many2one('procurement.order', 'Latest procurement', ondelete="set null"),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'procurement_draft_ids': fields.function(_get_draft_procurements, type='many2many', relation="procurement.order", \
|
||||
string="Related Procurement Orders", help="Draft procurement of the product and location of that orderpoint"),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True)
|
||||
}
|
||||
_defaults = {
|
||||
'active': lambda *a: 1,
|
||||
|
@ -3397,7 +3459,8 @@ class stock_picking_type(osv.osv):
|
|||
'complete_name': fields.function(_get_name, type='char', string='Name'),
|
||||
'pack': fields.boolean('Prefill Pack Operations', help='This picking type needs packing interface'),
|
||||
'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 Index'),
|
||||
'color': fields.related('warehouse_id', 'color', type='integer', string='Color Index'),
|
||||
|
||||
'delivery': fields.boolean('Print delivery'),
|
||||
'sequence_id': fields.many2one('ir.sequence', 'Sequence', required=True),
|
||||
'default_location_src_id': fields.many2one('stock.location', 'Default Source Location'),
|
||||
|
@ -3405,7 +3468,7 @@ class stock_picking_type(osv.osv):
|
|||
#TODO: change field name to "code" as it's not a many2one anymore
|
||||
'code_id': fields.selection([('incoming', 'Suppliers'), ('outgoing', 'Customers'), ('internal', 'Internal')], 'Picking type code', required=True),
|
||||
'return_picking_type_id': fields.many2one('stock.picking.type', 'Picking Type for Returns'),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse',ondelete='cascade'),
|
||||
'active': fields.boolean('Active'),
|
||||
|
||||
# Statistics for the kanban view
|
||||
|
|
|
@ -96,7 +96,7 @@ watch your stock valuation, and track production lots upstream and downstream (b
|
|||
-->
|
||||
|
||||
<record id="route_warehouse0_mto" model='stock.location.route'>
|
||||
<field name="name">MTO</field>
|
||||
<field name="name">Buy/Product on Order</field>
|
||||
<field name="sequence">10</field>
|
||||
</record>
|
||||
|
||||
|
@ -139,10 +139,8 @@ watch your stock valuation, and track production lots upstream and downstream (b
|
|||
Resource: stock.warehouse
|
||||
-->
|
||||
|
||||
|
||||
<record id="warehouse0" model="stock.warehouse">
|
||||
<field model="res.company" name="name" search="[]" use="name"/>
|
||||
|
||||
<field name="code">WH</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<menuitem id="menu_stock_warehouse_mgmt" name="Operations" parent="menu_stock_root" sequence="1"/>
|
||||
<menuitem id="menu_stock_product" name="Products" parent="menu_stock_root" sequence="6"/>
|
||||
<menuitem name="Products by Category" id="menu_product_by_category_stock_form" action="product.product_category_action"
|
||||
parent="stock.menu_stock_product" sequence="0"/>
|
||||
parent="stock.menu_stock_product" sequence="0" groups="base.group_no_one"/>
|
||||
<menuitem action="product.product_normal_action" id="menu_stock_products_menu" parent="menu_stock_product" sequence="1"/>
|
||||
<menuitem id="menu_stock_configuration" name="Configuration" parent="menu_stock_root" sequence="15" groups="group_stock_manager"/>
|
||||
<menuitem id="menu_warehouse_config" name="Warehouse Management" parent="menu_stock_configuration" sequence="40" groups="base.group_no_one"/>
|
||||
|
@ -122,7 +122,6 @@
|
|||
</group>
|
||||
<div class="oe_grey" colspan="4">Specify filters to focus your inventory a on particular product, lot, pack and product's owner.</div>
|
||||
<group>
|
||||
<label for="filter"/>
|
||||
<div colspan="4">
|
||||
<field name="filter" widget='radio'/>
|
||||
</div>
|
||||
|
@ -136,7 +135,7 @@
|
|||
</group>
|
||||
<notebook attrs="{'invisible':[('state','=','draft')]}">
|
||||
<page string="Inventory Details" >
|
||||
<button name="set_checked_qty" states="confirm" string="⇒ Set Checked Quantity to 0" type="object" class="oe_link oe_right" groups="stock.group_stock_user"/>
|
||||
<button name="set_checked_qty" states="confirm" string="⇒ Set quantities to 0" type="object" class="oe_link oe_right" groups="stock.group_stock_user"/>
|
||||
<field name="line_ids" string="Inventory Details" context="{'default_location_id': location_id, 'default_product_id': product_id, 'default_prod_lot_id': lot_id, 'default_package_id': package_id, 'default_partner_id': partner_id}">
|
||||
<tree string="Inventory Details" editable="bottom" colors="blue: product_qty != th_qty">
|
||||
<field context="{'location':location_id, 'uom':product_uom_id, 'to_date':parent.date}" name="product_id" on_change="on_change_product_id(location_id,product_id,product_uom_id,partner_id,prod_lot_id,package_id)" domain="[('type','=','product')]"/>
|
||||
|
@ -146,7 +145,7 @@
|
|||
<field name="package_id" on_change="on_change_product_id(location_id,product_id,product_uom_id,partner_id,prod_lot_id,package_id)" groups="stock.group_tracking_lot"/>
|
||||
<field name="partner_id" on_change="on_change_product_id(location_id,product_id,product_uom_id,partner_id,prod_lot_id,package_id)" groups="stock.group_tracking_owner"/>
|
||||
<field name="th_qty" readonly="1"/>
|
||||
<field name="product_qty" string="Checked Quantity"/>
|
||||
<field name="product_qty" string="Real Quantity"/>
|
||||
<field name="state" invisible="True"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
@ -661,6 +660,7 @@
|
|||
<group>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="color" string="Color in Kanban view" class="oe_edit_only"/>
|
||||
</group>
|
||||
<notebook colspan="4" groups="stock.group_adv_location">
|
||||
<page string="Warehouse Configuration" colspan="4">
|
||||
|
@ -771,7 +771,7 @@
|
|||
<button name="%(act_stock_return_picking)d" string="Reverse Transfer" states="done" type="action" groups="base.group_user"/>
|
||||
<button name="action_cancel" states="assigned,confirmed,draft" string="Cancel Transfer" groups="base.group_user" type="object"/>
|
||||
<button name="do_unreserve" string="Unreserve" groups="base.group_user" type="object" attrs="{'invisible': ['|',('quant_reserved_exist', '=', False), ('state','!=','assigned')]}"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,assigned,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
|
||||
</header>
|
||||
<sheet>
|
||||
<h1>
|
||||
|
@ -780,7 +780,6 @@
|
|||
<group>
|
||||
<group>
|
||||
<field name="partner_id"/>
|
||||
<field name="group_id"/>
|
||||
<field name="backorder_id" readonly="1" attrs="{'invisible': [('backorder_id','=',False)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
|
@ -798,11 +797,17 @@
|
|||
<notebook>
|
||||
<page string="Products">
|
||||
<separator string="Expected Quantities" attrs="{'invisible': [('pack_operation_exist', '=', False)]}"/>
|
||||
<field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree', 'default_picking_type_id': picking_type_id}"/>
|
||||
<separator string="In Process Quantities" attrs="{'invisible': [('pack_operation_exist', '=', False)]}"/>
|
||||
<field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'view_move_picking_tree', 'default_picking_type_id': picking_type_id,'default_picking_id': active_id}"/>
|
||||
<group>
|
||||
<group col="3">
|
||||
<separator string="Quantities Done" attrs="{'invisible': [('pack_operation_exist', '=', False)]}"/>
|
||||
</group>
|
||||
<group col="1">
|
||||
<field name="pack_operation_exist" invisible="1"/>
|
||||
<button name="action_pack" string="Create Package" type="object" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state', 'not in', ('draft','assigned','confirmed'))]}"/>
|
||||
<button name="do_split" string="Create Draft Backorder" groups="base.group_no_one" type="object" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state','!=','assigned')]}"/>
|
||||
<button name="action_pack" string="Create Package" type="object" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state', 'not in', ('draft','assigned','confirmed'))]}" class="oe_link oe_right oe_inline"/>
|
||||
<button name="do_split" string="Create Draft Backorder" groups="base.group_no_one" type="object" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state','!=','assigned')]}" class="oe_link oe_right oe_inline"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="pack_operation_ids" attrs="{'invisible': [('pack_operation_exist', '=', False)]}" context="{'default_owner_id': owner_id}">
|
||||
<tree editable="top">
|
||||
<field name="product_id"/>
|
||||
|
@ -827,6 +832,7 @@
|
|||
<group>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="date_done" groups="base.group_no_one"/>
|
||||
<field name="group_id"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
@ -1070,7 +1076,7 @@
|
|||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
<group name="main_grp" string="Details" colspan="4">
|
||||
<group name="main_grp" colspan="4">
|
||||
<group name="main_grp_col1">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, False)"/>
|
||||
<label for="product_uom_qty"/>
|
||||
|
@ -1093,10 +1099,12 @@
|
|||
<field name="product_uos" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
<group name="main_grp_col1">
|
||||
<group name="main_grp_col2">
|
||||
<field name="picking_type_id"/>
|
||||
<field name="picking_priority"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="date_expected" on_change="onchange_date(date,date_expected)" attrs="{'invisible': [('state', '=', 'done')]}"/>
|
||||
<field name="date" attrs="{'invisible': [('state', '!=', 'done')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="origin_grp" string="Origin">
|
||||
|
@ -1107,12 +1115,9 @@
|
|||
<field name="procure_method" attrs="{'readonly': [('state', '!=', 'draft')]}" groups="base.group_no_one"/>
|
||||
<field name="group_id"/>
|
||||
</group>
|
||||
<group name="destination_grp" string="Destination">
|
||||
<field name="location_dest_id" groups="stock.group_locations"/>
|
||||
<field name="partner_id" context="{'contact_display':'partner'}"
|
||||
groups="stock.group_locations"/>
|
||||
<field name="date_expected" on_change="onchange_date(date,date_expected)" attrs="{'invisible': [('state', '=', 'done')]}"/>
|
||||
<field name="date" attrs="{'invisible': [('state', '!=', 'done')]}"/>
|
||||
<group name="destination_grp" string="Destination" groups="stock.group_locations">
|
||||
<field name="location_dest_id" />
|
||||
<field name="partner_id" context="{'contact_display':'partner'}" />
|
||||
</group>
|
||||
<group name="quants_grp" string="Reserved Quants" colspan="4" groups="base.group_no_one">
|
||||
<field name="reserved_quant_ids"/>
|
||||
|
@ -1126,53 +1131,16 @@
|
|||
<record id="view_move_picking_form" model="ir.ui.view">
|
||||
<field name="name">stock.move.form</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field eval="2" name="priority"/>
|
||||
<field name="inherit_id" ref="view_move_form" />
|
||||
<field eval="20" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Stock Moves" version="7.0">
|
||||
<header>
|
||||
<button name="force_assign" states="confirmed" string="Force Availability" type="object" groups="base.group_user"/>
|
||||
<button name="action_confirm" states="draft" string="Confirm" type="object" groups="base.group_user"/>
|
||||
<button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" groups="base.group_user"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,assigned,done"/>
|
||||
</header>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)"/>
|
||||
<field name="picking_type_id" invisible="1"/>
|
||||
<field name="procure_method"/>
|
||||
<label for="product_uom_qty"/>
|
||||
<div>
|
||||
<field name="product_uom_qty" on_change="onchange_quantity(product_id, product_uom_qty, product_uom, product_uos)" class="oe_inline"/>
|
||||
<field name="product_uom" string="Unit Of Measure" groups="product.group_uom" class="oe_inline"/>
|
||||
<button name="%(stock.move_scrap)d"
|
||||
string="Scrap" type="action"
|
||||
icon="terp-gtk-jump-to-ltr" context="{'scrap': True}"
|
||||
states="draft,waiting,confirmed,assigned"
|
||||
groups="base.group_user"/>
|
||||
</div>
|
||||
<label for="product_uos_qty" groups="product.group_uos"/>
|
||||
<div groups="product.group_uos">
|
||||
<field name="product_uos_qty" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)" class="oe_inline"/>
|
||||
<field name="product_uos" on_change="onchange_quantity(product_id, product_uom_qty, product_uom, product_uos)" class="oe_inline"/>
|
||||
</div>
|
||||
<field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_id','=',product_id)]"/>
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="create_date" invisible="1"/>
|
||||
<field name="date"/>
|
||||
<field name="date_expected" on_change="onchange_date(date,date_expected)"/>
|
||||
</group>
|
||||
|
||||
<group string="Locations" groups="stock.group_locations">
|
||||
<field name="location_id" domain="[('usage','<>','view')]"/>
|
||||
<field name="location_dest_id" domain="[('usage','=','internal')]" groups="stock.group_locations"/>
|
||||
</group>
|
||||
<field name="reserved_quant_ids"/>
|
||||
|
||||
</group>
|
||||
</form>
|
||||
<field name="picking_id" position="replace">
|
||||
<field name="picking_id" invisible="1"/>
|
||||
</field>
|
||||
<!-- domain on picking_id has been removed -->
|
||||
<field name="picking_type_id" position="replace" />
|
||||
<field name="picking_priority" position="replace"/>
|
||||
<field name="group_id" position="replace"/>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -1600,6 +1568,9 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Reordering Rules" version="7.0">
|
||||
<sheet>
|
||||
<div class="oe_right oe_button_box">
|
||||
<button name="action_view_po_to_process" type="object" string="Procurement Orders to Process" icon="gtk-execute" />
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" />
|
||||
|
@ -1623,9 +1594,6 @@
|
|||
<field name="active" />
|
||||
</group>
|
||||
</group>
|
||||
<group string="Procurement Orders to Process">
|
||||
<field name="procurement_draft_ids" nolabel="1"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -2130,7 +2098,7 @@
|
|||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='buttons']" position="inside">
|
||||
<button name="action_view_routes" string="View Logistic Flows" type="object" />
|
||||
<button name="action_view_routes" string="Routes" type="object" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -141,7 +141,15 @@ class stock_return_picking(osv.osv_memory):
|
|||
@return: A dictionary which of fields with values.
|
||||
"""
|
||||
new_picking_id, pick_type_id = self._create_returns(cr, uid, ids, context=context)
|
||||
ctx = {'default_picking_type_id': pick_type_id}
|
||||
ctx = {
|
||||
'default_picking_type_id': pick_type_id,
|
||||
# Probably a more beautiful way to do that ??? QDP ? (feedback please)
|
||||
'search_default_draft': 0,
|
||||
'search_default_assigned': 0,
|
||||
'search_default_confirmed': 0,
|
||||
'search_default_ready': 0,
|
||||
'search_default_late': 0,
|
||||
}
|
||||
return {
|
||||
'domain': "[('id', 'in', [" + str(new_picking_id) + "])]",
|
||||
'name': _('Returned Picking'),
|
||||
|
|
Loading…
Reference in New Issue