[IMP] multi-currency stuff

bzr revid: fp@tinyerp.com-20121215162309-yav3g8hu50bp9wvv
This commit is contained in:
Fabien Pinckaers 2012-12-15 17:23:09 +01:00
parent eabbbd247b
commit d9b7d8155e
2 changed files with 21 additions and 6 deletions

View File

@ -3348,10 +3348,25 @@ class wizard_multi_charts_accounts(osv.osv_memory):
all the provided information to create the accounts, the banks, the journals, the taxes, the tax codes, the all the provided information to create the accounts, the banks, the journals, the taxes, the tax codes, the
accounting properties... accordingly for the chosen company. accounting properties... accordingly for the chosen company.
''' '''
obj_data = self.pool.get('ir.model.data')
ir_values_obj = self.pool.get('ir.values') ir_values_obj = self.pool.get('ir.values')
obj_wizard = self.browse(cr, uid, ids[0]) obj_wizard = self.browse(cr, uid, ids[0])
company_id = obj_wizard.company_id.id company_id = obj_wizard.company_id.id
self.pool.get('res.company').write(cr, uid, [company_id], {'currency_id': obj_wizard.currency_id.id}) self.pool.get('res.company').write(cr, uid, [company_id], {'currency_id': obj_wizard.currency_id.id})
# When we install the CoA of first company, set the currency to price types and pricelists
if company_id==1:
for ref in (('product','list_price'),('product','standard_price'),('product','list0'),('purchase','list0')):
try:
tmp2 = obj_data.get_object_reference(cr, uid, *ref)
if tmp2:
self.pool.get(tmp2[0]).write(cr, uid, tmp2[1], {
'currency_id': obj_wizard.currency_id.id
})
except ValueError, e:
pass
# If the floats for sale/purchase rates have been filled, create templates from them # If the floats for sale/purchase rates have been filled, create templates from them
self._create_tax_templates_from_rates(cr, uid, obj_wizard, company_id, context=context) self._create_tax_templates_from_rates(cr, uid, obj_wizard, company_id, context=context)

View File

@ -133,7 +133,7 @@
</blockTable> </blockTable>
<section> <section>
<para style="terp_default_9">[[ repeatIn(order.order_line,'order_line') ]]</para> <para style="terp_default_9">[[ repeatIn(order.order_line,'order_line') ]]</para>
<blockTable colWidths="370.0,100.0,39.0,20.0" style="Table_Product_Line"> <blockTable colWidths="371.0,98.0,61.0" style="Table_Product_Line">
<tr> <tr>
<td> <td>
<para style="terp_default_9">[[ order_line.name ]]</para> <para style="terp_default_9">[[ order_line.name ]]</para>
@ -142,10 +142,10 @@
<para style="terp_default_Centre_9">[[ formatLang(order_line.date_planned, date = True) ]]</para> <para style="terp_default_Centre_9">[[ formatLang(order_line.date_planned, date = True) ]]</para>
</td> </td>
<td> <td>
<para style="terp_default_Right_9">[[ formatLang(order_line.product_qty )]]</para> <para style="terp_default_Right_9">
</td> [[ formatLang(order_line.product_qty )]]
<td> <i>[[ (order_line.product_uom and order_line.product_uom.name) or '' ]]</i>
<para style="terp_default_Right_9">[[ (order_line.product_uom and order_line.product_uom.name) or '' ]]</para> </para>
</td> </td>
</tr> </tr>
</blockTable> </blockTable>
@ -166,4 +166,4 @@
</para> </para>
<para style="terp_default_9">[[ user.signature or '' ]]</para> <para style="terp_default_9">[[ user.signature or '' ]]</para>
</story> </story>
</document> </document>