Pedro M. Baeza
8 years ago
9 changed files with 151 additions and 153 deletions
-
10contract/README.rst
-
4contract/__manifest__.py
-
24contract/data/contract_cron.xml
-
17contract/models/contract.py
-
2contract/models/invoice.py
-
4contract/security/ir.model.access.csv
-
7contract/tests/test_contract.py
-
28contract/views/account_invoice_view.xml
-
208contract/views/contract.xml
@ -1,16 +1,14 @@ |
|||||
<?xml version="1.0" encoding='UTF-8'?> |
<?xml version="1.0" encoding='UTF-8'?> |
||||
<openerp> |
|
||||
<data> |
|
||||
|
<odoo> |
||||
|
|
||||
<record model="ir.cron" id="account_analytic_cron_for_invoice"> |
|
||||
<field name="name">Generate Recurring Invoices from Contracts</field> |
|
||||
<field name="interval_number">1</field> |
|
||||
<field name="interval_type">days</field> |
|
||||
<field name="numbercall">-1</field> |
|
||||
<field name="model" eval="'account.analytic.account'"/> |
|
||||
<field name="function" eval="'cron_recurring_create_invoice'"/> |
|
||||
<field name="args" eval="'()'"/> |
|
||||
</record> |
|
||||
|
<record model="ir.cron" id="account_analytic_cron_for_invoice"> |
||||
|
<field name="name">Generate Recurring Invoices from Contracts</field> |
||||
|
<field name="interval_number">1</field> |
||||
|
<field name="interval_type">days</field> |
||||
|
<field name="numbercall">-1</field> |
||||
|
<field name="model" eval="'account.analytic.account'"/> |
||||
|
<field name="function" eval="'cron_recurring_create_invoice'"/> |
||||
|
<field name="args" eval="'()'"/> |
||||
|
</record> |
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
</odoo> |
@ -1,4 +1,4 @@ |
|||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
||||
"account_analytic_invoice_line_manager","Recurring manager","model_account_analytic_invoice_line","base.group_sale_manager",1,1,1,1 |
|
||||
"account_analytic_invoice_line_user","Recurring user","model_account_analytic_invoice_line","base.group_sale_salesman",1,0,0,0 |
|
||||
|
"account_analytic_invoice_line_manager","Recurring manager","model_account_analytic_invoice_line","account.group_account_manager",1,1,1,1 |
||||
|
"account_analytic_invoice_line_user","Recurring user","model_account_analytic_invoice_line","account.group_account_user",1,0,0,0 |
||||
|
|
@ -1,19 +1,17 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<openerp> |
|
||||
<data> |
|
||||
|
<odoo> |
||||
|
|
||||
<!-- Invoice search view with contract --> |
|
||||
<record id="view_account_invoice_filter_contract" model="ir.ui.view"> |
|
||||
<field name="name">account.invoice.select.contract</field> |
|
||||
<field name="model">account.invoice</field> |
|
||||
<field name="inherit_id" ref="account.view_account_invoice_filter"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<field name="date" position="after"> |
|
||||
<separator/> |
|
||||
<field name="contract_id"/> |
|
||||
</field> |
|
||||
|
<!-- Invoice search view with contract --> |
||||
|
<record id="view_account_invoice_filter_contract" model="ir.ui.view"> |
||||
|
<field name="name">account.invoice.select.contract</field> |
||||
|
<field name="model">account.invoice</field> |
||||
|
<field name="inherit_id" ref="account.view_account_invoice_filter"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="date" position="after"> |
||||
|
<separator/> |
||||
|
<field name="contract_id"/> |
||||
</field> |
</field> |
||||
</record> |
|
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
</odoo> |
@ -1,116 +1,114 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<openerp> |
|
||||
<data> |
|
||||
|
<odoo> |
||||
|
|
||||
<record id="act_recurring_invoices" model="ir.actions.act_window"> |
|
||||
<field name="context">{'search_default_contract_id': |
|
||||
[active_id], |
|
||||
'default_contract_id': active_id} |
|
||||
</field> |
|
||||
<field name="name">Invoices</field> |
|
||||
<field name="res_model">account.invoice</field> |
|
||||
<field name="view_id" ref="account.invoice_tree" /> |
|
||||
<field name="search_view_id" ref="account.view_account_invoice_filter"/> |
|
||||
</record> |
|
||||
|
<record id="act_recurring_invoices" model="ir.actions.act_window"> |
||||
|
<field name="context">{'search_default_contract_id': |
||||
|
[active_id], |
||||
|
'default_contract_id': active_id} |
||||
|
</field> |
||||
|
<field name="name">Invoices</field> |
||||
|
<field name="res_model">account.invoice</field> |
||||
|
<field name="view_id" ref="account.invoice_tree" /> |
||||
|
<field name="search_view_id" ref="account.view_account_invoice_filter"/> |
||||
|
</record> |
||||
|
|
||||
<record id="account_analytic_account_recurring_form_form" model="ir.ui.view"> |
|
||||
<field name="name">account.analytic.account.invoice.recurring.form.inherit</field> |
|
||||
<field name="model">account.analytic.account</field> |
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/> |
|
||||
<field eval="40" name="priority"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<notebook position="before"> |
|
||||
<separator string="Recurring Invoices" attrs="{'invisible': [('recurring_invoices','!=',True)]}"/> |
|
||||
|
<record id="account_analytic_account_recurring_form_form" model="ir.ui.view"> |
||||
|
<field name="name">account.analytic.account.invoice.recurring.form.inherit</field> |
||||
|
<field name="model">account.analytic.account</field> |
||||
|
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/> |
||||
|
<field eval="40" name="priority"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<group name="main" position="after"> |
||||
|
<separator string="Recurring Invoices" attrs="{'invisible': [('recurring_invoices','!=',True)]}"/> |
||||
|
<div> |
||||
|
<field name="recurring_invoices" class="oe_inline"/> |
||||
|
<label for="recurring_invoices" /> |
||||
|
<button name="recurring_create_invoice" type="object" |
||||
|
attrs="{'invisible': [('recurring_invoices','!=',True)]}" |
||||
|
string="Create invoices" class="oe_link" |
||||
|
groups="base.group_no_one"/> |
||||
|
<button name="%(contract.act_recurring_invoices)d" type="action" |
||||
|
attrs="{'invisible': [('recurring_invoices','!=',True)]}" |
||||
|
string="⇒ Show recurring invoices" class="oe_link"/> |
||||
|
</div> |
||||
|
<group col="4" attrs="{'invisible': [('recurring_invoices','!=',True)]}"> |
||||
|
<field name="journal_id"/> |
||||
|
<field name="pricelist_id"/> |
||||
|
<label for="recurring_interval"/> |
||||
<div> |
<div> |
||||
<field name="recurring_invoices" class="oe_inline"/> |
|
||||
<label for="recurring_invoices" /> |
|
||||
<button name="recurring_create_invoice" type="object" |
|
||||
attrs="{'invisible': [('recurring_invoices','!=',True)]}" |
|
||||
string="Create invoices" class="oe_link" |
|
||||
groups="base.group_no_one"/> |
|
||||
<button name="%(contract.act_recurring_invoices)d" type="action" |
|
||||
attrs="{'invisible': [('recurring_invoices','!=',True)]}" |
|
||||
string="⇒ Show recurring invoices" class="oe_link"/> |
|
||||
</div> |
|
||||
<group col="4" attrs="{'invisible': [('recurring_invoices','!=',True)]}"> |
|
||||
<field name="journal_id"/> |
|
||||
<field name="pricelist_id"/> |
|
||||
<label for="recurring_interval"/> |
|
||||
<div> |
|
||||
<field name="recurring_interval" class="oe_inline" attrs="{'required': [('recurring_invoices', '=', True)]}"/> |
|
||||
<field name="recurring_rule_type" class="oe_inline" attrs="{'required': [('recurring_invoices', '=', True)]}"/> |
|
||||
</div> |
|
||||
<field name="recurring_invoicing_type"/> |
|
||||
<field name="date_start"/> |
|
||||
<field name="recurring_next_date"/> |
|
||||
</group> |
|
||||
<label for="recurring_invoice_line_ids" attrs="{'invisible': [('recurring_invoices','=',False)]}"/> |
|
||||
<div attrs="{'invisible': [('recurring_invoices','=',False)]}"> |
|
||||
<field name="recurring_invoice_line_ids"> |
|
||||
<tree string="Account Analytic Lines" editable="bottom"> |
|
||||
<field name="product_id"/> |
|
||||
<field name="name"/> |
|
||||
<field name="quantity"/> |
|
||||
<field name="uom_id"/> |
|
||||
<field name="price_unit"/> |
|
||||
<field name="discount" groups="sale.group_discount_per_so_line" /> |
|
||||
<field name="price_subtotal"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
|
<field name="recurring_interval" class="oe_inline" attrs="{'required': [('recurring_invoices', '=', True)]}"/> |
||||
|
<field name="recurring_rule_type" class="oe_inline" attrs="{'required': [('recurring_invoices', '=', True)]}"/> |
||||
</div> |
</div> |
||||
<group string="Legend (for the markers inside invoice lines description)" |
|
||||
name="group_legend" attrs="{'invisible': [('recurring_invoices','!=',True)]}"> |
|
||||
<p colspan="2"> <strong>#START#</strong>: Start date of the invoiced period</p> |
|
||||
<p colspan="2"> <strong>#END#</strong>: End date of the invoiced period</p> |
|
||||
</group> |
|
||||
</notebook> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
<field name="recurring_invoicing_type"/> |
||||
|
<field name="date_start"/> |
||||
|
<field name="recurring_next_date"/> |
||||
|
</group> |
||||
|
<label for="recurring_invoice_line_ids" attrs="{'invisible': [('recurring_invoices','=',False)]}"/> |
||||
|
<div attrs="{'invisible': [('recurring_invoices','=',False)]}"> |
||||
|
<field name="recurring_invoice_line_ids"> |
||||
|
<tree string="Account Analytic Lines" editable="bottom"> |
||||
|
<field name="product_id"/> |
||||
|
<field name="name"/> |
||||
|
<field name="quantity"/> |
||||
|
<field name="uom_id"/> |
||||
|
<field name="price_unit"/> |
||||
|
<field name="discount" groups="sale.group_discount_per_so_line" /> |
||||
|
<field name="price_subtotal"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</div> |
||||
|
<group string="Legend (for the markers inside invoice lines description)" |
||||
|
name="group_legend" attrs="{'invisible': [('recurring_invoices','!=',True)]}"> |
||||
|
<p colspan="2"> <strong>#START#</strong>: Start date of the invoiced period</p> |
||||
|
<p colspan="2"> <strong>#END#</strong>: End date of the invoiced period</p> |
||||
|
</group> |
||||
|
</group> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
<!-- Inherited Analytic Account list for contracts --> |
|
||||
<record id="view_account_analytic_account_journal_tree" model="ir.ui.view"> |
|
||||
<field name="name">account.analytic.account.journal.list</field> |
|
||||
<field name="model">account.analytic.account</field> |
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_list" /> |
|
||||
<field name="arch" type="xml"> |
|
||||
<field name="partner_id" position="before"> |
|
||||
<field name="journal_id" groups="account.group_account_user"/> |
|
||||
</field> |
|
||||
|
<!-- Inherited Analytic Account list for contracts --> |
||||
|
<record id="view_account_analytic_account_journal_tree" model="ir.ui.view"> |
||||
|
<field name="name">account.analytic.account.journal.list</field> |
||||
|
<field name="model">account.analytic.account</field> |
||||
|
<field name="inherit_id" ref="analytic.view_account_analytic_account_list" /> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="partner_id" position="before"> |
||||
|
<field name="journal_id" groups="account.group_account_user"/> |
||||
</field> |
</field> |
||||
</record> |
|
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
<!-- Analytic Account search view for contract --> |
|
||||
<record id="view_account_analytic_account_contract_search" model="ir.ui.view"> |
|
||||
<field name="name">account.analytic.account.contract.search</field> |
|
||||
<field name="model">account.analytic.account</field> |
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_search"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<field name="name" position="after"> |
|
||||
<field name="journal_id"/> |
|
||||
<field name="pricelist_id"/> |
|
||||
<filter name="recurring_invoices" string="Recurring Invoices" domain="[('recurring_invoices','=',True)]"/> |
|
||||
<group expand="0" string="Group By..."> |
|
||||
<filter string="Next Invoice" domain="[]" context="{'group_by':'recurring_next_date'}"/> |
|
||||
</group> |
|
||||
</field> |
|
||||
|
<!-- Analytic Account search view for contract --> |
||||
|
<record id="view_account_analytic_account_contract_search" model="ir.ui.view"> |
||||
|
<field name="name">account.analytic.account.contract.search</field> |
||||
|
<field name="model">account.analytic.account</field> |
||||
|
<field name="inherit_id" ref="analytic.view_account_analytic_account_search"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="name" position="after"> |
||||
|
<field name="journal_id"/> |
||||
|
<field name="pricelist_id"/> |
||||
|
<filter name="recurring_invoices" string="Recurring Invoices" domain="[('recurring_invoices','=',True)]"/> |
||||
|
<group expand="0" string="Group By..."> |
||||
|
<filter string="Next Invoice" domain="[]" context="{'group_by':'recurring_next_date'}"/> |
||||
|
</group> |
||||
</field> |
</field> |
||||
</record> |
|
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
<!-- Action Sales/Sales/Contracts --> |
|
||||
<record id="action_account_analytic_overdue_all" model="ir.actions.act_window"> |
|
||||
<field name="name">Contracts</field> |
|
||||
<field name="res_model">account.analytic.account</field> |
|
||||
<field name="view_type">form</field> |
|
||||
<field name="view_mode">tree,form</field> |
|
||||
<field name="context">{'search_default_active':1, 'search_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"> |
|
||||
Click to create a new contract. |
|
||||
</p> |
|
||||
</field> |
|
||||
</record> |
|
||||
<menuitem action="action_account_analytic_overdue_all" id="menu_action_account_analytic_overdue_all" sequence="8" parent="base.menu_sales"/> |
|
||||
|
<!-- Action Sales/Sales/Contracts --> |
||||
|
<record id="action_account_analytic_overdue_all" model="ir.actions.act_window"> |
||||
|
<field name="name">Contracts</field> |
||||
|
<field name="res_model">account.analytic.account</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="context">{'search_default_active':1, 'search_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"> |
||||
|
Click to create a new contract. |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
<menuitem action="action_account_analytic_overdue_all" id="menu_action_account_analytic_overdue_all" sequence="99" parent="account.menu_finance_receivables"/> |
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue