diff --git a/contract/__manifest__.py b/contract/__manifest__.py
index b7e57492..ddf7c225 100644
--- a/contract/__manifest__.py
+++ b/contract/__manifest__.py
@@ -9,7 +9,7 @@
{
'name': 'Contracts Management - Recurring',
- 'version': '10.0.3.1.0',
+ 'version': '10.0.3.2.0',
'category': 'Contract Management',
'license': 'AGPL-3',
'author': "OpenERP SA, "
@@ -20,6 +20,7 @@
'depends': ['base', 'account', 'analytic'],
'data': [
'security/ir.model.access.csv',
+ 'security/contract_security.xml',
'report/report_contract.xml',
'report/contract_views.xml',
'data/contract_cron.xml',
diff --git a/contract/models/account_analytic_account.py b/contract/models/account_analytic_account.py
index 89afa911..dbcaa0f8 100644
--- a/contract/models/account_analytic_account.py
+++ b/contract/models/account_analytic_account.py
@@ -61,15 +61,13 @@ class AccountAnalyticAccount(models.Model):
deletion ensures that any errant lines that are created are also
deleted.
"""
-
contract = self.contract_template_id
-
+ if not contract:
+ return
for field_name, field in contract._fields.iteritems():
-
if field.name == 'recurring_invoice_line_ids':
lines = self._convert_contract_lines(contract)
self.recurring_invoice_line_ids = lines
-
elif not any((
field.compute, field.related, field.automatic,
field.readonly, field.company_dependent,
diff --git a/contract/security/contract_security.xml b/contract/security/contract_security.xml
new file mode 100644
index 00000000..3884e6ef
--- /dev/null
+++ b/contract/security/contract_security.xml
@@ -0,0 +1,10 @@
+
diff --git a/contract/views/account_analytic_contract_view.xml b/contract/views/account_analytic_contract_view.xml
index 00da85fe..55581165 100644
--- a/contract/views/account_analytic_contract_view.xml
+++ b/contract/views/account_analytic_contract_view.xml
@@ -7,11 +7,11 @@