[REF] purchase, purchase_analytic_plans, account_anglo_saxon: changed name of function inv_line_create into prepare_inv_line

bzr revid: qdp-launchpad@openerp.com-20111115114839-3359yjv7vw0t8krn
This commit is contained in:
Quentin (OpenERP) 2011-11-15 12:48:39 +01:00
parent c456e61699
commit 9a3f03efe7
3 changed files with 7 additions and 7 deletions

View File

@ -26,8 +26,8 @@ class purchase_order(osv.osv):
_inherit = "purchase.order"
_description = "Purchase Order"
def inv_line_create(self, cr, uid, account_id, order_line, context=None):
line = super(purchase_order, self).inv_line_create(cr, uid, account_id, order_line, context=context)
def prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
line = super(purchase_order, self).prepare_inv_line(cr, uid, account_id, order_line, context=context)
if ol.product_id and not ol.product_id.type == 'service':
oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id
if not oa:

View File

@ -320,7 +320,7 @@ class purchase_order(osv.osv):
'ref_doc1': 'purchase.order,%d' % (po.id,),
})
def inv_line_create(self, cr, uid, account_id, order_line, context=None):
def prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
"""Collects require data from purchase order line that is used to create invoice line
for that purchase order line
:param account_id: Expense account of the product of PO line if any.
@ -373,7 +373,7 @@ class purchase_order(osv.osv):
if not journal_ids:
raise osv.except_osv(_('Error !'),
_('There is no purchase journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
# generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line
inv_lines = []
for po_line in order.order_line:
@ -388,7 +388,7 @@ class purchase_order(osv.osv):
fpos = order.fiscal_position or False
acc_id = fiscal_obj.map_account(cr, uid, fpos, acc_id)
inv_line_data = self.inv_line_create(cr, uid, acc_id, po_line, context=context)
inv_line_data = self.prepare_inv_line(cr, uid, acc_id, po_line, context=context)
inv_line_id = inv_line_obj.create(cr, uid, inv_line_data, context=context)
inv_lines.append(inv_line_id)

View File

@ -35,8 +35,8 @@ class purchase_order(osv.osv):
_name='purchase.order'
_inherit='purchase.order'
def inv_line_create(self, cr, uid, account_id, order_line, context=None):
res = super(purchase_order, self).inv_line_create(cr, uid, account_id, order_line, context=context)
def prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
res = super(purchase_order, self).prepare_inv_line(cr, uid, account_id, order_line, context=context)
res['analytics_id'] = order_line.analytics_id.id
return res