[FIX] Account: [6.0]changing company currency breaks analytic account
bzr revid: ara@tinyerp.com-20110311120335-l1one4lu0fxg8die
This commit is contained in:
parent
aad6253cf3
commit
27981af337
|
@ -180,7 +180,6 @@ class account_analytic_account(osv.osv):
|
|||
\n* And finally when all the transactions are over, it can be in \'Close\' state. \
|
||||
\n* The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\
|
||||
\n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'),
|
||||
#'currency_id': fields.many2one('res.currency', 'Account currency', required=True),
|
||||
'currency_id': fields.function(_currency, fnct_inv=_set_company_currency, method=True,
|
||||
store = {
|
||||
'res.company': (_get_company_currency, ['currency_id'], 10),
|
||||
|
@ -208,20 +207,12 @@ class account_analytic_account(osv.osv):
|
|||
'currency_id': _get_default_currency,
|
||||
}
|
||||
|
||||
# def check_currency(self, cr, uid, ids, context=None):
|
||||
# obj = self.browse(cr, uid, ids[0], context=context)
|
||||
# if obj.company_id:
|
||||
# if obj.currency_id.id != self.pool.get('res.company').browse(cr, uid, obj.company_id.id, context=context).currency_id.id:
|
||||
# return False
|
||||
# return True
|
||||
|
||||
def check_recursion(self, cr, uid, ids, parent=None):
|
||||
return super(account_analytic_account, self)._check_recursion(cr, uid, ids, parent=parent)
|
||||
|
||||
_order = 'date_start desc,parent_id desc,code'
|
||||
_constraints = [
|
||||
(check_recursion, 'Error! You can not create recursive analytic accounts.', ['parent_id']),
|
||||
# (check_currency, 'Error! The currency has to be the same as the currency of the selected company', ['currency_id', 'company_id']),
|
||||
]
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
|
|
Loading…
Reference in New Issue