bzr revid: fp@tinyerp.com-20081024144733-qxsdkum4c8arcb5a
This commit is contained in:
Fabien Pinckaers 2008-10-24 16:47:33 +02:00
parent fecfe88f88
commit 6b87952e23
4 changed files with 10 additions and 6 deletions

View File

@ -663,7 +663,6 @@
<field name="readonly" select="2"/>
<field name="select_level"/>
<field name="translate"/>
<field name="relate"/>
<field name="on_delete" attrs="{'readonly': [('ttype','!=','many2one')]}"/>
</group>
<separator string="Security on Groups" colspan="4"/>
@ -742,7 +741,6 @@
<field name="readonly" select="2"/>
<field name="select_level"/>
<field name="translate"/>
<field name="relate"/>
<field name="on_delete" attrs="{'readonly': [('ttype','!=','many2one')]}"/>
</group>
</page>

View File

@ -527,5 +527,10 @@
</record>
<menuitem action="action_partner_category_form" id="menu_partner_category_form" parent="base.menu_base_config"/>
<act_window domain="[('partner_id', '=', active_id)]"
id="act_res_partner_event" name="Events"
res_model="res.partner.event"
src_model="res.partner"/>
</data>
</openerp>

View File

@ -79,7 +79,7 @@ class res_currency(osv.osv):
def is_zero(self, cr, uid, currency, amount):
return abs(self.round(cr, uid, currency, amount)) < currency.rounding
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None):
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None, account_invert=False):
if not from_currency_id:
from_currency_id = to_currency_id
xc=self.browse(cr, uid, [from_currency_id,to_currency_id], context=context)
@ -100,8 +100,10 @@ class res_currency(osv.osv):
cr.execute('select sum(debit-credit),sum(amount_currency) from account_move_line l ' \
'where l.currency_id=%d and l.account_id=%d and '+q, (account.currency_id.id,account.id,))
tot1,tot2 = cr.fetchone()
if tot2:
if tot2 and not account_invert:
rate = float(tot1)/float(tot2)
elif tot1 and account_invert:
rate = float(tot2)/float(tot1)
if to_currency_id==from_currency_id:
if round:
return self.round(cr, uid, to_currency, from_amount)

View File

@ -1542,6 +1542,7 @@ class orm(orm_template):
def __init__(self, cr):
super(orm, self).__init__(cr)
self._columns = self._columns.copy()
f = filter(lambda a: isinstance(self._columns[a], fields.function) and self._columns[a].store, self._columns)
if f:
list_store = []
@ -1587,8 +1588,6 @@ class orm(orm_template):
'translate': (field['translate']),
#'select': int(field['select_level'])
}
#if field['relation']:
# attrs['relation'] = field['relation']
if field['ttype'] == 'selection':
self._columns[field['name']] = getattr(fields, field['ttype'])(eval(field['selection']), **attrs)
elif field['ttype'] == 'many2one':