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/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_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 77b097cddd3..e70ca36651b 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -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/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml index 7c9626d1644..b0cd831ec8d 100644 --- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml +++ b/addons/stock_invoice_directly/test/stock_invoice_directly.yml @@ -5,7 +5,7 @@ I create an Outgoing Picking order. - !record {model: stock.picking, id: stock_picking_out0}: - address_id: base.res_partner_address_3000 + partner_id: base.res_partner_address_3000 invoice_state: 2binvoiced move_lines: - company_id: base.main_company @@ -55,7 +55,7 @@ !python {model: account.invoice}: | picking_obj = self.pool.get('stock.picking') picking = picking_obj.browse(cr, uid, [ref('stock_picking_out0')]) - partner = picking[0].address_id.id + partner = picking[0].partner_id.id inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner)]) assert inv_ids, 'No Invoice is generated!' diff --git a/addons/stock_location/procurement_pull.py b/addons/stock_location/procurement_pull.py index 0846fe067eb..33168a53e20 100644 --- a/addons/stock_location/procurement_pull.py +++ b/addons/stock_location/procurement_pull.py @@ -1,5 +1,5 @@ ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -14,7 +14,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 . # ############################################################################## @@ -63,7 +63,7 @@ class procurement_order(osv.osv): 'type': line.picking_type, 'stock_journal_id': line.journal_id and line.journal_id.id or False, 'move_type': 'one', - 'address_id': line.partner_address_id.id, + 'partner_id': line.partner_address_id.id, 'note': _('Picking for pulled procurement coming from original location %s, pull rule %s, via original Procurement %s (#%d)') % (proc.location_id.name, line.name, proc.name, proc.id), 'invoice_state': line.invoice_state, }) @@ -79,7 +79,7 @@ class procurement_order(osv.osv): or proc.product_qty, 'product_uos': (proc.product_uos and proc.product_uos.id)\ or proc.product_uom.id, - 'address_id': line.partner_address_id.id, + 'partner_id': line.partner_address_id.id, 'location_id': line.location_src_id.id, 'location_dest_id': line.location_id.id, 'move_dest_id': proc.move_id and proc.move_id.id or False, # to verif, about history ? diff --git a/addons/stock_location/test/stock_location_push_flow.yml b/addons/stock_location/test/stock_location_push_flow.yml index 3de87afccd1..abca846badc 100644 --- a/addons/stock_location/test/stock_location_push_flow.yml +++ b/addons/stock_location/test/stock_location_push_flow.yml @@ -65,7 +65,7 @@ In order to test pushed flow .I buy the product from Micro Link Technologies supplier. I create a Picking. - !record {model: stock.picking , id: stock_picking_in0}: - address_id: res_partner_address_0 + partner_id: res_partner_address_0 company_id: base.main_company invoice_state: none move_lines: