diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py index 9eac51d7579..0f868f91d34 100644 --- a/addons/account_analytic_default/account_analytic_default.py +++ b/addons/account_analytic_default/account_analytic_default.py @@ -89,7 +89,7 @@ class stock_picking(osv.osv): _inherit = "stock.picking" def _get_account_analytic_invoice(self, cursor, user, picking, move_line): - partner_id = picking.address_id and picking.address_id.id or False + partner_id = picking.partner_id and picking.partner_id.id or False rec = self.pool.get('account.analytic.default').account_get(cursor, user, move_line.product_id.id, partner_id , user, time.strftime('%Y-%m-%d'), context={}) if rec: diff --git a/addons/claim_from_delivery/claim_delivery_view.xml b/addons/claim_from_delivery/claim_delivery_view.xml index 624e93466db..f345484b4a9 100644 --- a/addons/claim_from_delivery/claim_delivery_view.xml +++ b/addons/claim_from_delivery/claim_delivery_view.xml @@ -3,7 +3,7 @@ diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 2d97d89dfca..047db1fea1d 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -189,7 +189,7 @@ stock.picking - + diff --git a/addons/delivery/report/shipping.rml b/addons/delivery/report/shipping.rml index a270d13fbd5..5a3750e64a8 100644 --- a/addons/delivery/report/shipping.rml +++ b/addons/delivery/report/shipping.rml @@ -134,8 +134,8 @@ [[ o.sale_id and o.sale_id.partner_invoice_id and display_address(o.sale_id.partner_invoice_id) ]] - [[ o.address_id and o.address_id and o.address_id.name or '' ]] - [[ o.address_id and o.address_id and display_address(o.address_id) ]] + [[ o.partner_id and o.partner_id and o.partner_id.name or '' ]] + [[ o.partner_id and o.partner_id and display_address(o.partner_id) ]] diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index 09f1973e96d..b441a8e5efe 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -84,7 +84,7 @@ class stock_picking(osv.osv): for inv_line in invoice.invoice_line): return None grid_id = carrier_obj.grid_get(cr, uid, [picking.carrier_id.id], - picking.address_id.id, context=context) + picking.partner_id.id, context=context) if not grid_id: raise osv.except_osv(_('Warning'), _('The carrier %s (id: %d) has no delivery grid!') \ @@ -99,7 +99,7 @@ class stock_picking(osv.osv): .property_account_income_categ.id taxes = picking.carrier_id.product_id.taxes_id - partner = picking.address_id or False + partner = picking.partner_id or False if partner: account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, partner.property_account_position, account_id) taxes_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, taxes) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 8a25af01e7b..1f70f55e505 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -312,7 +312,7 @@ class mrp_bom(osv.osv): phantom = False if bom.type == 'phantom' and not bom.bom_lines: newbom = self._bom_find(cr, uid, bom.product_id.id, bom.product_uom.id, properties) - + if newbom: res = self._bom_explode(cr, uid, self.browse(cr, uid, [newbom])[0], factor*bom.product_qty, properties, addthis=True, level=level+10) result = result + res[0] @@ -670,9 +670,9 @@ class mrp_production(osv.osv): return res def _get_subproduct_factor(self, cr, uid, production_id, move_id=None, context=None): - """ Compute the factor to compute the qty of procucts to produce for the given production_id. By default, - it's always equal to the quantity encoded in the production order or the production wizard, but if the - module mrp_subproduct is installed, then we must use the move_id to identify the product to produce + """ Compute the factor to compute the qty of procucts to produce for the given production_id. By default, + it's always equal to the quantity encoded in the production order or the production wizard, but if the + module mrp_subproduct is installed, then we must use the move_id to identify the product to produce and its quantity. :param production_id: ID of the mrp.order :param move_id: ID of the stock move that needs to be produced. Will be used in mrp_subproduct. @@ -733,7 +733,7 @@ class mrp_production(osv.osv): prod_name = scheduled.product_id.name_get()[0][1] raise osv.except_osv(_('Warning!'), _('You are going to consume total %s quantities of "%s".\nBut you can only consume up to total %s quantities.') % (qty, prod_name, qty_avail)) if qty <= 0.0: - # we already have more qtys consumed than we need + # we already have more qtys consumed than we need continue raw_product[0].action_consume(qty, raw_product[0].location_id.id, context=context) @@ -890,21 +890,21 @@ class mrp_production(osv.osv): 'state': 'waiting', 'company_id': production.company_id.id, }) - + def _make_production_internal_shipment(self, cr, uid, production, context=None): ir_sequence = self.pool.get('ir.sequence') stock_picking = self.pool.get('stock.picking') routing_loc = None pick_type = 'internal' - address_id = False - + partner_id = False + # Take routing address as a Shipment Address. # If usage of routing location is a internal, make outgoing shipment otherwise internal shipment if production.bom_id.routing_id and production.bom_id.routing_id.location_id: routing_loc = production.bom_id.routing_id.location_id if routing_loc.usage <> 'internal': pick_type = 'out' - address_id = routing_loc.address_id and routing_loc.address_id.id or False + partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False # Take next Sequence number of shipment base on type pick_name = ir_sequence.get(cr, uid, 'stock.picking.' + pick_type) @@ -915,7 +915,7 @@ class mrp_production(osv.osv): 'type': pick_type, 'move_type': 'one', 'state': 'auto', - 'address_id': address_id, + 'partner_id': partner_id, 'auto_picking': self._get_auto_picking(cr, uid, production), 'company_id': production.company_id.id, }) @@ -926,7 +926,7 @@ class mrp_production(osv.osv): stock_move = self.pool.get('stock.move') source_location_id = production.product_id.product_tmpl_id.property_stock_production.id destination_location_id = production.location_dest_id.id - move_name = _('PROD: %s') + production.name + move_name = _('PROD: %s') + production.name data = { 'name': move_name, 'date': production.date_planned, @@ -983,7 +983,7 @@ class mrp_production(osv.osv): for production in self.browse(cr, uid, ids, context=context): shipment_id = self._make_production_internal_shipment(cr, uid, production, context=context) produce_move_id = self._make_production_produce_line(cr, uid, production, context=context) - + # Take routing location as a Source Location. source_location_id = production.location_src_id.id if production.bom_id.routing_id and production.bom_id.routing_id.location_id: @@ -994,7 +994,7 @@ class mrp_production(osv.osv): shipment_move_id = self._make_production_internal_shipment_line(cr, uid, line, shipment_id, consume_move_id,\ destination_location_id=source_location_id, context=context) self._make_production_line_procurement(cr, uid, line, shipment_move_id, context=context) - + wf_service.trg_validate(uid, 'stock.picking', shipment_id, 'button_confirm', cr) production.write({'state':'confirmed'}, context=context) message = _("Manufacturing order '%s' is scheduled for the %s.") % ( diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index 496e039d0d4..ee78e036d44 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -22,8 +22,8 @@ assert line.product_qty == (2.0*factor), "Qty is not correspond." assert line.product_uom.id == ref('product.product_uom_unit'), "UOM is not correspond" sidepanel = True - elif line.product_id.id == ref('product.product_product_woodlintelm0'): #LIN40 4*0.25 Meter - assert not woodlintelm, "Production line is already generated for LIN40." + elif line.product_id.id == ref('product.product_product_woodlintelm0'): #LIN40 4*0.25 Meter + assert not woodlintelm, "Production line is already generated for LIN40." assert line.product_qty == (4*0.25*factor), "Qty is not correspond." assert line.product_uom.id == ref('product.product_uom_meter'), "UOM is not correspond" woodlintelm = True @@ -32,7 +32,7 @@ assert line.product_qty == (0.25*factor), "Qty is not correspond." assert line.product_uom.id == ref('product.product_uom_meter'), "UOM is not correspond" woodmm0 = True - elif line.product_id.id == ref('product.product_product_metalcleats0'): #METC000 4*3 Unit + elif line.product_id.id == ref('product.product_product_metalcleats0'): #METC000 4*3 Unit assert not metalcleats, "Production line is already generated for METC000." assert line.product_qty == (4*3*factor), "Qty is not correspond." assert line.product_uom.id == ref('product.product_uom_unit'), "UOM is not correspond" @@ -107,7 +107,7 @@ routing_loc = None if order.bom_id.routing_id and order.bom_id.routing_id.location_id: routing_loc = order.bom_id.routing_id.location_id.id - date_planned = order.date_planned + date_planned = order.date_planned for move_line in order.move_lines: for order_line in order.product_lines: if move_line.product_id.type not in ('product', 'consu'): @@ -129,18 +129,18 @@ procurement = self.pool.get('procurement.order') order = self.browse(cr, uid, ref("mrp_production_shelf100cm")) assert order.picking_id, 'Internal Shipment should be created!' - + routing_loc = None pick_type = 'internal' - address_id = False + partner_id = False if order.bom_id.routing_id and order.bom_id.routing_id.location_id: routing_loc = order.bom_id.routing_id.location_id if routing_loc.usage <> 'internal': pick_type = 'out' - address_id = routing_loc.address_id and routing_loc.address_id.id or False + partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False routing_loc = routing_loc.id assert order.picking_id.type == pick_type, "Shipment should be Internal." - assert order.picking_id.address_id.id == address_id, "Shipment Address is not correspond with Adderss of Routing Location." + assert order.picking_id.partner_id.id == partner_id, "Shipment Address is not correspond with Adderss of Routing Location." date_planned = order.date_planned for move_line in order.picking_id.move_lines: for order_line in order.product_lines: @@ -167,7 +167,7 @@ assert shipment_procurement.product_uos.id == order_line.product_uos.id, "UOS is not correspond in procurement." assert shipment_procurement.location_id.id == order.location_src_id.id, "Location is not correspond in procurement." assert shipment_procurement.procure_method == order_line.product_id.procure_method, "Procure method is not correspond in procurement." - + - I change production qty with 3 Dozen Shelf 100cm. - @@ -187,7 +187,7 @@ assert order.product_qty == 3, "Qty is not changed in order." move = order.move_created_ids[0] assert move.product_qty == order.product_qty, "Qty is not changed in move line." -- +- I run scheduler. - !python {model: procurement.order}: | @@ -223,7 +223,7 @@ order = self.browse(cr, uid, ref("mrp_production_shelf100cm")) for move in order.move_lines: move.action_consume(move.product_qty) - if move.product_id.id == ref("product.product_product_metalcleats0"): + if move.product_id.id == ref("product.product_product_metalcleats0"): move.action_scrap(5.0, scrap_location_id) - I produce product. @@ -242,8 +242,8 @@ !python {model: mrp.production}: | order = self.browse(cr, uid, ref("mrp_production_shelf100cm")) assert order.state == 'done', "Production order should be closed." -- - I check Total Costs at End of Production. +- + I check Total Costs at End of Production. - !python {model: mrp.production}: | order = self.browse(cr, uid, ref("mrp_production_shelf100cm")) @@ -275,7 +275,7 @@ assert line.journal_id.id == wc.costs_journal_id.id, "Account Journal is not correspond." assert line.product_id.id == wc.product_id.id, "Product is not correspond." assert line.product_uom_id.id == wc.product_id.uom_id.id, "UOM is not correspond." - + - I print a "BOM Structure". - diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 77b097cddd3..4a0085e3db9 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -229,12 +229,12 @@ class mrp_repair(osv.osv): data['value']['guarantee_limit'] = limit.strftime('%Y-%m-%d') data['value']['location_id'] = move.location_dest_id.id data['value']['location_dest_id'] = move.location_dest_id.id - if move.address_id: - data['value']['partner_id'] = move.address_id and move.address_id.id + if move.partner_id: + data['value']['partner_id'] = move.partner_id and move.partner_id.id else: data['value']['partner_id'] = False - data['value']['address_id'] = move.address_id and move.address_id.id - d = self.onchange_partner_id(cr, uid, ids, data['value']['partner_id'], data['value']['address_id']) + data['value']['partner_id'] = move.partner_id and move.partner_id.id + d = self.onchange_partner_id(cr, uid, ids, data['value']['partner_id'], data['value']['partner_id']) data['value'].update(d['value']) return data @@ -515,7 +515,7 @@ class mrp_repair(osv.osv): 'product_id': move.product_id.id, 'product_qty': move.product_uom_qty, 'product_uom': move.product_uom.id, - 'address_id': repair.address_id and repair.address_id.id or False, + 'partner_id': repair.address_id and repair.address_id.id or False, 'location_id': move.location_id.id, 'location_dest_id': move.location_dest_id.id, 'tracking_id': False, @@ -530,7 +530,7 @@ class mrp_repair(osv.osv): 'origin': repair.name, 'state': 'draft', 'move_type': 'one', - 'address_id': repair.address_id and repair.address_id.id or False, + 'partner_id': repair.address_id and repair.address_id.id or False, 'note': repair.internal_notes, 'invoice_state': 'none', 'type': 'out', @@ -542,7 +542,7 @@ class mrp_repair(osv.osv): 'product_qty': move.product_uom_qty or 1.0, 'product_uom': repair.product_id.uom_id.id, 'prodlot_id': repair.prodlot_id and repair.prodlot_id.id or False, - 'address_id': repair.address_id and repair.address_id.id or False, + 'partner_id': repair.address_id and repair.address_id.id or False, 'location_id': repair.location_id.id, 'location_dest_id': repair.location_dest_id.id, 'tracking_id': False, diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 4a88ce3cc16..5af78b131b2 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -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 diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py index 30b16a717d4..0e5d4e1fbb5 100644 --- a/addons/point_of_sale/wizard/pos_return.py +++ b/addons/point_of_sale/wizard/pos_return.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -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 . +# along with this program. If not, see . # ############################################################################## @@ -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], { diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index c7907bf7d3c..db1c6ff5cfb 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -428,7 +428,7 @@ class purchase_order(osv.osv): 'origin': order.name + ((order.origin and (':' + order.origin)) or ''), 'date': order.date_order, 'type': 'in', - 'address_id': order.dest_address_id.id or order.partner_id.id, + 'partner_id': order.dest_address_id.id or order.partner_id.id, 'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none', 'purchase_id': order.id, 'company_id': order.company_id.id, @@ -448,7 +448,7 @@ class purchase_order(osv.osv): 'location_id': order.partner_id.property_stock_supplier.id, 'location_dest_id': order.location_id.id, 'picking_id': picking_id, - 'address_id': order.dest_address_id.id or order.partner_id.id, + 'partner_id': order.dest_address_id.id or order.partner_id.id, 'move_dest_id': order_line.move_dest_id.id, 'state': 'draft', 'purchase_line_id': order_line.id, diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 3c71126acb7..a3c2e70a85c 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -170,7 +170,6 @@ - diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index b106ad4a4a2..ab4f8d9dd7b 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -167,7 +167,7 @@ Shipping address : [[ (o.dest_address_id and o.dest_address_id.name) or (o.warehouse_id and o.warehouse_id.name) or '']] - [[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_address_id)) or '']] + [[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_id)) or '']] diff --git a/addons/purchase/test/process/rfq2order2done.yml b/addons/purchase/test/process/rfq2order2done.yml index a9635fdfe4f..5a1e1ccde4b 100644 --- a/addons/purchase/test/process/rfq2order2done.yml +++ b/addons/purchase/test/process/rfq2order2done.yml @@ -40,7 +40,7 @@ assert len(purchase_order.picking_ids) >= 1, "You should have only one reception order" for picking in purchase_order.picking_ids: assert picking.state == "assigned", "Reception state should be in assigned state" - assert picking.address_id.id == purchase_order.partner_id.id, "Delivery address of reception id is different from order" + assert picking.partner_id.id == purchase_order.partner_id.id, "Delivery address of reception id is different from order" assert picking.company_id.id == purchase_order.company_id.id, "Company is not correspond with purchase order" - Reception is ready for process so now done the reception. diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 93938fa4f8e..d8e8ac60f3d 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -733,7 +733,7 @@ class sale_order(osv.osv): 'product_uos': (line.product_uos and line.product_uos.id)\ or line.product_uom.id, 'product_packaging': line.product_packaging.id, - 'address_id': line.address_allotment_id.id or order.partner_shipping_id.id, + 'partner_id': line.address_allotment_id.id or order.partner_shipping_id.id, 'location_id': location_id, 'location_dest_id': output_id, 'sale_line_id': line.id, @@ -755,7 +755,7 @@ class sale_order(osv.osv): 'state': 'auto', 'move_type': order.picking_policy, 'sale_id': order.id, - 'address_id': order.partner_shipping_id.id, + 'partner_id': order.partner_shipping_id.id, 'note': order.note, 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none', 'company_id': order.company_id.id, diff --git a/addons/sale/sale_unit_test.xml b/addons/sale/sale_unit_test.xml index 787373dae99..5ce1156a206 100644 --- a/addons/sale/sale_unit_test.xml +++ b/addons/sale/sale_unit_test.xml @@ -84,7 +84,7 @@ - + diff --git a/addons/sale/test/picking_order_policy.yml b/addons/sale/test/picking_order_policy.yml index 0d2a2e19a34..f2e3cd0e24a 100644 --- a/addons/sale/test/picking_order_policy.yml +++ b/addons/sale/test/picking_order_policy.yml @@ -52,7 +52,7 @@ assert picking.origin == sale_order.name,"Origin of Delivery order is not correspond with sequence number of sale order." assert picking.type == 'out',"Shipment should be Outgoing." assert picking.move_type == sale_order.picking_policy,"Delivery Method is not corresponding with delivery method of sale order." - assert picking.address_id.id == sale_order.partner_shipping_id.id,"Shipping Address is not correspond with sale order." + assert picking.partner_id.id == sale_order.partner_shipping_id.id,"Shipping Address is not correspond with sale order." assert picking.note == sale_order.note,"Note is not correspond with sale order." assert picking.invoice_state == (sale_order.order_policy=='picking' and '2binvoiced') or 'none',"Invoice policy is not correspond with sale order." assert len(picking.move_lines) == len(sale_order.order_line), "Total move of delivery order are not corresposning with total sale order lines." @@ -69,7 +69,7 @@ assert move.product_uos_qty == (order_line.product_uos and order_line.product_uos_qty) or order_line.product_uom_qty,"Product UOS Quantity is not correspond." assert move.product_uos == (order_line.product_uos and order_line.product_uos.id) or order_line.product_uom.id,"Product UOS is not correspond" assert move.product_packaging.id == order_line.product_packaging.id,"Product packaging is not correspond." - assert move.address_id.id == order_line.address_allotment_id.id or sale_order.partner_shipping_id.id,"Address is not correspond" + assert move.partner_id.id == order_line.address_allotment_id.id or sale_order.partner_shipping_id.id,"Address is not correspond" #assert move.location_id.id == location_id,"Source Location is not correspond." #assert move.location_dest_id == output_id,"Destination Location is not correspond." assert move.note == order_line.notes,"Note is not correspond" diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml index f16d070f9b9..63706a940e6 100644 --- a/addons/stock/report/picking.rml +++ b/addons/stock/report/picking.rml @@ -162,13 +162,13 @@ Shipping Address : - [[ (picking.address_id and picking.address_id.id and picking.address_id.title.name) or '' ]] [[ picking.address_id and picking.address_id.id and picking.address_id.name ]] - [[ picking.address_id and display_address(picking.address_id,'delivery') ]] + [[ (picking.partner_id and picking.partner_id.id and picking.partner_id.title.name) or '' ]] [[ picking.partner_id and picking.partner_id.id and picking.partner_id.name ]] + [[ picking.partner_id and display_address(picking.partner_id,'delivery') ]] Contact Address : - [[ picking.address_id and picking.address_id.title.name or '' ]] [[ picking.address_id and picking.address_id.name or '' ]] - [[ picking.address_id and display_address(picking.address_id,'default') ]] + [[ picking.partner_id and picking.partner_id.title.name or '' ]] [[ picking.partner_id and picking.partner_id.name or '' ]] + [[ picking.partner_id and display_address(picking.partner_id,'default') ]] @@ -218,7 +218,7 @@ [[ picking.origin or '']] - [[ (picking.address_id and picking.address_id.title.name) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]] + [[ (picking.partner_id and picking.partner_id.title.name) or '' ]] [[ (picking.partner_id and picking.partner_id.name) or '' ]] [[ formatLang(picking.min_date,date_time = True) ]] diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index 2b6b844872a..da6be7873c3 100644 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -76,7 +76,7 @@ class report_stock_move(osv.osv): al.product_qty, al.out_qty as product_qty_out, al.in_qty as product_qty_in, - al.address_id as partner_id, + al.partner_id as partner_id, al.product_id as product_id, al.state as state , al.product_uom as product_uom, @@ -113,7 +113,7 @@ class report_stock_move(osv.osv): sm.location_dest_id as location_dest_id, sum(sm.product_qty) as product_qty, pt.categ_id as categ_id , - sm.address_id as address_id, + sm.partner_id as partner_id, sm.product_id as product_id, sm.picking_id as picking_id, sm.company_id as company_id, @@ -129,7 +129,7 @@ class report_stock_move(osv.osv): LEFT JOIN product_uom pu2 ON (sm.product_uom=pu2.id) LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id) GROUP BY - sm.id,sp.type, sm.date,sm.address_id, + sm.id,sp.type, sm.date,sm.partner_id, sm.product_id,sm.state,sm.product_uom,sm.date_expected, sm.product_id,pt.standard_price, sm.picking_id, sm.product_qty, sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id,pu.factor,pt.categ_id, sp.stock_journal_id) @@ -137,7 +137,7 @@ class report_stock_move(osv.osv): GROUP BY al.out_qty,al.in_qty,al.curr_year,al.curr_month, al.curr_day,al.curr_day_diff,al.curr_day_diff1,al.curr_day_diff2,al.dp,al.location_id,al.location_dest_id, - al.address_id,al.product_id,al.state,al.product_uom, + al.partner_id,al.product_id,al.state,al.product_uom, al.picking_id,al.company_id,al.type,al.product_qty, al.categ_id, al.stock_journal ) """) @@ -173,7 +173,7 @@ class report_stock_inventory(osv.osv): CREATE OR REPLACE view report_stock_inventory AS ( (SELECT min(m.id) as id, m.date as date, - m.address_id as partner_id, m.location_id as location_id, + m.partner_id as partner_id, m.location_id as location_id, m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, m.company_id, m.state as state, m.prodlot_id as prodlot_id, @@ -190,12 +190,12 @@ CREATE OR REPLACE view report_stock_inventory AS ( LEFT JOIN product_uom u ON (m.product_uom=u.id) LEFT JOIN stock_location l ON (m.location_id=l.id) GROUP BY - m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id, + m.id, m.product_id, m.product_uom, pt.categ_id, m.partner_id, m.location_id, m.location_dest_id, m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id ) UNION ALL ( SELECT -m.id as id, m.date as date, - m.address_id as partner_id, m.location_dest_id as location_id, + m.partner_id as partner_id, m.location_dest_id as location_id, m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, m.company_id, m.state as state, m.prodlot_id as prodlot_id, @@ -211,7 +211,7 @@ CREATE OR REPLACE view report_stock_inventory AS ( LEFT JOIN product_uom u ON (m.product_uom=u.id) LEFT JOIN stock_location l ON (m.location_dest_id=l.id) GROUP BY - m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id, + m.id, m.product_id, m.product_uom, pt.categ_id, m.partner_id, m.location_id, m.location_dest_id, m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id ) ); diff --git a/addons/stock/stock.py b/addons/stock/stock.py index ae3d23a0364..9753c1a3e05 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -190,7 +190,7 @@ class stock_location(osv.osv): 'chained_picking_type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', help="Shipping Type of the Picking List that will contain the chained move (leave empty to automatically detect the type based on the source and destination locations)."), 'chained_company_id': fields.many2one('res.company', 'Chained Company', help='The company the Picking List containing the chained move will belong to (leave empty to use the default company determination rules'), 'chained_delay': fields.integer('Chaining Lead Time',help="Delay between original move and chained move in days"), - 'address_id': fields.many2one('res.partner', 'Location Address',help="Address of customer or supplier."), + 'partner_id': fields.many2one('res.partner', 'Location Address',help="Address of customer or supplier."), 'icon': fields.selection(tools.icons, 'Icon', size=64,help="Icon show in hierarchical tree view"), 'comment': fields.text('Additional Information'), @@ -646,7 +646,7 @@ class stock_picking(osv.osv): store=True, type='datetime', string='Max. Expected Date', select=2), 'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}), 'auto_picking': fields.boolean('Auto-Picking'), - 'address_id': fields.many2one('res.partner', 'Address', help="Address of partner"), + 'partner_id': fields.many2one('res.partner', 'Partner'), 'invoice_state': fields.selection([ ("invoiced", "Invoiced"), ("2binvoiced", "To Be Invoiced"), @@ -876,7 +876,7 @@ class stock_picking(osv.osv): @param picking: object of the picking for which we are selecting the partner to invoice @return: object of the partner to invoice """ - return picking.address_id and picking.address_id.id + return picking.partner_id and picking.partner_id.id def _get_comment_invoice(self, cr, uid, picking): """ @@ -916,11 +916,11 @@ class stock_picking(osv.osv): else: taxes = move_line.product_id.taxes_id - if move_line.picking_id and move_line.picking_id.address_id and move_line.picking_id.address_id.id: + if move_line.picking_id and move_line.picking_id.partner_id and move_line.picking_id.partner_id.id: return self.pool.get('account.fiscal.position').map_tax( cr, uid, - move_line.picking_id.address_id.property_account_position, + move_line.picking_id.partner_id.property_account_position, taxes ) else: @@ -1176,7 +1176,7 @@ class stock_picking(osv.osv): def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking - like partner_id, address_id, delivery_date, + like partner_id, partner_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ @@ -1276,7 +1276,7 @@ class stock_picking(osv.osv): { 'product_qty' : move.product_qty - partial_qty[move.id], 'product_uos_qty': move.product_qty - partial_qty[move.id], #TODO: put correct uos_qty - + }) if new_picking: @@ -1378,7 +1378,7 @@ class stock_production_lot(osv.osv): name = '%s [%s]' % (name, record['ref']) res.append((record['id'], name)) return res - + def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): args = args or [] ids = [] @@ -1579,7 +1579,7 @@ class stock_move(osv.osv): 'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True,states={'done': [('readonly', True)]}, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."), 'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True,states={'done': [('readonly', True)]}, select=True, help="Location where the system will stock the finished products."), - 'address_id': fields.many2one('res.partner', 'Destination Address ', states={'done': [('readonly', True)]}, help="Optional address where goods are to be delivered, specifically used for allotment"), + 'partner_id': fields.many2one('res.partner', 'Destination Address ', states={'done': [('readonly', True)]}, help="Optional address where goods are to be delivered, specifically used for allotment"), 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', states={'done': [('readonly', True)]}, help="Production lot is used to put a serial number on the production", select=True), 'tracking_id': fields.many2one('stock.tracking', 'Pack', select=True, states={'done': [('readonly', True)]}, help="Logistical shipping unit: pallet, box, pack ..."), @@ -1800,19 +1800,19 @@ class stock_move(osv.osv): return {'value': result} def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, - loc_dest_id=False, address_id=False): + loc_dest_id=False, partner_id=False): """ On change of product id, if finds UoM, UoS, quantity and UoS quantity. @param prod_id: Changed Product id @param loc_id: Source location id @param loc_dest_id: Destination location id - @param address_id: Address id of partner + @param partner_id: Address id of partner @return: Dictionary of values """ if not prod_id: return {} lang = False - if address_id: - addr_rec = self.pool.get('res.partner').browse(cr, uid, address_id) + if partner_id: + addr_rec = self.pool.get('res.partner').browse(cr, uid, partner_id) if addr_rec: lang = addr_rec and addr_rec.lang or False ctx = {'lang': lang} @@ -1854,7 +1854,7 @@ class stock_move(osv.osv): cr, uid, m.location_dest_id, - m.picking_id and m.picking_id.address_id and m.picking_id.address_id, + m.picking_id and m.picking_id.partner_id and m.picking_id.partner_id, m.product_id, context ) @@ -1905,7 +1905,7 @@ class stock_move(osv.osv): 'auto_picking': moves_todo[0][1][1] == 'auto', 'stock_journal_id': moves_todo[0][1][3], 'company_id': moves_todo[0][1][4] or res_company._company_default_get(cr, uid, 'stock.company', context=context), - 'address_id': picking.address_id.id, + 'partner_id': picking.partner_id.id, 'invoice_state': 'none', 'date': picking.date, } @@ -2261,7 +2261,7 @@ class stock_move(osv.osv): processing of the given stock move. """ # prepare default values considering that the destination accounts have the reference_currency_id as their main currency - partner_id = (move.picking_id.address_id and move.picking_id.address_id.id and move.picking_id.address_id.id) or False + partner_id = (move.picking_id.partner_id and move.picking_id.partner_id.id and move.picking_id.partner_id.id) or False debit_line_vals = { 'name': move.name, 'product_id': move.product_id and move.product_id.id or False, @@ -2493,7 +2493,7 @@ class stock_move(osv.osv): def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking - like partner_id, address_id, delivery_date, delivery + like partner_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} @@ -2680,7 +2680,7 @@ class stock_inventory(osv.osv): 'prodlot_id': lot_id, 'date': inv.date, } - + if change > 0: value.update( { 'product_qty': change, @@ -2772,7 +2772,7 @@ class stock_warehouse(osv.osv): _columns = { 'name': fields.char('Name', size=128, required=True, select=True), 'company_id': fields.many2one('res.company', 'Company', required=True, select=True), - 'partner_address_id': fields.many2one('res.partner', 'Owner Address'), + 'partner_id': fields.many2one('res.partner', 'Owner Address'), 'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True, domain=[('usage','<>','view')]), 'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True, domain=[('usage','=','internal')]), 'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True, domain=[('usage','<>','view')]), diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml index 5372ab6216b..ec0860f62c7 100644 --- a/addons/stock/stock_demo.xml +++ b/addons/stock/stock_demo.xml @@ -5,7 +5,7 @@ - + @@ -42,7 +42,7 @@ Shelf 1 - +