[IMP] : rename address_id with parnter_id

bzr revid: sbh@tinyerp.com-20120330081136-gyllf3gx180clebd
This commit is contained in:
Sbh (Openerp) 2012-03-30 13:41:36 +05:30
parent 1078da6717
commit d494230c87
9 changed files with 28 additions and 28 deletions

View File

@ -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:

View File

@ -3,7 +3,7 @@
<act_window id="action_claim_from_delivery" name="Claim"
domain="[]" target="current"
context="{'default_partner_address_id': address_id, 'default_partner_id': partner_id}"
context="{'default_partner_id': partner_id}"
view_mode="form" res_model="crm.claim"
src_model="stock.picking" />

View File

@ -189,7 +189,7 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_form"/>
<field name="arch" type="xml">
<field name="address_id" position="after">
<field name="partner_id" position="after">
<field name="carrier_id"/>
<field name="carrier_tracking_ref" groups="base.group_extended"/>
<field name="number_of_packages" groups="base.group_extended"/>

View File

@ -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)

View File

@ -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.") % (

View File

@ -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,

View File

@ -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!'

View File

@ -1,5 +1,5 @@
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
@ -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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -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 ?

View File

@ -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: