[IMP] : rename address_id with parnter_id

bzr revid: sbh@tinyerp.com-20120330082751-3dsfrym5vr1sv2r0
This commit is contained in:
Sbh (Openerp) 2012-03-30 13:57:51 +05:30
parent 102dc53831
commit 0a28fafb75
2 changed files with 12 additions and 12 deletions

View File

@ -50,7 +50,7 @@ class pos_order(osv.osv):
_name = "pos.order"
_description = "Point of Sale"
_order = "id desc"
def create_from_ui(self, cr, uid, orders, context=None):
#_logger.info("orders: %r", orders)
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 {}
picking_id = picking_obj.create(cr, uid, {
'origin': order.name,
'address_id': addr.get('delivery',False),
'partner_id': addr.get('delivery',False),
'type': 'out',
'company_id': order.company_id.id,
'move_type': 'direct',
@ -414,7 +414,7 @@ class pos_order(osv.osv):
wf_service.trg_validate(uid, 'pos.order', order.id, 'invoice', cr)
if not inv_ids: return {}
mod_obj = self.pool.get('ir.model.data')
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
res_id = res and res[1] or False

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# 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 line in order.lines:
result.append({
'product_id' : line.product_id.id,
'quantity' : line.qty,
'product_id' : line.product_id.id,
'quantity' : line.qty,
'line_id':line.id
})
res.update({'pos_moves_ids': result})
@ -93,7 +93,7 @@ class pos_return(osv.osv_memory):
'type': 'ir.actions.act_window',
}
def create_returns2(self, cr, uid, ids, context=None):
if context is None:
context = {}
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):
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 "
"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,))
res = cr.fetchone()
location_id = res and res[0] or None
@ -121,7 +121,7 @@ class pos_return(osv.osv_memory):
'move_lines': [],
'state':'draft',
'type': 'in',
'address_id': order_id.partner_id.id,
'partner_id': order_id.partner_id.id,
'date': date_cur })
new_order = order_obj.copy(cr, uid, order_id.id, {'name': 'Refund %s'%order_id.name,
'lines':[],
@ -268,7 +268,7 @@ class add_product(osv.osv_memory):
wf_service = netsvc.LocalService("workflow")
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)
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
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:
key= 'return%s' % line.id
if line.id:
if line.id:
if data.has_key(key):
qty = data[key]
lines_obj.write(cr,uid,[line.id], {