Merge branch '7.0' into 8.0

Conflicts:
	.travis.yml
	__unported__/account_advanced_reconcile/res_config.py
	__unported__/account_advanced_reconcile/res_config_view.xml
	__unported__/account_statement_base_completion/__openerp__.py
	__unported__/account_statement_base_completion/i18n/fr.po
	account_advanced_reconcile/res_config.py
	account_advanced_reconcile/res_config_view.xml
	account_easy_reconcile/res_config.py
	account_easy_reconcile/res_config_view.xml
	account_invoice_reference/__openerp__.py
	account_invoice_reference/account_move.py
	statement_voucher_killer/__openerp__.py
	statement_voucher_killer/voucher.py
This commit is contained in:
Leonardo Pistone
2015-01-13 14:47:22 +01:00
68 changed files with 1174 additions and 348 deletions

View File

@@ -124,7 +124,9 @@ class AccountStatementCompletionRule(orm.Model):
_order = "sequence asc"
def _get_functions(self, cr, uid, context=None):
"""List of available methods for rules. Override this to add you own."""
"""List of available methods for rules.
Override this to add you own."""
return [
('get_from_ref_and_invoice',
'From line reference (based on customer invoice number)'),
@@ -189,13 +191,7 @@ class AccountStatementCompletionRule(orm.Model):
res = {}
inv = self._find_invoice(cr, uid, line, inv_type, context=context)
if inv:
# FIXME use only commercial_partner_id of invoice in 7.1
# this is for backward compatibility in 7.0 before
# the refactoring of res.partner
if hasattr(inv, 'commercial_partner_id'):
partner_id = inv.commercial_partner_id.id
else:
partner_id = inv.partner_id.id
partner_id = inv.commercial_partner_id.id
res = {'partner_id': partner_id,
'account_id': inv.account_id.id,
'type': inv_type}
@@ -225,8 +221,8 @@ class AccountStatementCompletionRule(orm.Model):
# Should be private but data are initialised with no update XML
def get_from_ref_and_invoice(self, cr, uid, line, context=None):
"""Match the partner based on the invoice number and the reference of
the statement line. Then, call the generic get_values_for_line method to
complete other values. If more than one partner matched, raise the
the statement line. Then, call the generic get_values_for_line method
to complete other values. If more than one partner matched, raise the
ErrorTooManyPartner error.
:param dict line: read of the concerned account.bank.statement.line
@@ -242,11 +238,11 @@ class AccountStatementCompletionRule(orm.Model):
# Should be private but data are initialised with no update XML
def get_from_label_and_partner_field(self, cr, uid, st_line, context=None):
"""
Match the partner based on the label field of the statement line
and the text defined in the 'bank_statement_label' field of the partner.
Remember that we can have values separated with ; Then, call the generic
get_values_for_line method to complete other values.
If more than one partner matched, raise the ErrorTooManyPartner error.
Match the partner based on the label field of the statement line and
the text defined in the 'bank_statement_label' field of the partner.
Remember that we can have values separated with ; Then, call the
generic get_values_for_line method to complete other values. If more
than one partner matched, raise the ErrorTooManyPartner error.
:param dict st_line: read of the concerned account.bank.statement.line
:return:
@@ -303,10 +299,10 @@ class AccountStatementCompletionRule(orm.Model):
return res
def get_from_label_and_partner_name(self, cr, uid, st_line, context=None):
"""Match the partner based on the label field of the statement line
and the name of the partner. Then, call the generic get_values_for_line
method to complete other values. If more than one partner matched, raise
the ErrorTooManyPartner error.
"""Match the partner based on the label field of the statement line and
the name of the partner. Then, call the generic get_values_for_line
method to complete other values. If more than one partner matched,
raise the ErrorTooManyPartner error.
:param dict st_line: read of the concerned account.bank.statement.line
:return:
@@ -333,7 +329,7 @@ class AccountStatementCompletionRule(orm.Model):
# to:
# http://www.postgresql.org/docs/9.0/static/functions-matching.html
# in chapter 9.7.3.6. Limits and Compatibility
sql = """
sql = r"""
SELECT id FROM (
SELECT id,
regexp_matches(%s,
@@ -386,9 +382,9 @@ class AccountStatement(orm.Model):
class AccountStatementLine(orm.Model):
"""
Add sparse field on the statement line to allow to store all the
bank infos that are given by a bank/office. You can then add you own in your
module. The idea here is to store all bank/office infos in the
Add sparse field on the statement line to allow to store all the bank infos
that are given by a bank/office. You can then add you own in your module.
The idea here is to store all bank/office infos in the
additionnal_bank_fields serialized field when importing the file. If many
values, add a tab in the bank statement line to store your specific one.
Have a look in account_statement_base_import module to see how we've done
@@ -449,7 +445,8 @@ class AccountStatementLine(orm.Model):
statement_line_obj = self.pool['account.bank.statement.line']
model_cols = statement_line_obj._columns
avail = [
k for k, col in model_cols.iteritems() if not hasattr(col, '_fnct')]
k for k, col in model_cols.iteritems() if not hasattr(col, '_fnct')
]
keys = [k for k in statement_store[0].keys() if k in avail]
# add sparse fields..
if include_serializable:
@@ -635,7 +632,8 @@ class AccountBankStatement(orm.Model):
st += ''.join(traceback.format_tb(trbk, 30))
_logger.error(st)
if res:
# stat_line_obj.write(cr, uid, [line.id], vals, context=ctx)
# stat_line_obj.write(cr, uid, [line.id], vals,
# context=ctx)
try:
stat_line_obj._update_line(
cr, uid, res, context=context)