diff --git a/account_statement_base_completion/__openerp__.py b/account_statement_base_completion/__openerp__.py
index 1b016369..feb0cb35 100644
--- a/account_statement_base_completion/__openerp__.py
+++ b/account_statement_base_completion/__openerp__.py
@@ -20,7 +20,7 @@
##############################################################################
{'name': "Bank statement base completion",
- 'version': '1.0.2',
+ 'version': '1.0.3',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'category': 'Finance',
diff --git a/account_statement_base_completion/partner.py b/account_statement_base_completion/partner.py
index 89c810d5..4d3a452e 100644
--- a/account_statement_base_completion/partner.py
+++ b/account_statement_base_completion/partner.py
@@ -20,7 +20,7 @@
#################################################################################
from openerp.osv.orm import Model
-from openerp.osv import fields, osv
+from openerp.osv import fields
class res_partner(Model):
@@ -32,7 +32,7 @@ class res_partner(Model):
_columns = {
'bank_statement_label': fields.char('Bank Statement Label', size=100,
- help="Enter the various label found on your bank statement separated by a ; If \
- one of this label is include in the bank statement line, the partner will be automatically \
- filled (as long as you use this method/rules in your statement profile)."),
+ help="Enter the various label found on your bank statement separated by a ; If "
+ "one of this label is include in the bank statement line, the partner will be automatically "
+ "filled (as long as you use this method/rules in your statement profile)."),
}
diff --git a/account_statement_base_completion/statement.py b/account_statement_base_completion/statement.py
index c5ca1f14..ce478a2b 100644
--- a/account_statement_base_completion/statement.py
+++ b/account_statement_base_completion/statement.py
@@ -24,16 +24,17 @@ import sys
import logging
import simplejson
import inspect
+import datetime
import psycopg2
from collections import defaultdict
import re
-from tools.translate import _
+from openerp.tools.translate import _
from openerp.osv import osv, orm, fields
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
from operator import attrgetter
-import datetime
+
_logger = logging.getLogger(__name__)
@@ -256,7 +257,7 @@ class AccountStatementCompletionRule(orm.Model):
st_obj = self.pool.get('account.bank.statement.line')
res = {}
# As we have to iterate on each partner for each line,
- # we memoize the pair to avoid
+ # we memoize the pair to avoid
# to redo computation for each line.
# Following code can be done by a single SQL query
# but this option is not really maintanable
@@ -605,7 +606,7 @@ 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)
except Exception as exc:
diff --git a/account_statement_ext/__openerp__.py b/account_statement_ext/__openerp__.py
index 0038127c..abf83d87 100644
--- a/account_statement_ext/__openerp__.py
+++ b/account_statement_ext/__openerp__.py
@@ -20,7 +20,7 @@
##############################################################################
{'name': "Bank statement extension and profiles",
- 'version': '1.3.5',
+ 'version': '1.3.6',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'category': 'Finance',
diff --git a/account_statement_ext/report/bank_statement_report.py b/account_statement_ext/report/bank_statement_report.py
index 9bdca7fa..80e6af65 100644
--- a/account_statement_ext/report/bank_statement_report.py
+++ b/account_statement_ext/report/bank_statement_report.py
@@ -22,7 +22,7 @@ from openerp.report import report_sxw
from openerp.tools.translate import _
from openerp import pooler
from datetime import datetime
-from report_webkit import webkit_report
+from openerp.addons.report_webkit import webkit_report
class BankStatementWebkit(report_sxw.rml_parse):
diff --git a/account_statement_ext/statement.py b/account_statement_ext/statement.py
index faa98f58..cce5a0b4 100644
--- a/account_statement_ext/statement.py
+++ b/account_statement_ext/statement.py
@@ -112,7 +112,7 @@ class AccountStatementProfile(Model):
_constraints = [
(_check_partner, "You need to put a partner if you tic the 'Force partner on bank move'!", []),
]
-
+
_sql_constraints = [
('name_uniq', 'unique (name, company_id)', 'The name of the bank statement must be unique !')
]
@@ -434,7 +434,7 @@ class AccountBankStatement(Model):
if errors_stack:
msg = u"\n".join(errors_stack)
raise osv.except_osv(_('Error'), msg)
-#end changes
+# end changes
self.write(cr, uid, [st.id],
{'name': st_number,
'balance_end_real': st.balance_end},
@@ -537,31 +537,15 @@ class AccountBankStatement(Model):
:return: tuple of int/long ID that give account_receivable, account_payable based on
company default.
"""
- account_receivable = False
- account_payable = False
- property_obj = self.pool.get('ir.property')
- model_fields_obj = self.pool.get('ir.model.fields')
- model_fields_ids = model_fields_obj.search(
- cr,
- uid,
- [('name', 'in', ['property_account_receivable',
- 'property_account_payable']),
- ('model', '=', 'res.partner')],
- context=context
- )
- property_ids = property_obj.search(cr,
- uid,
- [('fields_id', 'in', model_fields_ids),
- ('res_id', '=', False)],
- context=context)
- for erp_property in property_obj.browse(
- cr, uid, property_ids, context=context):
- if erp_property.fields_id.name == 'property_account_receivable':
- account_receivable = erp_property.value_reference.id
- elif erp_property.fields_id.name == 'property_account_payable':
- account_payable = erp_property.value_reference.id
- return account_receivable, account_payable
+ property_obj = self.pool.get('ir.property')
+ account_receivable = property_obj.get(cr, uid, 'property_account_receivable',
+ 'res.partner', context=context)
+ account_payable = property_obj.get(cr, uid, 'property_account_payable',
+ 'res.partner', context=context)
+
+ return (account_receivable and account_receivable.id or False,
+ account_payable and account_payable.id or False)
def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
"""
diff --git a/account_statement_ext/statement_view.xml b/account_statement_ext/statement_view.xml
index f42d6581..063ba92a 100644
--- a/account_statement_ext/statement_view.xml
+++ b/account_statement_ext/statement_view.xml
@@ -96,13 +96,9 @@
account.bank.statementform
-
+
-
- True
-
-
- # Make balance visible or not depending on profile
+
+ True
+
+
+
{'invisible':[('balance_check','=',False)]}
@@ -128,7 +128,7 @@
- # Adapt onchange signature
+
@@ -139,7 +139,7 @@
- # also set type hidden as it has no impact on reconciliation
+
diff --git a/account_statement_ofx_import/__openerp__.py b/account_statement_ofx_import/__openerp__.py
index a67c8c81..ca09a6e3 100644
--- a/account_statement_ofx_import/__openerp__.py
+++ b/account_statement_ofx_import/__openerp__.py
@@ -21,7 +21,7 @@
##############################################################################
{'name': "Bank statement OFX import",
- 'version': '1.0',
+ 'version': '1.0.1',
'author': 'Servicios Tecnológicos Avanzados - Pedro M. Baeza',
'maintainer': 'Pedro M. Baeza',
'category': 'Finance',
@@ -36,7 +36,7 @@
Allows to import OFX (Open Financial Exchange) statement files, using
*account_statement_base_import* generic inheritance mechanism to import
statements.
-
+
It requires ofxparse library to work.
""",
'website': 'http://www.serviciosbaeza.com',
diff --git a/account_statement_ofx_import/parser/ofx_parser.py b/account_statement_ofx_import/parser/ofx_parser.py
index 65961241..5b86035d 100644
--- a/account_statement_ofx_import/parser/ofx_parser.py
+++ b/account_statement_ofx_import/parser/ofx_parser.py
@@ -18,11 +18,13 @@
# along with this program. If not, see .
#
##############################################################################
-from openerp.tools.translate import _
-from account_statement_base_import.parser import BankStatementImportParser
+
import tempfile
import datetime
+from openerp.tools.translate import _
+from openerp.addons.account_statement_base_import.parser import BankStatementImportParser
+
try:
import ofxparse
except: