diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 8b5da45e965..472eec0f23c 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -26,8 +26,8 @@
-
-
+
+
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index c6d9e670b1a..edca8639dbc 100755
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -101,9 +101,9 @@
+
-
diff --git a/addons/crm_vertical/crm_meeting_vertical_view.xml b/addons/crm_vertical/crm_meeting_vertical_view.xml
index c87883381e4..aa2e2ada8d2 100644
--- a/addons/crm_vertical/crm_meeting_vertical_view.xml
+++ b/addons/crm_vertical/crm_meeting_vertical_view.xml
@@ -1,7 +1,7 @@
-
-
-
+
+
Cases by User and Section
@@ -87,7 +87,7 @@
tree,graph
-
+
My cases by section
@@ -97,7 +97,7 @@
[('user_id','=',uid)]
-
+
@@ -166,7 +166,7 @@
tree,graph
-
+
@@ -299,4 +299,4 @@
-
\ No newline at end of file
+
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index fc53ddd828a..a2a19bc81ab 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -131,6 +131,7 @@
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position)"
domain="[('product_id','=',product_id)]"
groups="base.group_extended"/>
+
@@ -354,7 +355,7 @@
-
+
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index a5d4f0870bd..c6a4d51cbcb 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1000,10 +1000,10 @@ class stock_move(osv.osv):
\nThe state is \'Waiting\' if the move is waiting for another one.'),
'price_unit': fields.float('Unit Price',
digits=(16, int(config['price_accuracy']))),
- 'company_id': fields.many2one('res.company', 'Company', required=True),
- 'purchase_id': fields.related('picking_id','purchase_id',type='many2one', relation="purchase.order", string="Purchase Orders"),
- 'supplier_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Supplier"),
- 'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Orders"),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner"),
+ 'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Orders"),
+ 'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"),
}
_constraints = [
(_check_tracking,
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 43b30323520..7653d978929 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -1216,9 +1216,9 @@
-
-
-
+
+
+
@@ -1240,7 +1240,7 @@
@@ -1277,6 +1277,7 @@
ir.actions.act_window
form
tree,form
+ [('picking_id.type','=','in')]
diff --git a/addons/stock/wizard/wizard_partial_move.py b/addons/stock/wizard/wizard_partial_move.py
index 7510ec0eb83..882d05cf359 100644
--- a/addons/stock/wizard/wizard_partial_move.py
+++ b/addons/stock/wizard/wizard_partial_move.py
@@ -34,12 +34,8 @@ _moves_fields = UpdateableDict()
_moves_arch_end = '''
'''
-_moves_fields_end = {
- 'back_order_notification': {'string':'Back Order' ,'type':'text', 'readonly':True}
- }
def make_default(val):
def fct(uid, data, state):
@@ -51,145 +47,142 @@ def _to_xml(s):
def _get_moves(self, cr, uid, data, context):
move_obj = pooler.get_pool(cr.dbname).get('stock.move')
- move_lines = move_obj.browse(cr, uid, [data['id']], context)
+ move_lines = move_obj.browse(cr, uid, data['ids'], context)
res = {}
_moves_fields.clear()
_moves_arch_lst = ['', '')
_moves_arch.string = '\n'.join(_moves_arch_lst)
return res
def _do_split(self, cr, uid, data, context):
- move_obj = pooler.get_pool(cr.dbname).get('stock.move')
- pick_obj = pooler.get_pool(cr.dbname).get('stock.picking')
- move_lines = move_obj.browse(cr, uid, data['id'])
- pick = pick_obj.browse(cr, uid, [move_lines.picking_id.id])[0]
pool = pooler.get_pool(cr.dbname)
- complete, too_few, too_many = False, False, False
- states = []
+ move_obj = pool.get('stock.move')
+ pick_obj = pool.get('stock.picking')
+ product_obj = pool.get('product.product')
+ currency_obj = pool.get('res.currency')
+ users_obj = pool.get('res.users')
+ uom_obj = pool.get('product.uom')
+ move_lines = move_obj.browse(cr, uid, data['ids'])
+ wf_service = netsvc.LocalService("workflow")
+ complete, too_few, too_many = [], [], []
+ for move in move_lines:
+ states = []
- if move_lines.product_qty == data['form']['move%s' % data['id']]:
- complete = move_lines
- elif move_lines.product_qty > data['form']['move%s' % data['id']]:
- too_few = move_lines
- else:
- too_many = move_lines
-
+ if move.product_qty == data['form']['move%s' % move.id]:
+ complete.append(move)
+ elif move.product_qty > data['form']['move%s' % move.id]:
+ too_few.append(move)
+ else:
+ too_many.append(move)
# Average price computation
- if (move_lines.picking_id.type == 'in') and (move_lines.product_id.cost_method == 'average'):
- product_obj = pool.get('product.product')
- currency_obj = pool.get('res.currency')
- users_obj = pool.get('res.users')
- uom_obj = pool.get('product.uom')
+ if (move.picking_id.type == 'in') and (move.product_id.cost_method == 'average'):
+ product = move.product_id
+ user = users_obj.browse(cr, uid, uid)
+ qty = data['form']['move%s' % move.id]
+ uom = data['form']['uom%s' % move.id]
+ price = data['form']['price%s' % move.id]
+ currency = data['form']['currency%s' % move.id]
- product = product_obj.browse(cr, uid, [move_lines.product_id.id])[0]
- user = users_obj.browse(cr, uid, [uid])[0]
+ qty = uom_obj._compute_qty(cr, uid, uom, qty, product.uom_id.id)
- qty = data['form']['move%s' % move_lines.id]
- uom = data['form']['uom%s' % move_lines.id]
- price = data['form']['price%s' % move_lines.id]
- currency = data['form']['currency%s' % move_lines.id]
+ if (qty > 0):
+ new_price = currency_obj.compute(cr, uid, currency,
+ user.company_id.currency_id.id, price)
+ new_price = uom_obj._compute_price(cr, uid, uom, new_price,
+ product.uom_id.id)
+ if product.qty_available<=0:
+ new_std_price = new_price
+ else:
+ new_std_price = ((product.standard_price * product.qty_available)\
+ + (new_price * qty))/(product.qty_available + qty)
- qty = uom_obj._compute_qty(cr, uid, uom, qty, product.uom_id.id)
+ product_obj.write(cr, uid, [product.id],
+ {'standard_price': new_std_price})
+ move_obj.write(cr, uid, move.id, {'price_unit': new_price})
- if (qty > 0):
- new_price = currency_obj.compute(cr, uid, currency,
- user.company_id.currency_id.id, price)
- new_price = uom_obj._compute_price(cr, uid, uom, new_price,
- product.uom_id.id)
- if product.qty_available<=0:
- new_std_price = new_price
- else:
- new_std_price = ((product.standard_price * product.qty_available)\
- + (new_price * qty))/(product.qty_available + qty)
-
- product_obj.write(cr, uid, [product.id],
- {'standard_price': new_std_price})
- move_obj.write(cr, uid, [move_lines.id], {'price_unit': new_price})
- if complete:
- move_obj.write(cr, uid, [complete.id],{
- 'product_qty': data['form']['move%s' % complete.id],
- 'product_uos_qty': data['form']['move%s' % complete.id],
- 'state':'done' })
- for move in pick.move_lines:
- if move.state == 'done':
- states.append(True)
- else:
- states.append(False)
- if False not in states:
- pick_obj.write(cr, uid, complete.picking_id.id, {
- 'name': pool.get('ir.sequence').get(cr, uid, 'stock.picking'),
- 'state':'done' })
- return {'back_order':False}
- if too_few:
- pick_obj.write(cr, uid, too_few.picking_id.id, {
- 'name': pool.get('ir.sequence').get(cr, uid, 'stock.picking'),
- 'move_lines' : [],
- 'state':'assigned' })
- if data['form']['move%s' % too_few.id] <> 0:
- new_obj = move_obj.copy(cr, uid, too_few.id,
+ for move in too_few:
+ if data['form']['move%s' % move.id] <> 0:
+ new_move = move_obj.copy(cr, uid, move.id,
{
- 'product_qty' : data['form']['move%s' % too_few.id],
- 'product_uos_qty':data['form']['move%s' % too_few.id],
- 'picking_id' : too_few.picking_id.id,
+ 'product_qty' : data['form']['move%s' % move.id],
+ 'product_uos_qty':data['form']['move%s' % move.id],
+ 'picking_id' : move.picking_id.id,
+ 'state': 'assigned',
'move_dest_id': False,
- 'price_unit': too_few.price_unit,
+ 'price_unit': move.price_unit,
})
- move_obj.write(cr, uid, [new_obj],{'state':'done'})
- move_obj.write(cr, uid, [too_few.id],{
- 'product_qty' : move_lines.product_qty - data['form']['move%s' % too_few.id],
- 'product_uos_qty':move_lines.product_qty - data['form']['move%s' % too_few.id],
- 'state':'assigned' })
- if too_many:
- move_obj.write(cr, uid, [too_many.id],{
- 'product_qty': data['form']['move%s' % too_many.id],
- 'product_uos_qty': data['form']['move%s' % too_many.id],
- 'state':'assigned' })
- return {'back_order':False}
+ complete.append(move_obj.browse(cr, uid, new_move))
+ move_obj.write(cr, uid, move.id,
+ {
+ 'product_qty' : move.product_qty - data['form']['move%s' % move.id],
+ 'product_uos_qty':move.product_qty - data['form']['move%s' % move.id],
+ })
+
+
+ for move in too_many:
+ move_obj.write(cr, uid, move.id,
+ {
+ 'product_qty': data['form']['move%s' % move.id],
+ 'product_uos_qty': data['form']['move%s' % move.id]
+ })
+ complete.append(move)
+
+ for move in complete:
+ move_obj.action_done(cr, uid, [move.id])
+
+ # TOCHECK : Done picking if all moves are done
+ cr.execute('select move.id from stock_picking pick \
+ right join stock_move move on move.picking_id = pick.id and move.state = ''%s'' where pick.id = %s',
+ ('done', move.picking_id.id))
+ res = cr.fetchall()
+ if len(res) == len(move.picking_id.move_lines):
+ pick_obj.action_done(cr, uid, [move.picking_id.id])
+ #wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
+ #wf_service.trg_write(uid, 'stock.picking', move.picking_id.id, cr)
+
+ return {}
+
-def _get_default(self, cr, uid, data, context):
- if data['form']['back_order']:
- data['form']['back_order_notification'] = _('Back Order %s Assigned to this Picking.') % (tools.ustr(data['form']['back_order']),)
- return data['form']
class partial_move(wizard.interface):
@@ -208,9 +201,9 @@ class partial_move(wizard.interface):
'result': {'type': 'state', 'state': 'end2'},
},
'end2': {
- 'actions': [ _get_default ],
+ 'actions': [],
'result': {'type': 'form', 'arch': _moves_arch_end,
- 'fields': _moves_fields_end,
+ 'fields': {},
'state': (
('end', 'Close'),
)