8000 fix(parts/account-consolidation): Remove the attributte currency_rate… by ManulReyes · Pull Request #9 · OCA/account-consolidation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(parts/account-consolidation): Remove the attributte currency_rate… #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 7.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions account_consolidation/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ class account_account(orm.Model):
_inherit = 'account.account'

_columns = {
'consolidation_rate_type_id': fields.many2one(
'res.currency.rate.type',
'Consolidation Currency Rate Type',
help="Currency rate type used on this account "
"for the consolidation. "
"Leave empty to use the rate type of the account type."),

'consolidation_mode': fields.selection(
[('ytd', 'YTD'),
('period', 'Period Movements')],
Expand All @@ -45,13 +38,6 @@ class account_account_type(orm.Model):
_inherit = 'account.account.type'

_columns = {
'consolidation_rate_type_id': fields.many2one(
'res.currency.rate.type',
'Consolidation Currency Rate Type',
help="Currency rate type used on this account type "
"for the consolidation. "
"Leave empty to use the 'spot' rate type."),

'consolidation_mode': fields.selection(
[('ytd', 'YTD'),
('period', 'Period Movements')],
Expand Down
2 changes: 0 additions & 2 deletions account_consolidation/account_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<xpath expr="//field[@name='note']" position="after">
<group groups="account_consolidation.consolidation_manager">
<separator string="Consolidation" colspan="2"/>
<field name="consolidation_rate_type_id" widget="selection"/>
<field name="consolidation_mode"/>
</group>
</xpath>
Expand All @@ -30,7 +29,6 @@
<separator string="Description" position="before">
<group col="2" colspan="2" groups="account_consolidation.consolidation_manager">
<separator string="Consolidation" colspan="4"/>
<field name="consolidation_rate_type_id" widget="selection"/>
<field name="consolidation_mode"/>
</group>
</separator>
Expand Down
21 changes: 0 additions & 21 deletions account_consolidation/wizard/consolidation_consolidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,6 @@ def on_change_from_period_id(self, cr, uid, ids, from_period_id,
result['fiscalyear_id'] = from_period.fiscalyear_id.id
return {'value': result}

def _currency_rate_type(self, cr, uid, ids, account, context=None):
"""
Returns the currency rate type to use

:param account: browse_record instance of account.account

:return: id of the currency rate type to use
"""
if account.consolidation_rate_type_id:
return account.consolidation_rate_type_id.id

elif account.user_type.consolidation_rate_type_id:
return account.user_type.consolidation_rate_type_id.id

else:
return False

def _consolidation_mode(self, cr, uid, ids, account, context=None):
"""
Returns the consolidation mode to use
Expand Down Expand Up @@ -277,15 +260,11 @@ def consolidate_account(self, cr, uid, ids, consolidation_mode,
'credit': abs(balance) if balance < 0.0 else 0.0,
})
else:
currency_rate_type = self._currency_rate_type(cr, uid, ids,
holding_account, context=context)

currency_value = currency_obj.compute(cr, uid,
holding_account.company_currency_id.id,
subs_account.company_currency_id.id,
balance,
currency_rate_type_from=False, # means spot
currency_rate_type_to=currency_rate_type,
context=context)
vals.update({
'currency_id': subs_account.company_currency_id.id,
Expand Down
0