[IMP] : rename address_id with parnter_id
bzr revid: sbh@tinyerp.com-20120330082751-3dsfrym5vr1sv2r0
This commit is contained in:
parent
102dc53831
commit
0a28fafb75
|
@ -50,7 +50,7 @@ class pos_order(osv.osv):
|
||||||
_name = "pos.order"
|
_name = "pos.order"
|
||||||
_description = "Point of Sale"
|
_description = "Point of Sale"
|
||||||
_order = "id desc"
|
_order = "id desc"
|
||||||
|
|
||||||
def create_from_ui(self, cr, uid, orders, context=None):
|
def create_from_ui(self, cr, uid, orders, context=None):
|
||||||
#_logger.info("orders: %r", orders)
|
#_logger.info("orders: %r", orders)
|
||||||
list = []
|
list = []
|
||||||
|
@ -205,7 +205,7 @@ class pos_order(osv.osv):
|
||||||
addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {}
|
addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {}
|
||||||
picking_id = picking_obj.create(cr, uid, {
|
picking_id = picking_obj.create(cr, uid, {
|
||||||
'origin': order.name,
|
'origin': order.name,
|
||||||
'address_id': addr.get('delivery',False),
|
'partner_id': addr.get('delivery',False),
|
||||||
'type': 'out',
|
'type': 'out',
|
||||||
'company_id': order.company_id.id,
|
'company_id': order.company_id.id,
|
||||||
'move_type': 'direct',
|
'move_type': 'direct',
|
||||||
|
@ -414,7 +414,7 @@ class pos_order(osv.osv):
|
||||||
wf_service.trg_validate(uid, 'pos.order', order.id, 'invoice', cr)
|
wf_service.trg_validate(uid, 'pos.order', order.id, 'invoice', cr)
|
||||||
|
|
||||||
if not inv_ids: return {}
|
if not inv_ids: return {}
|
||||||
|
|
||||||
mod_obj = self.pool.get('ir.model.data')
|
mod_obj = self.pool.get('ir.model.data')
|
||||||
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
|
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
|
||||||
res_id = res and res[1] or False
|
res_id = res and res[1] or False
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||||
#
|
#
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ class pos_return(osv.osv_memory):
|
||||||
for order in order_obj.browse(cr, uid, active_ids, context=context):
|
for order in order_obj.browse(cr, uid, active_ids, context=context):
|
||||||
for line in order.lines:
|
for line in order.lines:
|
||||||
result.append({
|
result.append({
|
||||||
'product_id' : line.product_id.id,
|
'product_id' : line.product_id.id,
|
||||||
'quantity' : line.qty,
|
'quantity' : line.qty,
|
||||||
'line_id':line.id
|
'line_id':line.id
|
||||||
})
|
})
|
||||||
res.update({'pos_moves_ids': result})
|
res.update({'pos_moves_ids': result})
|
||||||
|
@ -93,7 +93,7 @@ class pos_return(osv.osv_memory):
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
}
|
}
|
||||||
def create_returns2(self, cr, uid, ids, context=None):
|
def create_returns2(self, cr, uid, ids, context=None):
|
||||||
|
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
active_id = context.get('active_id', False)
|
active_id = context.get('active_id', False)
|
||||||
|
@ -113,7 +113,7 @@ class pos_return(osv.osv_memory):
|
||||||
for order_id in order_obj.browse(cr, uid, [active_id], context=context):
|
for order_id in order_obj.browse(cr, uid, [active_id], context=context):
|
||||||
source_stock_id = property_obj.get(cr, uid, 'property_stock_customer', 'res.partner', context=context).id
|
source_stock_id = property_obj.get(cr, uid, 'property_stock_customer', 'res.partner', context=context).id
|
||||||
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
|
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
|
||||||
"WHERE w.lot_stock_id=s.id AND w.id=%s ",
|
"WHERE w.lot_stock_id=s.id AND w.id=%s ",
|
||||||
(order_id.shop_id.warehouse_id.id,))
|
(order_id.shop_id.warehouse_id.id,))
|
||||||
res = cr.fetchone()
|
res = cr.fetchone()
|
||||||
location_id = res and res[0] or None
|
location_id = res and res[0] or None
|
||||||
|
@ -121,7 +121,7 @@ class pos_return(osv.osv_memory):
|
||||||
'move_lines': [],
|
'move_lines': [],
|
||||||
'state':'draft',
|
'state':'draft',
|
||||||
'type': 'in',
|
'type': 'in',
|
||||||
'address_id': order_id.partner_id.id,
|
'partner_id': order_id.partner_id.id,
|
||||||
'date': date_cur })
|
'date': date_cur })
|
||||||
new_order = order_obj.copy(cr, uid, order_id.id, {'name': 'Refund %s'%order_id.name,
|
new_order = order_obj.copy(cr, uid, order_id.id, {'name': 'Refund %s'%order_id.name,
|
||||||
'lines':[],
|
'lines':[],
|
||||||
|
@ -268,7 +268,7 @@ class add_product(osv.osv_memory):
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
self_data = self.browse(cr, uid, ids, context=context)[0]
|
self_data = self.browse(cr, uid, ids, context=context)[0]
|
||||||
order_obj.add_product(cr, uid, active_ids[0], self_data.product_id.id, self_data.quantity, context=context)
|
order_obj.add_product(cr, uid, active_ids[0], self_data.product_id.id, self_data.quantity, context=context)
|
||||||
|
|
||||||
for order_id in order_obj.browse(cr, uid, active_ids, context=context):
|
for order_id in order_obj.browse(cr, uid, active_ids, context=context):
|
||||||
stock_dest_id = property_obj.get(cr, uid, 'property_stock_customer', 'res.partner', context=context).id
|
stock_dest_id = property_obj.get(cr, uid, 'property_stock_customer', 'res.partner', context=context).id
|
||||||
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
|
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
|
||||||
|
@ -287,7 +287,7 @@ class add_product(osv.osv_memory):
|
||||||
})
|
})
|
||||||
for line in order_id.lines:
|
for line in order_id.lines:
|
||||||
key= 'return%s' % line.id
|
key= 'return%s' % line.id
|
||||||
if line.id:
|
if line.id:
|
||||||
if data.has_key(key):
|
if data.has_key(key):
|
||||||
qty = data[key]
|
qty = data[key]
|
||||||
lines_obj.write(cr,uid,[line.id], {
|
lines_obj.write(cr,uid,[line.id], {
|
||||||
|
|
Loading…
Reference in New Issue