~camptocamp/openobject-server/5.0-c2c-official

« back to all changes in this revision

Viewing changes to bin/addons/base/res/res_currency.py

  • Committer: Vincent Renaville
  • Date: 2010-07-12 13:09:40 UTC
  • mfrom: (1760.32.219 server)
  • Revision ID: vincent.renaville@camptocamp.com-20100712130940-jm5wga57k1yxidbc
[MRG] to 5.0.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
    def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None, account_invert=False):
78
78
        if not from_currency_id:
79
79
            from_currency_id = to_currency_id
80
 
        xc=self.browse(cr, uid, [from_currency_id,to_currency_id], context=context)
 
80
        if not to_currency_id:
 
81
            to_currency_id = from_currency_id
 
82
        xc = self.browse(cr, uid, [from_currency_id,to_currency_id], context=context)
81
83
        from_currency = (xc[0].id == from_currency_id and xc[0]) or xc[1]
82
84
        to_currency = (xc[0].id == to_currency_id and xc[0]) or xc[1]
83
85
        if from_currency['rate'] == 0 or to_currency['rate'] == 0: