mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX+IMP] contract: Real fix to company_id missing + improvements
* company_id was empty because an onchange, not inheritance nor visibility * Added multi-company group to company_id fields * Added multi-company access rule to contract templates * Fix double %% in XML dates that was causing an error * When creating a contract, recurring_invoices is set by default
This commit is contained in:
committed by
Dave Lasley
parent
4b58e15b7d
commit
f6ebe6e9c7
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
|
||||
10
contract/security/contract_security.xml
Normal file
10
contract/security/contract_security.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="rule_contract_template_multi_company" model="ir.rule">
|
||||
<field name="name">Contract template multi-company</field>
|
||||
<field name="model_id" ref="model_account_analytic_contract"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -38,6 +38,7 @@
|
||||
<field name="contract_template_id" colspan="4"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="pricelist_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<label for="recurring_interval"/>
|
||||
<div>
|
||||
<field name="recurring_interval"
|
||||
@@ -119,11 +120,11 @@
|
||||
<separator/>
|
||||
<filter name="not_finished"
|
||||
string="Valid"
|
||||
domain="['|', ('date_end', '=', False), ('date_end', '>=', time.strftime('%%Y-%%m-%%d'))]"
|
||||
domain="['|', ('date_end', '=', False), ('date_end', '>=', time.strftime('%Y-%m-%d'))]"
|
||||
/>
|
||||
<filter name="finished"
|
||||
string="Finished"
|
||||
domain="[('date_end', '<', time.strftime('%%Y-%%m-%%d'))]"
|
||||
domain="[('date_end', '<', time.strftime('%Y-%m-%d'))]"
|
||||
/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Next Invoice"
|
||||
@@ -145,7 +146,7 @@
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'is_contract':1, 'search_default_not_finished':1, 'search_default_recurring_invoices':1}</field>
|
||||
<field name="context">{'is_contract':1, 'search_default_not_finished':1, 'search_default_recurring_invoices':1, 'default_recurring_invoices': 1}</field>
|
||||
<field name="search_view_id" ref="analytic.view_account_analytic_account_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Contract Template">
|
||||
<group name="group_main">
|
||||
<field name="company_id" invisible="1" />
|
||||
<field name="name" />
|
||||
<group name="group_main_left">
|
||||
<field name="journal_id" />
|
||||
<field name="pricelist_id" />
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group name="group_main_right">
|
||||
<field name="recurring_invoicing_type" />
|
||||
|
||||
Reference in New Issue
Block a user