[MERGE] Merge BDE's branch to fetch currency on the base of country in company

bzr revid: pso@tinyerp.com-20120807123938-mf6isae0dmca5mal
This commit is contained in:
pso (OpenERP) 2012-08-07 18:09:38 +05:30
commit da07452529
2 changed files with 7 additions and 2 deletions

View File

@ -145,7 +145,12 @@ class res_company(osv.osv):
if vat: val.append(_('VAT: ')+vat)
if reg: val.append(_('Reg: ')+reg)
return {'value': {'rml_footer1':' | '.join(val)}}
def on_change_country(self, cr, uid, ids, country_id, context=None):
currency_id = self._get_euro(cr, uid, context=context)
if country_id:
currency_id = self.pool.get('res.country').browse(cr, uid, country_id, context=context).currency_id.id
return {'value': {'currency_id': currency_id}}
def _search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False, access_rights_uid=None):

View File

@ -54,7 +54,7 @@
<field name="state_id" class="oe_no_button" placeholder="State" style="width: 24%%"/>
<field name="zip" placeholder="ZIP" style="width: 34%%"/>
</div>
<field name="country_id" placeholder="Country" class="oe_no_button"/>
<field name="country_id" placeholder="Country" class="oe_no_button" on_change="on_change_country(country_id)"/>
</div>
<field name="website" widget="url" placeholder="e.g. www.openerp.com"/>
</group>