fix bug number : 327990 for fiscal position added at the time of creating invoice from sale,purchase,and other modules
bzr revid: mra@tinyerp.com-20090211133254-xnp20b9tsbo28v35
This commit is contained in:
parent
4aa00ae64b
commit
759cead482
|
@ -113,6 +113,7 @@ def _makeInvoices(self, cr, uid, data, context):
|
|||
'currency_id' :reg.partner_invoice_id.property_product_pricelist.currency_id.id,
|
||||
'comment': "",
|
||||
'payment_term':reg.partner_invoice_id.property_payment_term.id,
|
||||
'fiscal_position': reg.partner_invoice_id.property_account_position.id
|
||||
}
|
||||
|
||||
inv_obj = pool_obj.get('account.invoice')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -152,6 +152,7 @@ class hr_expense_expense(osv.osv):
|
|||
'price_type': 'tax_included',
|
||||
'currency_id': exp.currency_id.id,
|
||||
'payment_term': payment_term_id,
|
||||
'fiscal_position': exp.employee_id.address_id.partner_id.property_account_position.id
|
||||
}
|
||||
if payment_term_id:
|
||||
to_update = invoice_obj.onchange_payment_term_date_invoice(cr, uid, [],
|
||||
|
|
|
@ -71,6 +71,7 @@ class final_invoice_create(wizard.interface):
|
|||
'account_id': partner.property_account_receivable.id,
|
||||
'currency_id': account.pricelist_id.currency_id.id,
|
||||
'date_due': date_due,
|
||||
'fiscal_position': account.partner_id.property_account_position.id
|
||||
}
|
||||
last_invoice = pool.get('account.invoice').create(cr, uid, curr_invoice)
|
||||
invoices.append(last_invoice)
|
||||
|
|
|
@ -79,6 +79,7 @@ class invoice_create(wizard.interface):
|
|||
'account_id': partner.property_account_receivable.id,
|
||||
'currency_id': account.pricelist_id.currency_id.id,
|
||||
'date_due': date_due,
|
||||
'fiscal_position': account.partner_id.property_account_position.id
|
||||
}
|
||||
last_invoice = pool.get('account.invoice').create(cr, uid, curr_invoice)
|
||||
invoices.append(last_invoice)
|
||||
|
@ -129,11 +130,11 @@ class invoice_create(wizard.interface):
|
|||
# Compute for lines
|
||||
#
|
||||
cr.execute("SELECT * " # TODO optimize this
|
||||
" FROM account_analytic_line"
|
||||
" FROM account_analytic_line"
|
||||
" WHERE account_id=%%s"
|
||||
" AND id IN (%s)"
|
||||
" AND product_id=%%s"
|
||||
" AND to_invoice=%%s" % ','.join(['%s']*len(data['ids'])),
|
||||
" AND to_invoice=%%s" % ','.join(['%s']*len(data['ids'])),
|
||||
(account.id, data['ids'], product_id, factor_id))
|
||||
line_ids = cr.dictfetchall()
|
||||
note = []
|
||||
|
|
|
@ -364,10 +364,10 @@ class Partner(osv.osv):
|
|||
'member_lines': fields.one2many('membership.membership_line', 'partner', 'Membership'),
|
||||
'free_member': fields.boolean('Free member'),
|
||||
'membership_amount': fields.float(
|
||||
'Membership amount', digites=(16, 2),
|
||||
'Membership amount', digites=(16, 2),
|
||||
help='The price negociated by the partner'),
|
||||
'membership_state': fields.function(
|
||||
_membership_state, method = True,
|
||||
_membership_state, method = True,
|
||||
string = 'Current membership state', type = 'selection',
|
||||
selection = STATE ,store = {
|
||||
'account.invoice':(_get_invoice_partner,['state'], 10),
|
||||
|
@ -385,8 +385,8 @@ class Partner(osv.osv):
|
|||
}
|
||||
),
|
||||
'membership_stop': fields.function(
|
||||
_membership_stop, method = True,
|
||||
string = 'Stop membership date', type = 'date',
|
||||
_membership_stop, method = True,
|
||||
string = 'Stop membership date', type = 'date',
|
||||
store = {
|
||||
'account.invoice':(_get_invoice_partner,['state'], 10),
|
||||
'membership.membership_line':(_get_partner_id,['state'], 10),
|
||||
|
@ -760,7 +760,7 @@ class account_invoice_line(osv.osv):
|
|||
if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to:
|
||||
date_from = line.invoice_id.date_invoice
|
||||
line_id = member_line_obj.create(cr, uid, {
|
||||
'partner': line.invoice_id.partner_id.id,
|
||||
'partner': line.invoice_id.partner_id and line.invoice_id.partner_id.id or False,
|
||||
'date_from': date_from,
|
||||
'date_to': date_to,
|
||||
'account_invoice_line': line.id,
|
||||
|
|
|
@ -78,7 +78,8 @@ def _invoice_membership(self, cr, uid, data, context):
|
|||
'partner_id' : partner_id,
|
||||
'address_invoice_id': partner_address_ids[partner_id]['id'],
|
||||
'account_id': account_id,
|
||||
'invoice_line':[(6,0,[invoice_line_id])]
|
||||
'invoice_line':[(6,0,[invoice_line_id])],
|
||||
'fiscal_position': fpos_id or False
|
||||
}
|
||||
)
|
||||
invoice_list.append(invoice_id)
|
||||
|
|
|
@ -281,6 +281,7 @@ class mrp_repair(osv.osv):
|
|||
'address_invoice_id': repair.address_id.id,
|
||||
'currency_id': repair.pricelist_id.currency_id.id,
|
||||
'comment': repair.quotation_notes,
|
||||
'fiscal_position': repair.partner_id.property_account_position.id
|
||||
}
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
inv_id = inv_obj.create(cr, uid, inv)
|
||||
|
|
|
@ -306,7 +306,7 @@ class purchase_order(osv.osv):
|
|||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
|
||||
il.append(self.inv_line_create(a,ol))
|
||||
|
||||
a = o.partner_id.property_account_payable.id
|
||||
a = o.partner_id.property_account_payable.id
|
||||
journal_ids = journal_obj.search(cr, uid, [('type', '=','purchase')], limit=1)
|
||||
inv = {
|
||||
'name': o.partner_ref or o.name,
|
||||
|
@ -320,6 +320,7 @@ class purchase_order(osv.osv):
|
|||
'journal_id': len(journal_ids) and journal_ids[0] or False,
|
||||
'origin': o.name,
|
||||
'invoice_line': il,
|
||||
'fiscal_position': o.partner_id.property_account_position.id
|
||||
}
|
||||
inv_id = self.pool.get('account.invoice').create(cr, uid, inv, {'type':'in_invoice'})
|
||||
self.pool.get('account.invoice').button_compute(cr, uid, [inv_id], {'type':'in_invoice'}, set_total=True)
|
||||
|
|
|
@ -372,6 +372,7 @@ class sale_order(osv.osv):
|
|||
'currency_id' : order.pricelist_id.currency_id.id,
|
||||
'comment': order.note,
|
||||
'payment_term': pay_term,
|
||||
'fiscal_position': order.partner_id.property_account_position.id
|
||||
}
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
inv.update(self._inv_get(cr, uid, order))
|
||||
|
|
|
@ -87,6 +87,7 @@ def _createInvoices(self, cr, uid, data, context={}):
|
|||
'currency_id' :sale.pricelist_id.currency_id.id,
|
||||
'comment': '',
|
||||
'payment_term':sale.payment_term.id,
|
||||
'fiscal_position': sale.partner_id.property_account_position.id
|
||||
}
|
||||
inv_obj = pool_obj.get('account.invoice')
|
||||
inv_id = inv_obj.create(cr, uid, inv)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -61,6 +61,7 @@ def _makeInvoices(self, cr, uid, data, context):
|
|||
'currency_id' : order.pricelist_id.currency_id.id,
|
||||
'comment': order.note,
|
||||
'payment_term': pay_term,
|
||||
'fiscal_position': order.partner_id.property_account_position.id
|
||||
}
|
||||
inv_id = pool.get('account.invoice').create(cr, uid, inv)
|
||||
return inv_id
|
||||
|
|
|
@ -84,8 +84,8 @@ class stock_location(osv.osv):
|
|||
if 'stock_virtual' in field_names:
|
||||
res[loc]['stock_virtual'] = prod.virtual_available
|
||||
return res
|
||||
|
||||
|
||||
|
||||
|
||||
def product_detail(self, cr, uid, id, field):
|
||||
res = {}
|
||||
res[id] = {}
|
||||
|
@ -100,7 +100,7 @@ class stock_location(osv.osv):
|
|||
product = self.pool.get('product.product').read(cr, uid, r['product_id'], [field_to_read,'standard_price','name'])
|
||||
final_value += (product[field_to_read] * product['standard_price'])
|
||||
return final_value
|
||||
|
||||
|
||||
def _product_value(self, cr, uid, ids, field_names, arg, context={}):
|
||||
result = {}
|
||||
for id in ids:
|
||||
|
@ -110,7 +110,7 @@ class stock_location(osv.osv):
|
|||
ret_dict = self.product_detail(cr,uid,loc,field=field_name)
|
||||
result[loc][field_name] = ret_dict
|
||||
return result
|
||||
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Location Name', size=64, required=True, translate=True),
|
||||
'active': fields.boolean('Active'),
|
||||
|
@ -681,6 +681,7 @@ class stock_picking(osv.osv):
|
|||
'address_contact_id': address_contact_id,
|
||||
'comment': comment,
|
||||
'payment_term': payment_term_id,
|
||||
'fiscal_position': partner.property_account_position.id
|
||||
}
|
||||
cur_id = self.get_currency_id(cursor, user, picking)
|
||||
if cur_id:
|
||||
|
|
Loading…
Reference in New Issue