Hi !
I try to add the currency symbol after a float field, but I'm stuck. Here's my code :
The python file:
def _get_your_company_currency(self, cr, uid, ids, field, args, context=None):
res = {}
for sr in self.browse(cr, uid, ids, context=None):
res[sr.id] = self.pool.get('res.company').browse(cr, uid, sr.partner_id).currency_id
return res
_columns = {
'partner_id': fields.many2one('res.partner', 'Company', required=True),
'cost': fields.float('Shipping cost', required=True),
'currency_id': fields.function(_get_your_company_currency, type='char', method=True, string='Currency', readonly=True)
}
The xml:
<field name="cost" class="oe_inline" widget="monetary" options="{'currency_field': 'currency_id'}" />
Thanks in advance !
Edit : python file edited, issue still not solved
Edit 2 : I've also add this line to my xml file :
<field name="currency_id" invisible="1" />
Edit title
Better explanation Ok, I will explain my problem better... The company is a partner with the checkbox "Is company ?" checked. It's not "Your company", it's a supplier. I just need to put the currency symbol of my supplier into the form.
Nobody have any idea about how to solve this ?