From aaee043674e24fc0383e585005b3b9276408accf Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Feb 2013 09:21:48 +0100 Subject: [PATCH 1/4] [ADD] multi-company support on account.statement.profile --- account_statement_ext/__openerp__.py | 12 +++++------- account_statement_ext/statement.py | 1 + account_statement_ext/statement_view.xml | 2 ++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/account_statement_ext/__openerp__.py b/account_statement_ext/__openerp__.py index f6b31497..17b8f8a8 100644 --- a/account_statement_ext/__openerp__.py +++ b/account_statement_ext/__openerp__.py @@ -76,13 +76,11 @@ """, 'website': 'http://www.camptocamp.com', - 'init_xml': [], - 'update_xml': [ - 'statement_view.xml', - 'report/bank_statement_webkit_header.xml', - 'report.xml', - 'security/ir.model.access.csv', - ], + 'data': ['statement_view.xml', + 'report/bank_statement_webkit_header.xml', + 'report.xml', + 'security/ir.model.access.csv', + 'security/ir_rule.xml'], 'demo_xml': [], 'test': [], 'installable': True, diff --git a/account_statement_ext/statement.py b/account_statement_ext/statement.py index 3881e482..3913a78b 100644 --- a/account_statement_ext/statement.py +++ b/account_statement_ext/statement.py @@ -76,6 +76,7 @@ class AccountStatementProfil(Model): 'Bank Statement Prefix', size=32), 'bank_statement_ids': fields.one2many( 'account.bank.statement', 'profile_id', 'Bank Statement Imported'), + 'company_id': fields.many2one('res.company', 'Company'), } def _check_partner(self, cr, uid, ids, context=None): diff --git a/account_statement_ext/statement_view.xml b/account_statement_ext/statement_view.xml index 0e1e550c..c40c4b7d 100644 --- a/account_statement_ext/statement_view.xml +++ b/account_statement_ext/statement_view.xml @@ -11,6 +11,7 @@ + @@ -31,6 +32,7 @@ + From 4ba7670c212cb6d943dc063d6b6f4a649ddfc731 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Feb 2013 09:33:39 +0100 Subject: [PATCH 2/4] [ADD] multi-company support on account.statement.profile add xml security --- account_statement_ext/security/ir_rule.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 account_statement_ext/security/ir_rule.xml diff --git a/account_statement_ext/security/ir_rule.xml b/account_statement_ext/security/ir_rule.xml new file mode 100644 index 00000000..7ae2ab83 --- /dev/null +++ b/account_statement_ext/security/ir_rule.xml @@ -0,0 +1,10 @@ + + + + Bank statement profile multi-company + + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + + \ No newline at end of file From da16170a5d63ce4688091ca89f0d3e54a2254ee4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Feb 2013 16:54:48 +0100 Subject: [PATCH 3/4] [ADD] easy-reconcile multi-company support --- account_easy_reconcile/__openerp__.py | 6 ++--- account_easy_reconcile/easy_reconcile.py | 7 ++++++ account_easy_reconcile/easy_reconcile.xml | 2 ++ .../easy_reconcile_history.py | 7 ++++++ .../easy_reconcile_history_view.xml | 1 + account_easy_reconcile/security/ir_rule.xml | 25 +++++++++++++++++++ 6 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 account_easy_reconcile/security/ir_rule.xml diff --git a/account_easy_reconcile/__openerp__.py b/account_easy_reconcile/__openerp__.py index 94230322..a3f22d54 100755 --- a/account_easy_reconcile/__openerp__.py +++ b/account_easy_reconcile/__openerp__.py @@ -21,9 +21,8 @@ { "name": "Easy Reconcile", - "version": "1.2", - "depends": ["account", - ], + "version": "1.3.0", + "depends": ["account"], "author": "Akretion,Camptocamp", "description": """ Easy Reconcile @@ -58,6 +57,7 @@ allows multiple lines and partial. "demo_xml": [], "data": ["easy_reconcile.xml", "easy_reconcile_history_view.xml", + "security/ir_rule.xml", "security/ir.model.access.csv"], 'license': 'AGPL-3', "auto_install": False, diff --git a/account_easy_reconcile/easy_reconcile.py b/account_easy_reconcile/easy_reconcile.py index 3f7b2774..7971895e 100644 --- a/account_easy_reconcile/easy_reconcile.py +++ b/account_easy_reconcile/easy_reconcile.py @@ -96,6 +96,12 @@ class account_easy_reconcile_method(orm.Model): string='Task', required=True, ondelete='cascade'), + 'company_id': fields.related('task_id','company_id', + relation='res.company', + type='many2one', + string='Company', + store=True, + readonly=True), } _defaults = { @@ -182,6 +188,7 @@ class account_easy_reconcile(orm.Model): type='many2one', relation='easy.reconcile.history', readonly=True), + 'company_id': fields.many2one('res.company', 'Company'), } def _prepare_run_transient(self, cr, uid, rec_method, context=None): diff --git a/account_easy_reconcile/easy_reconcile.xml b/account_easy_reconcile/easy_reconcile.xml index 25d60720..2696419a 100644 --- a/account_easy_reconcile/easy_reconcile.xml +++ b/account_easy_reconcile/easy_reconcile.xml @@ -27,6 +27,7 @@ + @@ -76,6 +77,7 @@ The lines should have the same amount (with the write-off) and the same referenc +