parent
c3d444adab
commit
049cf5bd8d
|
@ -2610,6 +2610,24 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
res['value']["purchase_tax"] = purchase_tax_ids and purchase_tax_ids[0] or False
|
||||
return res
|
||||
|
||||
def _get_purchase_tax(self, cr, uid, context=None):
|
||||
ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
|
||||
if ids:
|
||||
chart_template_id = ids[0]
|
||||
purchase_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id"
|
||||
, "=", chart_template_id), ('type_tax_use', 'in', ('purchase','all'))], order="sequence")
|
||||
return purchase_tax_ids[0]
|
||||
return False
|
||||
|
||||
def _get_sale_tax(self, cr, uid, context=None):
|
||||
ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
|
||||
if ids:
|
||||
chart_template_id = ids[0]
|
||||
sale_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id"
|
||||
, "=", chart_template_id), ('type_tax_use', 'in', ('sale','all'))], order="sequence")
|
||||
return sale_tax_ids[0]
|
||||
return False
|
||||
|
||||
def _get_chart(self, cr, uid, context=None):
|
||||
ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
|
||||
if ids:
|
||||
|
@ -2626,6 +2644,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, [uid], c)[0].company_id.id,
|
||||
'chart_template_id': _get_chart,
|
||||
'bank_accounts_id': _get_default_accounts,
|
||||
'sale_tax': _get_sale_tax,
|
||||
'purchase_tax': _get_purchase_tax,
|
||||
'code_digits': 6,
|
||||
'seq_journal': True
|
||||
}
|
||||
|
|
|
@ -126,9 +126,9 @@ class purchase_line_invoice(osv.osv_memory):
|
|||
else:
|
||||
a = property_obj.get(cr, uid,
|
||||
'property_account_expense_categ', 'product.category',
|
||||
context=context)
|
||||
context=context).id
|
||||
fpos = line.order_id.fiscal_position or False
|
||||
a = account_fiscal_obj.map_account(cr, uid, fpos, a).id
|
||||
a = account_fiscal_obj.map_account(cr, uid, fpos, a)
|
||||
inv_id = invoice_line_obj.create(cr, uid, {
|
||||
'name': line.name,
|
||||
'origin': line.order_id.name,
|
||||
|
|
Loading…
Reference in New Issue