mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Merge pull request #159 from gurneyalex/7.0-fix-travis
fix travis (flake8)
This commit is contained in:
@@ -824,10 +824,14 @@ class account_asset_asset(orm.Model):
|
||||
asset_value = self._asset_value_compute(
|
||||
cr, uid, asset, context)
|
||||
for rec in record.child_ids:
|
||||
asset_value += \
|
||||
rec.type == 'normal' and \
|
||||
self._asset_value_compute(cr, uid, rec, context) or \
|
||||
_value_get(rec)
|
||||
if rec.type == 'normal':
|
||||
value = self._asset_value_compute(cr,
|
||||
uid,
|
||||
rec,
|
||||
context)
|
||||
else:
|
||||
value = _value_get(rec)
|
||||
asset_value += value
|
||||
return asset_value
|
||||
res[asset.id] = _value_get(asset)
|
||||
return res
|
||||
|
||||
@@ -258,8 +258,9 @@ class account_asset_remove(orm.TransientModel):
|
||||
}
|
||||
move_lines.append((0, 0, move_line_vals))
|
||||
balance = wiz_data.sale_value - residual_value
|
||||
account_id = balance > 0 and wiz_data.account_plus_value_id.id \
|
||||
or wiz_data.account_min_value_id.id
|
||||
account_id = (wiz_data.account_plus_value_id.id
|
||||
if balance > 0
|
||||
else wiz_data.account_min_value_id.id)
|
||||
move_line_vals = {
|
||||
'name': asset.name,
|
||||
'account_id': account_id,
|
||||
|
||||
@@ -1159,9 +1159,9 @@ class wizard_update_charts_accounts(orm.TransientModel):
|
||||
'shortcut': account_template.shortcut,
|
||||
'note': account_template.note,
|
||||
'parent_id': (
|
||||
account_template.parent_id
|
||||
and account_template_mapping.get(p_id) or
|
||||
False
|
||||
account_template_mapping.get(p_id)
|
||||
if account_template.parent_id
|
||||
else False
|
||||
),
|
||||
'tax_ids': [(6, 0, tax_ids)],
|
||||
'company_id': wizard.company_id.id,
|
||||
|
||||
@@ -154,7 +154,8 @@ class CreditControlRun(orm.Model):
|
||||
)
|
||||
generated_ids.extend(policy_generated_ids)
|
||||
if policy_generated_ids:
|
||||
report += _("Policy \"%s\" has generated %d Credit Control Lines.\n") % \
|
||||
report += _('Policy "%s" has generated '
|
||||
'%d Credit Control Lines.\n') % \
|
||||
(policy.name, len(policy_generated_ids))
|
||||
credit_line_ids += policy_generated_ids
|
||||
else:
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
"""
|
||||
Script that creates large amounts of account moves on different days,
|
||||
that can be used later for testing the renumber wizard.
|
||||
|
||||
author: Borja López Soilán (Pexego)
|
||||
"""
|
||||
__author__ = "Borja López Soilán (Pexego)"
|
||||
|
||||
import sys
|
||||
import xmlrpclib
|
||||
|
||||
@@ -60,8 +60,10 @@ class res_currency(orm.Model):
|
||||
context = {}
|
||||
# We only do the check if there is an explicit date in the context and
|
||||
# there is no specific currency_rate_type_id
|
||||
if context.get('date') and not context.get('currency_rate_type_id') and\
|
||||
not context.get('disable_rate_date_check'):
|
||||
if (context.get('date') and
|
||||
not context.get('currency_rate_type_id') and
|
||||
not context.get('disable_rate_date_check')):
|
||||
|
||||
for currency_id in ids:
|
||||
# We could get the company from the currency, but it's not a
|
||||
# 'required' field, so we should probably continue to get it
|
||||
|
||||
@@ -54,13 +54,13 @@ class Partner(orm.Model):
|
||||
return False
|
||||
if partner.siren:
|
||||
# Check the SIREN type, length and key
|
||||
if (not partner.siren.isdecimal()
|
||||
or len(partner.siren) != 9
|
||||
or not _check_luhn(partner.siren)):
|
||||
if (not partner.siren.isdecimal() or
|
||||
len(partner.siren) != 9 or
|
||||
not _check_luhn(partner.siren)):
|
||||
return False
|
||||
# Check the NIC key (you need both SIREN and NIC to check it)
|
||||
if partner.nic and not _check_luhn(partner.siren
|
||||
+ partner.nic):
|
||||
if (partner.nic and
|
||||
not _check_luhn(partner.siren + partner.nic)):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user