summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorcod-odoo <cod@openerp.com>2014-06-25 11:37:30 +0530
committerThibault Delavallée <tde@openerp.com>2014-08-04 13:23:46 +0200
commita301b4c7fc667a99a65961c1a756eca6d6b87238 (patch)
tree50d86e3ce312cdfe719c5377dc588738dde9c31a /addons
parent407cb2292471c1dd11380c503ac2cec6999816b8 (diff)
[MOVE] account: moved account/project files to analytic or account, depending on which module the moved code belongs to. This allows to remove references to project in account module. Also added some improvements in project when deleting a project (delete account if void) or when deleting an account (delete project if void).
Diffstat (limited to 'addons')
-rw-r--r--addons/account/__init__.py1
-rw-r--r--addons/account/__openerp__.py17
-rw-r--r--addons/account/account.py1
-rw-r--r--addons/account/account_analytic_line.py3
-rw-r--r--addons/account/account_analytic_view.xml127
-rw-r--r--addons/account/demo/account_minimal.xml12
-rw-r--r--addons/account/partner_view.xml4
-rw-r--r--addons/account/project/__init__.py28
-rw-r--r--addons/account/project/project.py50
-rw-r--r--addons/account/project/wizard/project_account_analytic_line.py57
-rw-r--r--addons/account/project/wizard/project_account_analytic_line_view.xml34
-rw-r--r--addons/account/report/account_analytic_entries_report.py4
-rw-r--r--addons/account/report/account_analytic_entries_report_view.xml4
-rw-r--r--addons/account/security/account_security.xml7
-rw-r--r--addons/account/security/ir.model.access.csv6
-rw-r--r--addons/account/test/account_fiscalyear_close.yml2
-rw-r--r--addons/account/test/account_report.yml20
-rw-r--r--addons/account_analytic_analysis/account_analytic_analysis_view.xml19
-rw-r--r--addons/account_analytic_analysis/analytic_account_demo.xml12
-rw-r--r--addons/account_analytic_plans/test/acount_analytic_plans_report.yml4
-rw-r--r--addons/account_budget/account_budget_demo.xml34
-rw-r--r--addons/account_budget/test/account_budget.yml4
-rw-r--r--addons/account_budget/test/account_budget_report.yml2
-rw-r--r--addons/account_voucher/test/case1_usd_usd.yml2
-rw-r--r--addons/account_voucher/test/case1_usd_usd_payment_rate.yml2
-rw-r--r--addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml4
-rw-r--r--addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml4
-rw-r--r--addons/account_voucher/test/case3_eur_eur.yml2
-rw-r--r--addons/account_voucher/test/case4_cad_chf.yml2
-rw-r--r--addons/account_voucher/test/case5_suppl_usd_usd.yml4
-rw-r--r--addons/account_voucher/test/case_eur_usd.yml2
-rw-r--r--addons/analytic/__init__.py4
-rw-r--r--addons/analytic/__openerp__.py23
-rw-r--r--addons/analytic/analytic_report.xml (renamed from addons/account/project/project_report.xml)0
-rw-r--r--addons/analytic/analytic_view.xml66
-rw-r--r--addons/analytic/data/analytic_account_demo.xml (renamed from addons/account/project/analytic_account_demo.xml)0
-rw-r--r--addons/analytic/data/analytic_data.xml (renamed from addons/analytic/analytic_data.xml)0
-rw-r--r--addons/analytic/data/analytic_demo.xml (renamed from addons/account/project/project_demo.xml)0
-rw-r--r--addons/analytic/data/analytic_sequence.xml (renamed from addons/analytic/analytic_sequence.xml)0
-rw-r--r--addons/analytic/models/__init__.py3
-rw-r--r--addons/analytic/models/analytic.py (renamed from addons/analytic/analytic.py)22
-rw-r--r--addons/analytic/report/__init__.py (renamed from addons/account/project/report/__init__.py)6
-rw-r--r--addons/analytic/report/analytic_balance.py (renamed from addons/account/project/report/analytic_balance.py)2
-rw-r--r--addons/analytic/report/analytic_cost_ledger.py (renamed from addons/account/project/report/cost_ledger.py)2
-rw-r--r--addons/analytic/report/analytic_inverted_balance.py (renamed from addons/account/project/report/inverted_analytic_balance.py)2
-rw-r--r--addons/analytic/report/analytic_journal.py (renamed from addons/account/project/report/analytic_journal.py)2
-rw-r--r--addons/analytic/report/analytic_quantity_cost_ledger.py (renamed from addons/account/project/report/quantity_cost_ledger.py)2
-rw-r--r--addons/analytic/security/analytic_security.xml7
-rw-r--r--addons/analytic/views/analytic_view.xml (renamed from addons/account/project/project_view.xml)154
-rw-r--r--addons/analytic/views/report_analyticbalance.xml (renamed from addons/account/project/views/report_analyticbalance.xml)0
-rw-r--r--addons/analytic/views/report_analyticcostledger.xml (renamed from addons/account/project/views/report_analyticcostledger.xml)0
-rw-r--r--addons/analytic/views/report_analyticcostledgerquantity.xml (renamed from addons/account/project/views/report_analyticcostledgerquantity.xml)0
-rw-r--r--addons/analytic/views/report_analyticjournal.xml (renamed from addons/account/project/views/report_analyticjournal.xml)0
-rw-r--r--addons/analytic/views/report_invertedanalyticbalance.xml (renamed from addons/account/project/views/report_invertedanalyticbalance.xml)0
-rw-r--r--addons/analytic/wizard/__init__.py (renamed from addons/account/project/wizard/__init__.py)1
-rw-r--r--addons/analytic/wizard/account_analytic_balance_report.py (renamed from addons/account/project/wizard/account_analytic_balance_report.py)0
-rw-r--r--addons/analytic/wizard/account_analytic_balance_report_view.xml (renamed from addons/account/project/wizard/account_analytic_balance_report_view.xml)0
-rw-r--r--addons/analytic/wizard/account_analytic_chart.py (renamed from addons/account/project/wizard/account_analytic_chart.py)2
-rw-r--r--addons/analytic/wizard/account_analytic_chart_view.xml (renamed from addons/account/project/wizard/account_analytic_chart_view.xml)8
-rw-r--r--addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report.py (renamed from addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py)0
-rw-r--r--addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report_view.xml (renamed from addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml)0
-rw-r--r--addons/analytic/wizard/account_analytic_cost_ledger_report.py (renamed from addons/account/project/wizard/account_analytic_cost_ledger_report.py)0
-rw-r--r--addons/analytic/wizard/account_analytic_cost_ledger_view.xml (renamed from addons/account/project/wizard/account_analytic_cost_ledger_view.xml)0
-rw-r--r--addons/analytic/wizard/account_analytic_inverted_balance_report.py (renamed from addons/account/project/wizard/account_analytic_inverted_balance_report.py)0
-rw-r--r--addons/analytic/wizard/account_analytic_inverted_balance_report.xml (renamed from addons/account/project/wizard/account_analytic_inverted_balance_report.xml)0
-rw-r--r--addons/analytic/wizard/account_analytic_journal_report.py (renamed from addons/account/project/wizard/account_analytic_journal_report.py)0
-rw-r--r--addons/analytic/wizard/account_analytic_journal_report_view.xml (renamed from addons/account/project/wizard/account_analytic_journal_report_view.xml)9
-rw-r--r--addons/hr_expense/hr_expense.py2
-rw-r--r--addons/hr_expense/hr_expense_demo.xml8
-rw-r--r--addons/hr_expense/hr_expense_view.xml4
-rw-r--r--addons/hr_expense/hr_expense_workflow.xml1
-rw-r--r--addons/hr_expense/security/ir.model.access.csv2
-rw-r--r--addons/hr_timesheet/hr_timesheet_demo.xml18
-rw-r--r--addons/hr_timesheet/security/ir.model.access.csv4
-rw-r--r--addons/hr_timesheet/test/hr_timesheet_demo.yml2
-rw-r--r--addons/hr_timesheet/test/test_hr_timesheet.yml4
-rw-r--r--addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml6
-rw-r--r--addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml8
-rw-r--r--addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py2
-rw-r--r--addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml10
-rw-r--r--addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml10
-rw-r--r--addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml4
-rw-r--r--addons/mrp/security/ir.model.access.csv2
-rw-r--r--addons/multi_company/multi_company_demo.xml30
-rw-r--r--addons/project/project.py16
-rw-r--r--addons/project_issue/project_issue.py7
-rw-r--r--addons/project_issue_sheet/security/ir.model.access.csv4
-rw-r--r--addons/project_timesheet/project_timesheet_view.xml6
88 files changed, 433 insertions, 506 deletions
diff --git a/addons/account/__init__.py b/addons/account/__init__.py
index bc27e14380c..3d6f6061a72 100644
--- a/addons/account/__init__.py
+++ b/addons/account/__init__.py
@@ -22,7 +22,6 @@
import partner
import account
import installer
-import project
import account_invoice
import account_bank_statement
import account_bank
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index b5aa1cbb20d..42cb8c89c73 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -97,24 +97,16 @@ for a particular financial year and for preparation of vouchers there is a modul
'wizard/account_automatic_reconcile_view.xml',
'wizard/account_financial_report_view.xml',
'wizard/pos_box.xml',
- 'project/wizard/project_account_analytic_line_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',
'data/account_data.xml',
'data/data_account_type.xml',
'data/configurable_account_chart.xml',
'account_invoice_workflow.xml',
- 'project/project_view.xml',
- 'project/project_report.xml',
- 'project/wizard/account_analytic_balance_report_view.xml',
- 'project/wizard/account_analytic_cost_ledger_view.xml',
- 'project/wizard/account_analytic_inverted_balance_report.xml',
- 'project/wizard/account_analytic_journal_report_view.xml',
- 'project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml',
- 'project/wizard/account_analytic_chart_view.xml',
'partner_view.xml',
'product_view.xml',
'account_assert_test.xml',
+ 'account_analytic_view.xml',
'ir_sequence_view.xml',
'company_view.xml',
'edi/invoice_action_data.xml',
@@ -135,11 +127,6 @@ for a particular financial year and for preparation of vouchers there is a modul
'views/report_partnerledgerother.xml',
'views/report_financial.xml',
'views/report_generalledger.xml',
- 'project/views/report_analyticbalance.xml',
- 'project/views/report_analyticjournal.xml',
- 'project/views/report_analyticcostledgerquantity.xml',
- 'project/views/report_analyticcostledger.xml',
- 'project/views/report_invertedanalyticbalance.xml',
'views/account.xml',
],
'qweb' : [
@@ -149,8 +136,6 @@ for a particular financial year and for preparation of vouchers there is a modul
],
'demo': [
'demo/account_demo.xml',
- 'project/project_demo.xml',
- 'project/analytic_account_demo.xml',
'demo/account_minimal.xml',
'demo/account_invoice_demo.xml',
'demo/account_bank_statement.xml',
diff --git a/addons/account/account.py b/addons/account/account.py
index ac70559fe7d..19576d1cf98 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -738,6 +738,7 @@ class account_journal(osv.osv):
'loss_account_id' : fields.many2one('account.account', 'Loss Account'),
'internal_account_id' : fields.many2one('account.account', 'Internal Transfers Account', select=1),
'cash_control' : fields.boolean('Cash Control', help='If you want the journal should be control at opening/closing, check this option'),
+ 'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"),
}
_defaults = {
diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py
index 0c122b2c925..641cd5995c7 100644
--- a/addons/account/account_analytic_line.py
+++ b/addons/account/account_analytic_line.py
@@ -29,13 +29,14 @@ class account_analytic_line(osv.osv):
_columns = {
'product_uom_id': fields.many2one('product.uom', 'Unit of Measure'),
'product_id': fields.many2one('product.product', 'Product'),
- 'general_account_id': fields.many2one('account.account', 'General Account', required=True, ondelete='restrict'),
+ 'general_account_id': fields.many2one('account.account', 'Financial Account', required=True, ondelete='restrict'),
'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True),
'code': fields.char('Code', size=8),
'ref': fields.char('Ref.'),
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account Currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount Currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
+ 'partner_id': fields.related('account_id', 'partner_id', type='many2one', relation='res.partner', string='Partner', store=True),
}
_defaults = {
diff --git a/addons/account/account_analytic_view.xml b/addons/account/account_analytic_view.xml
new file mode 100644
index 00000000000..c73e0cbfd73
--- /dev/null
+++ b/addons/account/account_analytic_view.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_account_analytic_line_form_inherit_account" model="ir.ui.view">
+ <field name="name">account.analytic.line.form.inherit.account</field>
+ <field name="model">account.analytic.line</field>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//field[@name='account_id']" position="after">
+ <field name="journal_id"/>
+ </xpath>
+ <xpath expr="//field[@name='date']" position="after">
+ <field name="ref"/>
+ </xpath>
+ <xpath expr="//field[@name='company_id']" position="after">
+ <field name="partner_id"/>
+ </xpath>
+ <xpath expr="//field[@name='amount']" position="after">
+ <label for="amount_currency" groups="base.group_multi_currency"/>
+ <div groups="base.group_multi_currency">
+ <field name="amount_currency" class="oe_inline"/>
+ <field name="currency_id" class="oe_inline"/>
+ </div>
+ <field invisible="1" name="general_account_id"/>
+ </xpath>
+ <xpath expr="//label[@for='unit_amount']" position="before">
+ <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ </xpath>
+ <xpath expr="//field[@name='unit_amount']" position="after">
+ <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
+ </xpath>
+ <xpath expr="//group[@name='product_info']" position="after">
+ <group string="General Accounting">
+ <field name="general_account_id"/>
+ <field name="move_id" readonly="1"/>
+ </group>
+ </xpath>
+ </data>
+ </field>
+ </record>
+ <record id="view_account_analytic_line_tree_inherit_account" model="ir.ui.view">
+ <field name="name">account.analytic.line.tree.inherit.account</field>
+ <field name="model">account.analytic.line</field>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_tree"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//field[@name='date']" position="after">
+ <field name="ref" invisible="context.get('to_invoice', False)"/>
+ </xpath>
+ <xpath expr="//field[@name='user_id']" position="after">
+ <field name="partner_id"/>
+ <field name="journal_id" invisible="context.get('to_invoice', False)"/>
+ </xpath>
+ <xpath expr="//field[@name='amount']" position="after">
+ <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" invisible="not context.get('to_invoice', False)"/>
+ </xpath>
+ <xpath expr="//field[@name='unit_amount']" position="after">
+ <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" invisible="not context.get('to_invoice', False)"/>
+ </xpath>
+ <xpath expr="//field[@name='account_id']" position="after">
+ <field name="general_account_id" invisible="context.get('to_invoice', False)"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+ <record id="view_account_analytic_line_filter_inherit_account" model="ir.ui.view">
+ <field name="name">account.analytic.line.select.inherit.account</field>
+ <field name="model">account.analytic.line</field>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_filter"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//field[@name='date']" position="after">
+ <field name="product_id"/>
+ <filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" help="Analytic Journal Items related to a sale journal."/>
+ <filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" help="Analytic Journal Items related to a purchase journal."/>
+ <filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]"/>
+ </xpath>
+ <xpath expr="//field[@name='account_id']" position="after">
+ <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
+ </xpath>
+ <xpath expr="//filter[@name='user_id']" position="after">
+ <filter string="Financial Account" context="{'group_by':'general_account_id'}"/>
+ <filter string="Journal" context="{'group_by':'journal_id'}" name="group_journal"/>
+ <filter string="Product" context="{'group_by':'product_id'}"/>
+ <filter string="Partner" context="{'group_by':'partner_id'}"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="analytic.action_account_analytic_journal_open_form"
+ id="account_analytic_journal_entries"
+ parent="menu_finance_entries"/>
+
+ <record id="view_account_journal_1" model="ir.ui.view">
+ <field name="name">account.journal.form.1</field>
+ <field name="model">account.journal</field>
+ <field name="inherit_id" ref="account.view_account_journal_form"/>
+ <field name="arch" type="xml">
+ <field name="type" position="after">
+ <field name="analytic_journal_id" groups="analytic.group_analytic_accounting"/>
+ </field>
+ </field>
+ </record>
+
+ <menuitem groups="analytic.group_analytic_accounting" id="next_id_40"
+ name="Analytic" parent="account.menu_finance_generic_reporting"
+ sequence="4"/>
+ <menuitem groups="analytic.group_analytic_accounting"
+ action="analytic.action_account_analytic_journal"
+ id="account_analytic_journal_print" parent="account.next_id_40"/>
+ <menuitem
+ name="Chart of Analytic Accounts"
+ parent="account.menu_finance_charts"
+ action="analytic.action_account_analytic_chart"
+ id="menu_action_analytic_account_tree2"
+ icon="STOCK_INDENT"
+ groups="analytic.group_analytic_accounting"/>
+ <menuitem action="analytic.action_account_analytic_account_form" id="account_analytic_def_account"
+ parent="menu_analytic_accounting"
+ groups="analytic.group_analytic_accounting"/>
+
+ <menuitem groups="analytic.group_analytic_accounting" action="analytic.action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/>
+ </data>
+</openerp>
diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml
index 7e6b12782dd..54ced4602c8 100644
--- a/addons/account/demo/account_minimal.xml
+++ b/addons/account/demo/account_minimal.xml
@@ -315,7 +315,7 @@
<field name="sequence_id" ref="sequence_sale_journal"/>
<field name="default_credit_account_id" ref="a_sale"/>
<field name="default_debit_account_id" ref="a_sale"/>
- <field name="analytic_journal_id" ref="cose_journal_sale"/>
+ <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="refund_sales_journal" model="account.journal">
@@ -325,7 +325,7 @@
<field name="sequence_id" ref="sequence_refund_sales_journal"/>
<field name="default_credit_account_id" ref="a_sale"/>
<field name="default_debit_account_id" ref="a_sale"/>
- <field name="analytic_journal_id" ref="cose_journal_sale"/>
+ <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
</record>
@@ -357,7 +357,7 @@
<field name="sequence_id" ref="sequence_bank_journal"/>
<field name="default_debit_account_id" ref="bnk"/>
<field name="default_credit_account_id" ref="bnk"/>
- <field name="analytic_journal_id" ref="sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="check_journal" model="account.journal">
@@ -367,7 +367,7 @@
<field name="sequence_id" ref="sequence_check_journal"/>
<field name="default_debit_account_id" ref="cash"/>
<field name="default_credit_account_id" ref="cash"/>
- <field name="analytic_journal_id" ref="sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="cash_journal" model="account.journal">
@@ -387,7 +387,7 @@
<field name="sequence_id" ref="sequence_cash_journal"/>
<field name="default_debit_account_id" ref="cash"/>
<field name="default_credit_account_id" ref="cash"/>
- <field name="analytic_journal_id" ref="sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="miscellaneous_journal" model="account.journal">
@@ -395,7 +395,7 @@
<field name="code">TMIS</field>
<field name="type">general</field>
<field name="sequence_id" ref="sequence_miscellaneous_journal"/>
- <field name="analytic_journal_id" ref="sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="opening_journal" model="account.journal">
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index 36aa1ed409d..679baa8ee50 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -62,8 +62,8 @@
<field name="context">{'search_default_partner_id': [active_id], 'default_partner_id': active_id}</field>
<field name="name">Contracts/Analytic Accounts</field>
<field name="res_model">account.analytic.account</field>
- <field name="view_id" ref="view_account_analytic_account_tree"/>
- <field name="search_view_id" ref="view_account_analytic_account_search"/>
+ <field name="view_id" ref="analytic.view_account_analytic_account_tree"/>
+ <field name="search_view_id" ref="analytic.view_account_analytic_account_search"/>
</record>
<record model="ir.ui.view" id="partner_view_buttons">
<field name="name">partner.view.buttons</field>
diff --git a/addons/account/project/__init__.py b/addons/account/project/__init__.py
deleted file mode 100644
index b0d01bbcfb7..00000000000
--- a/addons/account/project/__init__.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import project
-import report
-import wizard
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/project.py b/addons/account/project/project.py
deleted file mode 100644
index a1fac188518..00000000000
--- a/addons/account/project/project.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from openerp.osv import fields, osv
-
-class account_analytic_journal(osv.osv):
- _name = 'account.analytic.journal'
- _description = 'Analytic Journal'
- _columns = {
- 'name': fields.char('Journal Name', required=True),
- 'code': fields.char('Journal Code', size=8),
- 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
- 'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, Odoo will look for a matching journal of the same type."),
- 'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
- 'company_id': fields.many2one('res.company', 'Company', required=True),
- }
- _defaults = {
- 'active': True,
- 'type': 'general',
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
- }
-
-
-class account_journal(osv.osv):
- _inherit="account.journal"
-
- _columns = {
- 'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"),
- }
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/project_account_analytic_line.py b/addons/account/project/wizard/project_account_analytic_line.py
deleted file mode 100644
index 40777f73e7d..00000000000
--- a/addons/account/project/wizard/project_account_analytic_line.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-from openerp.osv import fields, osv
-from openerp.tools.translate import _
-
-class project_account_analytic_line(osv.osv_memory):
- _name = "project.account.analytic.line"
- _description = "Analytic Entries by line"
- _columns = {
- 'from_date': fields.date('From'),
- 'to_date': fields.date('To'),
- }
-
- def action_open_window(self, cr, uid, ids, context=None):
- mod_obj =self.pool.get('ir.model.data')
- domain = []
- data = self.read(cr, uid, ids, [])[0]
- from_date = data['from_date']
- to_date = data['to_date']
- if from_date and to_date:
- domain = [('date','>=',from_date), ('date','<=',to_date)]
- elif from_date:
- domain = [('date','>=',from_date)]
- elif to_date:
- domain = [('date','<=',to_date)]
- result = mod_obj.get_object_reference(cr, uid, 'account', 'view_account_analytic_line_filter')
- id = result and result[1] or False
- return {
- 'name': _('Analytic Entries by line'),
- 'view_type': 'form',
- "view_mode": 'tree,form',
- 'res_model': 'account.analytic.line',
- 'type': 'ir.actions.act_window',
- 'domain': domain,
- 'search_view_id': id['res_id'],
- }
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/project_account_analytic_line_view.xml b/addons/account/project/wizard/project_account_analytic_line_view.xml
deleted file mode 100644
index ac3047e7e1d..00000000000
--- a/addons/account/project/wizard/project_account_analytic_line_view.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <record id="view_project_account_analytic_line_form" model="ir.ui.view">
- <field name="name">project.account.analytic.line.form</field>
- <field name="model">project.account.analytic.line</field>
- <field name="arch" type="xml">
- <form string="View Account Analytic Lines">
- <header>
- <button string="Open Entries" name="action_open_window" type="object" class="oe_highlight"/>
- or
- <button string="Cancel" class="oe_link" special="cancel"/>
- </header>
- <group col="4">
- <field name="from_date"/>
- <field name="to_date"/>
- </group>
- <label string ="(Keep empty to open the current situation)" />
- </form>
- </field>
- </record>
-
- <record id="action_project_account_analytic_line_form" model="ir.actions.act_window">
- <field name="name">Entries By Line</field>
- <field name="res_model">project.account.analytic.line</field>
- <field name="view_type">form</field>
- <field name="view_mode">tree,form</field>
- <field name="view_id" ref="view_project_account_analytic_line_form"/>
- <field name="target">new</field>
- </record>
-
- </data>
-</openerp>
diff --git a/addons/account/report/account_analytic_entries_report.py b/addons/account/report/account_analytic_entries_report.py
index 1cd0f4c9026..a5da58eb4b8 100644
--- a/addons/account/report/account_analytic_entries_report.py
+++ b/addons/account/report/account_analytic_entries_report.py
@@ -33,8 +33,8 @@ class analytic_entries_report(osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
- 'account_id': fields.many2one('account.analytic.account', 'Account', required=False),
- 'general_account_id': fields.many2one('account.account', 'General Account', required=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=False),
+ 'general_account_id': fields.many2one('account.account', 'Financial Account', required=True),
'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True),
'move_id': fields.many2one('account.move.line', 'Move', required=True),
'product_id': fields.many2one('product.product', 'Product', required=True),
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index 2020b56d1fe..ac0551de8f8 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -14,8 +14,8 @@
<group expand="0" string="Group By">
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
- <filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
- <filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
+ <filter string="Analytic Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
+ <filter string="Financial Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<filter string="Product Unit of Measure" icon="terp-mrp" context="{'group_by':'product_uom_id'}"/>
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index 65d3e95be54..9cbfd161a1f 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -62,13 +62,6 @@
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
- <record id="analytic_journal_comp_rule" model="ir.rule">
- <field name="name">Analytic journal multi-company</field>
- <field name="model_id" ref="model_account_analytic_journal"/>
- <field name="global" eval="True"/>
- <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
- </record>
-
<record id="period_comp_rule" model="ir.rule">
<field name="name">Period multi-company</field>
<field name="model_id" ref="model_account_period"/>
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index 16ad4fee690..be8342cf88e 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -24,8 +24,8 @@ access_account_bank_statement,account.bank.statement,model_account_bank_statemen
access_account_bank_statement_line,account.bank.statement.line,model_account_bank_statement_line,account.group_account_user,1,1,1,1
access_account_analytic_line_manager,account.analytic.line manager,model_account_analytic_line,account.group_account_manager,1,0,0,0
access_account_analytic_account,account.analytic.account,analytic.model_account_analytic_account,base.group_user,1,0,0,0
-access_account_analytic_journal,account.analytic.journal,model_account_analytic_journal,account.group_account_user,1,0,0,0
-access_account_analytic_journal_user,account.analytic.journal,model_account_analytic_journal,base.group_user,1,1,1,0
+access_account_analytic_journal,account.analytic.journal,analytic.model_account_analytic_journal,account.group_account_user,1,0,0,0
+access_account_analytic_journal_user,account.analytic.journal,analytic.model_account_analytic_journal,base.group_user,1,1,1,0
access_account_invoice_uinvoice,account.invoice,model_account_invoice,account.group_account_invoice,1,1,1,1
access_account_invoice_line_uinvoice,account.invoice.line,model_account_invoice_line,account.group_account_invoice,1,1,1,1
access_account_invoice_tax_uinvoice,account.invoice.tax,model_account_invoice_tax,account.group_account_invoice,1,1,1,1
@@ -41,7 +41,7 @@ access_account_journal_invoice,account.journal invoice,model_account_journal,acc
access_account_period_manager,account.period,model_account_period,account.group_account_manager,1,1,1,1
access_account_period_invoice,account.period invoice,model_account_period,account.group_account_invoice,1,0,0,0
access_account_invoice_group_invoice,account.invoice group invoice,model_account_invoice,account.group_account_invoice,1,1,1,1
-access_account_analytic_journal_manager,account.analytic.journal,model_account_analytic_journal,account.group_account_manager,1,1,1,1
+access_account_analytic_journal_manager,account.analytic.journal,analytic.model_account_analytic_journal,account.group_account_manager,1,1,1,1
access_account_fiscalyear,account.fiscalyear,model_account_fiscalyear,account.group_account_manager,1,1,1,1
access_account_fiscalyear_invoice,account.fiscalyear.invoice,model_account_fiscalyear,account.group_account_invoice,1,0,0,0
access_account_fiscalyear_partner_manager,account.fiscalyear.partnermanager,model_account_fiscalyear,base.group_partner_manager,1,0,0,0
diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml
index 75c94a6eae6..e9d232ece13 100644
--- a/addons/account/test/account_fiscalyear_close.yml
+++ b/addons/account/test/account_fiscalyear_close.yml
@@ -34,7 +34,7 @@
name: End of Year
code: NEW
type: situation
- analytic_journal_id: sit
+ analytic_journal_id: analytic.sit
default_debit_account_id: cash
default_credit_account_id: cash
company_id: base.main_company
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
index 9173c37b61e..d13b38708e2 100644
--- a/addons/account/test/account_report.yml
+++ b/addons/account/test/account_report.yml
@@ -135,47 +135,47 @@
-
!python {model: account.analytic.account}: |
ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Cost Ledger Report through the wizard
-
!python {model: account.analytic.account}: |
ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root'),ref('analytic.analytic_absences'),ref('analytic.analytic_internal'),ref('analytic.analytic_our_super_product')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Cost Ledger(Only Quantities) Report through the wizard
-
!python {model: account.analytic.account}: |
ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root'),ref('analytic.analytic_absences'),ref('analytic.analytic_internal'),ref('analytic.analytic_our_super_product')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Analytic Journal Report through the wizard
-
!python {model: account.analytic.journal}: |
ctx={}
- ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]})
+ ctx.update({'model': 'account.analytic.journal','active_ids': [ref('analytic.cose_journal_sale'), ref('account.exp'), ref('analytic.sit')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Inverted Analytic Balance Report through the wizard
-
!python {model: account.analytic.account}: |
ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account') \ No newline at end of file
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index ec363a2cdb9..7b9a9434b82 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -197,7 +197,7 @@
<record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
<field name="name">account.analytic.account.list.contract</field>
<field name="model">account.analytic.account</field>
- <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
+ <field name="inherit_id" ref="analytic.view_account_analytic_account_list"/>
<field name="arch" type="xml">
<field name="date_start" position="before">
<field name="last_invoice_date"/>
@@ -280,7 +280,7 @@
<field name="view_mode">tree,form</field>
<field name="domain">[('invoice_id','=',False)]</field>
<field name="context">{'search_default_to_invoice': 1}</field>
- <field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
+ <field name="search_view_id" ref="analytic.view_account_analytic_line_filter"/>
<field name="help" type="html">
<p>
You will find here timesheets and purchases you did for
@@ -338,6 +338,21 @@
</field>
</record>
<menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config"/>
+
+ <record id="account_analytic_analysis_form_form" model="ir.ui.view">
+ <field name="name">account.analytic.account.invoice.form.inherit</field>
+ <field name="model">account.analytic.account</field>
+ <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
+ <field eval="20" name="priority"/>
+ <field name="arch" type="xml">
+ <xpath expr='//div[@name="buttons"]' position='inside'>
+ <button class="oe_inline oe_stat_button" string="Time &amp; Materials to Invoice"
+ name="%(action_hr_tree_invoiced_all)d"
+ type="action"
+ context="{'search_default_account_id': [active_id], 'default_account_id': active_id}"/>
+ </xpath>
+ </field>
+ </record>
</data>
</openerp>
diff --git a/addons/account_analytic_analysis/analytic_account_demo.xml b/addons/account_analytic_analysis/analytic_account_demo.xml
index 4198b3e425c..9cb00b6b0b3 100644
--- a/addons/account_analytic_analysis/analytic_account_demo.xml
+++ b/addons/account_analytic_analysis/analytic_account_demo.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
- <record id="account.analytic_consultancy" model="account.analytic.account">
+ <record id="analytic.analytic_consultancy" model="account.analytic.account">
<field name="partner_id" ref="base.res_partner_15"/>
<field name="invoice_on_timesheets">True</field>
<field name="hours_qtt_est">1200</field>
@@ -12,16 +12,16 @@
</record>
<record id="sale.sale_order_4" model="sale.order">
- <field name="project_id" ref="account.analytic_consultancy"/>
+ <field name="project_id" ref="analytic.analytic_consultancy"/>
</record>
<record id="hr_timesheet.working_hours_maintenance" model="hr.analytic.timesheet">
- <field name="account_id" ref="account.analytic_consultancy"/>
+ <field name="account_id" ref="analytic.analytic_consultancy"/>
<field name="to_invoice" ref="hr_timesheet_invoice.timesheet_invoice_factor1"/>
<field name="unit_amount">100</field>
</record>
- <record id="account.analytic_super_product_trainings" model="account.analytic.account">
+ <record id="analytic.analytic_super_product_trainings" model="account.analytic.account">
<field name="partner_id" ref="base.res_partner_18"/>
<field name="invoice_on_timesheets">True</field>
<field name="hours_qtt_est">500</field>
@@ -32,11 +32,11 @@
</record>
<record id="sale.sale_order_6" model="sale.order">
- <field name="project_id" ref="account.analytic_super_product_trainings"/>
+ <field name="project_id" ref="analytic.analytic_super_product_trainings"/>
<field name="partner_id" ref="base.res_partner_1"/>
</record>
- <record id="account.analytic_support_internal" model="account.analytic.account">
+ <record id="analytic.analytic_support_internal" model="account.analytic.account">
<field name="partner_id" ref="base.res_partner_1"/>
<field name="use_timesheets">True</field>
<field name="invoice_on_timesheets">True</field>
diff --git a/addons/account_analytic_plans/test/acount_analytic_plans_report.yml b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml
index cae58583793..35a68246d28 100644
--- a/addons/account_analytic_plans/test/acount_analytic_plans_report.yml
+++ b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml
@@ -5,7 +5,7 @@
import os, time
import openerp.report
from openerp import tools
- data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'journal_ids':[6,0,(ref('account.cose_journal_sale'))],'ref':ref('account.analytic_root'),'empty_line':True,'id':ref('account.analytic_root'),'context':{}}}
- data, format = openerp.report.render_report(cr, uid, [ref('account.analytic_root')], 'account_analytic_plans.report_crossoveredanalyticplans', data_dict, {})
+ data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'journal_ids':[6,0,(ref('analytic.cose_journal_sale'))],'ref':ref('analytic.analytic_root'),'empty_line':True,'id':ref('analytic.analytic_root'),'context':{}}}
+ data, format = openerp.report.render_report(cr, uid, [ref('analytic.analytic_root')], 'account_analytic_plans.report_crossoveredanalyticplans', data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_analytic_plans-crossovered_analyitic.'+format), 'wb+').write(data)
diff --git a/addons/account_budget/account_budget_demo.xml b/addons/account_budget/account_budget_demo.xml
index d93e78e3448..f5de2cfcdc5 100644
--- a/addons/account_budget/account_budget_demo.xml
+++ b/addons/account_budget/account_budget_demo.xml
@@ -42,7 +42,7 @@
<!-- Budget lines -->
<data noupdate="1">
<record id="crossovered_budget_lines_0" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_consultancy"/>
+ <field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-01-01'" name="date_from"/>
<field eval="-500.0" name="planned_amount"/>
@@ -50,7 +50,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-01-31'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_1" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_consultancy"/>
+ <field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-02-01'" name="date_from"/>
<field eval="-250.0" name="planned_amount"/>
@@ -58,7 +58,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-02-28'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_2" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_consultancy"/>
+ <field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-01-01'" name="date_from"/>
<field eval="500.0" name="planned_amount"/>
@@ -66,7 +66,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-01-31'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_3" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_consultancy"/>
+ <field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-02-07'" name="date_from"/>
<field eval="900.0" name="planned_amount"/>
@@ -74,7 +74,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-02-28'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_4" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_consultancy"/>
+ <field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-03-01'" name="date_from"/>
<field eval="300.0" name="planned_amount"/>
@@ -84,7 +84,7 @@
</data>
<data noupdate="1">
<record id="crossovered_budget_lines_5" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_super_product_trainings"/>
+ <field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-03-16'" name="date_from"/>
<field eval="375.0" name="planned_amount"/>
@@ -93,7 +93,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-03-31'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_6" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_super_product_trainings"/>
+ <field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/>
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-04-01'" name="date_from"/>
<field eval="-150.0" name="planned_amount"/>
@@ -101,7 +101,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-04-30'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_7" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_super_product_trainings"/>
+ <field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-05-01'" name="date_from"/>
<field eval="375.0" name="planned_amount"/>
@@ -112,7 +112,7 @@
</data>
<data noupdate="1">
<record id="crossovered_budget_lines_8" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-06-01'" name="date_from"/>
<field eval="-7500.0" name="planned_amount"/>
@@ -120,7 +120,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-06-15'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_9" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-06-16'" name="date_from"/>
<field eval="-5000.0" name="planned_amount"/>
@@ -128,7 +128,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-06-30'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_10" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-07-01'" name="date_from"/>
<field eval="-2000.0" name="planned_amount"/>
@@ -136,7 +136,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-07-15'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_11" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-07-16'" name="date_from"/>
<field eval="20000.0" name="planned_amount"/>
@@ -144,7 +144,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-07-31'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_12" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-08-01'" name="date_from"/>
<field eval="20000.0" name="planned_amount"/>
@@ -154,7 +154,7 @@
</data>
<data noupdate="1">
<record id="crossovered_budget_lines_13" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p2"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/>
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-08-16'" name="date_from"/>
<field eval="-3000.0" name="planned_amount"/>
@@ -162,7 +162,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-08-31'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_14" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p2"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/>
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-09-01'" name="date_from"/>
<field eval="-1000.0" name="planned_amount"/>
@@ -170,7 +170,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-09-15'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_15" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p2"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-09-16'" name="date_from"/>
<field eval="10000.0" name="planned_amount"/>
@@ -178,7 +178,7 @@
<field eval="str(time.localtime(time.time())[0]+1)+'-09-30'" name="date_to"/>
</record>
<record id="crossovered_budget_lines_16" model="crossovered.budget.lines">
- <field name="analytic_account_id" ref="account.analytic_seagate_p2"/>
+ <field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/>
<field name="general_budget_id" ref="account_budget_post_sales0"/>
<field eval="str(time.localtime(time.time())[0]+1)+'-10-01'" name="date_from"/>
<field eval="10000.0" name="planned_amount"/>
diff --git a/addons/account_budget/test/account_budget.yml b/addons/account_budget/test/account_budget.yml
index f656d214405..cab07c3600e 100644
--- a/addons/account_budget/test/account_budget.yml
+++ b/addons/account_budget/test/account_budget.yml
@@ -16,12 +16,12 @@
-
!record {model: crossovered.budget, id: crossovered_budget_budget0}:
crossovered_budget_line:
- - analytic_account_id: account.analytic_consultancy
+ - analytic_account_id: analytic.analytic_consultancy
date_from: !eval "'%s-01-01' %(datetime.now().year+1)"
date_to: !eval "'%s-12-31' %(datetime.now().year+1)"
general_budget_id: account_budget.account_budget_post_purchase0
planned_amount: 10000.0
- - analytic_account_id: account.analytic_super_product_trainings
+ - analytic_account_id: analytic.analytic_super_product_trainings
date_from: !eval "'%s-09-01' %(datetime.now().year+1)"
date_to: !eval "'%s-09-30' %(datetime.now().year+1)"
general_budget_id: account_budget.account_budget_post_sales0
diff --git a/addons/account_budget/test/account_budget_report.yml b/addons/account_budget/test/account_budget_report.yml
index a36c2d87d04..4b2d9d2bbcf 100644
--- a/addons/account_budget/test/account_budget_report.yml
+++ b/addons/account_budget/test/account_budget_report.yml
@@ -2,7 +2,7 @@
Print the Analytic Budget Report through wizard
-
!python {model: account.analytic.account}: |
- ctx = {'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}
+ ctx = {'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]}
from openerp.tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data={}, context=ctx, our_module='account_budget')
diff --git a/addons/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml
index 4c19c33eb5f..bda36a5f267 100644
--- a/addons/account_voucher/test/case1_usd_usd.yml
+++ b/addons/account_voucher/test/case1_usd_usd.yml
@@ -60,7 +60,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
diff --git a/addons/account_voucher/test/case1_usd_usd_payment_rate.yml b/addons/account_voucher/test/case1_usd_usd_payment_rate.yml
index 7f5cf15284d..9b2244ff76a 100644
--- a/addons/account_voucher/test/case1_usd_usd_payment_rate.yml
+++ b/addons/account_voucher/test/case1_usd_usd_payment_rate.yml
@@ -60,7 +60,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
index 0eb71d66d4d..e679a4c631c 100644
--- a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
+++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
@@ -54,7 +54,7 @@
name: Bank Journal(EUR)
code: BEUR
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
@@ -66,7 +66,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
index 12d6f07b33a..f52fcbbaa0c 100644
--- a/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
+++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
@@ -54,7 +54,7 @@
name: Bank Journal(EUR)
code: BEUR
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
@@ -66,7 +66,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml
index 6c48c2e2136..b2732bbce72 100644
--- a/addons/account_voucher/test/case3_eur_eur.yml
+++ b/addons/account_voucher/test/case3_eur_eur.yml
@@ -22,7 +22,7 @@
name: Bank Journal(EUR)
code: BEUR
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml
index e31dd5783c0..d06b851fd19 100644
--- a/addons/account_voucher/test/case4_cad_chf.yml
+++ b/addons/account_voucher/test/case4_cad_chf.yml
@@ -55,7 +55,7 @@
name: Bank Journal(CHF)
code: BCHF
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_chf_id
default_credit_account_id: account_cash_chf_id
diff --git a/addons/account_voucher/test/case5_suppl_usd_usd.yml b/addons/account_voucher/test/case5_suppl_usd_usd.yml
index 327cd9de25c..c46e3be46ec 100644
--- a/addons/account_voucher/test/case5_suppl_usd_usd.yml
+++ b/addons/account_voucher/test/case5_suppl_usd_usd.yml
@@ -41,7 +41,7 @@
name: Bank Journal(EUR)
code: BEUR
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
@@ -53,7 +53,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id2
default_credit_account_id: account_cash_usd_id2
diff --git a/addons/account_voucher/test/case_eur_usd.yml b/addons/account_voucher/test/case_eur_usd.yml
index ce2b71d7ac0..4f0c711fed1 100644
--- a/addons/account_voucher/test/case_eur_usd.yml
+++ b/addons/account_voucher/test/case_eur_usd.yml
@@ -39,7 +39,7 @@
name: Bank Journal Test(USD)
code: BEUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_eur_usd_id
default_credit_account_id: account_eur_usd_id
diff --git a/addons/analytic/__init__.py b/addons/analytic/__init__.py
index d0175cf1424..53109ee0c7e 100644
--- a/addons/analytic/__init__.py
+++ b/addons/analytic/__init__.py
@@ -19,7 +19,9 @@
#
##############################################################################
-import analytic
+import models
+import report
+import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/analytic/__openerp__.py b/addons/analytic/__openerp__.py
index eaff26df197..79eacdd79bf 100644
--- a/addons/analytic/__openerp__.py
+++ b/addons/analytic/__openerp__.py
@@ -37,11 +37,26 @@ that have no counterpart in the general financial accounts.
'data': [
'security/analytic_security.xml',
'security/ir.model.access.csv',
- 'analytic_sequence.xml',
- 'analytic_view.xml',
- 'analytic_data.xml',
+ 'data/analytic_sequence.xml',
+ 'views/analytic_view.xml',
+ 'data/analytic_data.xml',
+ 'analytic_report.xml',
+ 'wizard/account_analytic_balance_report_view.xml',
+ 'wizard/account_analytic_cost_ledger_view.xml',
+ 'wizard/account_analytic_inverted_balance_report.xml',
+ 'wizard/account_analytic_journal_report_view.xml',
+ 'wizard/account_analytic_cost_ledger_for_journal_report_view.xml',
+ 'wizard/account_analytic_chart_view.xml',
+ 'views/report_analyticbalance.xml',
+ 'views/report_analyticjournal.xml',
+ 'views/report_analyticcostledgerquantity.xml',
+ 'views/report_analyticcostledger.xml',
+ 'views/report_invertedanalyticbalance.xml',
+ ],
+ 'demo': [
+ 'data/analytic_demo.xml',
+ 'data/analytic_account_demo.xml',
],
- 'demo': [],
'installable': True,
'auto_install': False,
}
diff --git a/addons/account/project/project_report.xml b/addons/analytic/analytic_report.xml
index de2e2feee5a..de2e2feee5a 100644
--- a/addons/account/project/project_report.xml
+++ b/addons/analytic/analytic_report.xml
diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml
deleted file mode 100644
index 7b1b16037cf..00000000000
--- a/addons/analytic/analytic_view.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <record id="view_account_analytic_account_form" model="ir.ui.view">
- <field name="name">analytic.analytic.account.form</field>
- <field name="model">account.analytic.account</field>
- <field name="arch" type="xml">
- <form string="Analytic Account">
- <sheet string="Analytic Account">
- <div class="oe_right oe_button_box" name="buttons">
- </div>
-
- <div class="oe_title">
- <label for="name" class="oe_edit_only"/>
- <h1>
- <field name="name" class="oe_inline"/>
- </h1>
- <div name="project"/>
- </div>
-
- <group name="main">
- <group>
- <field name="partner_id" on_change="on_change_partner_id(partner_id, name)"/>
- <field name="manager_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_manager']}"/>
- <field name="currency_id" attrs="{'invisible': ['|',('type', '&lt;&gt;', 'view'), ('company_id', '&lt;&gt;', False)]}"/>
- </group>
- <group>
- <field name="type" invisible="context.get('default_type', False)"/>
- <field name="template_id" on_change="on_change_template(template_id, date_start)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
- <field name="code"/>
- <field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract'])]}"/>
- <field name="company_id" on_change="on_change_company(company_id)" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','&lt;&gt;','view')]}"/>
- </group>
- </group>
- <notebook>
- <page string="Contract Information" name="contract_page" attrs="{'invisible':[('type','not in',['contract', 'template'])]}">
- <group string="Renewal" name="contract">
- <p colspan="2" class="oe_grey oe_edit_only">
- Once the end date of the contract is
- passed or the maximum number of service
- units (e.g. support contract) is
- reached, the account manager is notified
- by email to renew the contract with the
- customer.
- </p>
- <field name="date_start"/>
- <label for="date" string="End Date"/>
- <div name="duration">
- <field name="date" class="oe_inline"/>
- </div>
- </group>
- <separator string="Terms and Conditions" name="description"/>
- <field name="description"/>
- </page>
- </notebook>
- </sheet>
- <div class="oe_chatter">
- <field name="message_follower_ids" widget="mail_followers"/>
- <field name="message_ids" widget="mail_thread"/>
- </div>
- </form>
- </field>
- </record>
- </data>
-</openerp>
diff --git a/addons/account/project/analytic_account_demo.xml b/addons/analytic/data/analytic_account_demo.xml
index 2c4acc6bc45..2c4acc6bc45 100644
--- a/addons/account/project/analytic_account_demo.xml
+++ b/addons/analytic/data/analytic_account_demo.xml
diff --git a/addons/analytic/analytic_data.xml b/addons/analytic/data/analytic_data.xml
index 042c2162036..042c2162036 100644
--- a/addons/analytic/analytic_data.xml
+++ b/addons/analytic/data/analytic_data.xml
diff --git a/addons/account/project/project_demo.xml b/addons/analytic/data/analytic_demo.xml
index 5ce34521b45..5ce34521b45 100644
--- a/addons/account/project/project_demo.xml
+++ b/addons/analytic/data/analytic_demo.xml
diff --git a/addons/analytic/analytic_sequence.xml b/addons/analytic/data/analytic_sequence.xml
index ab36d77bb33..ab36d77bb33 100644
--- a/addons/analytic/analytic_sequence.xml
+++ b/addons/analytic/data/analytic_sequence.xml
diff --git a/addons/analytic/models/__init__.py b/addons/analytic/models/__init__.py
new file mode 100644
index 00000000000..dca9f87f0ec
--- /dev/null
+++ b/addons/analytic/models/__init__.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+import analytic
diff --git a/addons/analytic/analytic.py b/addons/analytic/models/analytic.py
index e31efa0eb2a..340a37f2d78 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/models/analytic.py
@@ -326,6 +326,7 @@ class account_analytic_line(osv.osv):
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='restrict', select=True, domain=[('type','<>','view')]),
'user_id': fields.many2one('res.users', 'User'),
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
+ 'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True),
}
@@ -354,4 +355,23 @@ class account_analytic_line(osv.osv):
(_check_no_view, 'You cannot create analytic line on view account.', ['account_id']),
]
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
+class account_analytic_journal(osv.osv):
+ _name = 'account.analytic.journal'
+ _description = 'Analytic Journal'
+ _columns = {
+ 'name': fields.char('Journal Name', required=True),
+ 'code': fields.char('Journal Code', size=8),
+ 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
+ 'type': fields.selection(
+ [('sale', 'Sale'), ('purchase', 'Purchase'), ('cash', 'Cash'),
+ ('general', 'General'), ('situation', 'Situation')],
+ 'Type', required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, Odoo will look for a matching journal of the same type."),
+ 'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ }
+ _defaults = {
+ 'active': True,
+ 'type': 'general',
+ 'company_id': lambda self, cr, uid, c=None: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+ }
diff --git a/addons/account/project/report/__init__.py b/addons/analytic/report/__init__.py
index 32226f801e9..ff72ccd21f1 100644
--- a/addons/account/project/report/__init__.py
+++ b/addons/analytic/report/__init__.py
@@ -21,9 +21,9 @@
import analytic_journal
import analytic_balance
-import inverted_analytic_balance
-import cost_ledger
-import quantity_cost_ledger
+import analytic_inverted_balance
+import analytic_cost_ledger
+import analytic_quantity_cost_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/analytic_balance.py b/addons/analytic/report/analytic_balance.py
index 7c333b84c45..b8908898b77 100644
--- a/addons/account/project/report/analytic_balance.py
+++ b/addons/analytic/report/analytic_balance.py
@@ -151,7 +151,7 @@ class account_analytic_balance(report_sxw.rml_parse):
class report_analyticbalance(osv.AbstractModel):
_name = 'report.account.report_analyticbalance'
_inherit = 'report.abstract_report'
- _template = 'account.report_analyticbalance'
+ _template = 'analytic.report_analyticbalance'
_wrapped_report_class = account_analytic_balance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/cost_ledger.py b/addons/analytic/report/analytic_cost_ledger.py
index 5eef375eaab..77c6cad04a4 100644
--- a/addons/account/project/report/cost_ledger.py
+++ b/addons/analytic/report/analytic_cost_ledger.py
@@ -105,7 +105,7 @@ class account_analytic_cost_ledger(report_sxw.rml_parse):
class report_analyticcostledger(osv.AbstractModel):
_name = 'report.account.report_analyticcostledger'
_inherit = 'report.abstract_report'
- _template = 'account.report_analyticcostledger'
+ _template = 'analytic.report_analyticcostledger'
_wrapped_report_class = account_analytic_cost_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/inverted_analytic_balance.py b/addons/analytic/report/analytic_inverted_balance.py
index 23129144555..8a47322546c 100644
--- a/addons/account/project/report/inverted_analytic_balance.py
+++ b/addons/analytic/report/analytic_inverted_balance.py
@@ -124,7 +124,7 @@ class account_inverted_analytic_balance(report_sxw.rml_parse):
class report_invertedanalyticbalance(osv.AbstractModel):
_name = 'report.account.report_invertedanalyticbalance'
_inherit = 'report.abstract_report'
- _template = 'account.report_invertedanalyticbalance'
+ _template = 'analytic.report_invertedanalyticbalance'
_wrapped_report_class = account_inverted_analytic_balance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/analytic_journal.py b/addons/analytic/report/analytic_journal.py
index c59efb057d7..38231b69f5f 100644
--- a/addons/account/project/report/analytic_journal.py
+++ b/addons/analytic/report/analytic_journal.py
@@ -62,7 +62,7 @@ class account_analytic_journal(report_sxw.rml_parse):
class report_analyticjournal(osv.AbstractModel):
_name = 'report.account.report_analyticjournal'
_inherit = 'report.abstract_report'
- _template = 'account.report_analyticjournal'
+ _template = 'analytic.report_analyticjournal'
_wrapped_report_class = account_analytic_journal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/quantity_cost_ledger.py b/addons/analytic/report/analytic_quantity_cost_ledger.py
index d3ed1cdc3a8..c4bf9ade72f 100644
--- a/addons/account/project/report/quantity_cost_ledger.py
+++ b/addons/analytic/report/analytic_quantity_cost_ledger.py
@@ -121,7 +121,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
class report_analyticcostledgerquantity(osv.AbstractModel):
_name = 'report.account.report_analyticcostledgerquantity'
_inherit = 'report.abstract_report'
- _template = 'account.report_analyticcostledgerquantity'
+ _template = 'analytic.report_analyticcostledgerquantity'
_wrapped_report_class = account_analytic_quantity_cost_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/analytic/security/analytic_security.xml b/addons/analytic/security/analytic_security.xml
index bf103ca8988..43bf89de406 100644
--- a/addons/analytic/security/analytic_security.xml
+++ b/addons/analytic/security/analytic_security.xml
@@ -15,6 +15,13 @@
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
+
+ <record id="analytic_journal_comp_rule" model="ir.rule">
+ <field name="name">Analytic journal multi-company</field>
+ <field name="model_id" ref="model_account_analytic_journal"/>
+ <field name="global" eval="True"/>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+ </record>
</data>
<data noupdate="0">
diff --git a/addons/account/project/project_view.xml b/addons/analytic/views/analytic_view.xml
index 878b8ef158d..0df238fbd0a 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/analytic/views/analytic_view.xml
@@ -2,6 +2,67 @@
<openerp>
<data>
+ <record id="view_account_analytic_account_form" model="ir.ui.view">
+ <field name="name">analytic.analytic.account.form</field>
+ <field name="model">account.analytic.account</field>
+ <field name="arch" type="xml">
+ <form string="Analytic Account" version="7.0">
+ <sheet string="Analytic Account">
+ <div class="oe_right oe_button_box" name="buttons">
+ </div>
+
+ <div class="oe_title">
+ <label for="name" class="oe_edit_only"/>
+ <h1>
+ <field name="name" class="oe_inline"/>
+ </h1>
+ <div name="project"/>
+ </div>
+
+ <group name="main">
+ <group>
+ <field name="partner_id" on_change="on_change_partner_id(partner_id, name)"/>
+ <field name="manager_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_manager']}"/>
+ <field name="currency_id" attrs="{'invisible': ['|',('type', '&lt;&gt;', 'view'), ('company_id', '&lt;&gt;', False)]}"/>
+ </group>
+ <group>
+ <field name="type" invisible="context.get('default_type', False)"/>
+ <field name="template_id" on_change="on_change_template(template_id, date_start)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
+ <field name="code"/>
+ <field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract'])]}"/>
+ <field name="company_id" on_change="on_change_company(company_id)" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','&lt;&gt;','view')]}"/>
+ </group>
+ </group>
+ <notebook>
+ <page string="Contract Information" name="contract_page" attrs="{'invisible':[('type','not in',['contract', 'template'])]}">
+ <group string="Renewal" name="contract">
+ <p colspan="2" class="oe_grey oe_edit_only">
+ Once the end date of the contract is
+ passed or the maximum number of service
+ units (e.g. support contract) is
+ reached, the account manager is notified
+ by email to renew the contract with the
+ customer.
+ </p>
+ <field name="date_start"/>
+ <label for="date" string="End Date"/>
+ <div name="duration">
+ <field name="date" class="oe_inline"/>
+ </div>
+ </group>
+ <separator string="Terms and Conditions" name="description"/>
+ <field name="description"/>
+ </page>
+ </notebook>
+ </sheet>
+ <div class="oe_chatter">
+ <field name="message_follower_ids" widget="mail_followers"/>
+ <field name="message_ids" widget="mail_thread"/>
+ </div>
+ </form>
+ </field>
+ </record>
+
<record id="view_account_analytic_account_list" model="ir.ui.view">
<field name="name">account.analytic.account.list</field>
<field name="model">account.analytic.account</field>
@@ -37,7 +98,7 @@
<field name="user_id"/>
<filter string="Open" domain="[('state','=','open')]" help="Current Accounts"/>
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
- <group expand="0" string="Group By">
+ <group expand="0" string="Group By...">
<filter string="Associated Partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Type" domain="[]" context="{'group_by':'type'}"/>
<filter string="Template" domain="[]" context="{'group_by':'template_id'}"/>
@@ -82,11 +143,8 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_analytic_account_tree"/>
- <field name="search_view_id" ref="account.view_account_analytic_account_search"/>
+ <field name="search_view_id" ref="analytic.view_account_analytic_account_search"/>
</record>
- <menuitem action="action_account_analytic_account_form" id="account_analytic_def_account"
- parent="menu_analytic_accounting"
- groups="analytic.group_analytic_accounting"/>
<record id="act_account_renew_view" model="ir.actions.act_window">
<field name="name">Accounts to Renew</field>
@@ -127,39 +185,26 @@
<field name="model">account.analytic.line</field>
<field name="priority">1</field>
<field name="arch" type="xml">
- <form string="Analytic Entry">
+ <form string="Analytic Entry" version="7.0">
<group>
<group>
<field name="name"/>
<field name="account_id"/>
- <field name="journal_id"/>
<field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}"/>
</group>
<group>
<field name="date"/>
- <field name="ref"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group string="Amount">
<field name="amount"/>
- <label for="amount_currency" groups="base.group_multi_currency"/>
- <div groups="base.group_multi_currency">
- <field name="amount_currency" class="oe_inline"/>
- <field name="currency_id" class="oe_inline"/>
- </div>
</group>
- <group string="Product Information">
- <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
+ <group string="Product Information" name="product_info">
<label for="unit_amount"/>
<div>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
- <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
</div>
</group>
- <group string="General Accounting">
- <field name="general_account_id"/>
- <field name="move_id" readonly="1"/>
- </group>
</group>
</form>
</field>
@@ -170,16 +215,11 @@
<field name="arch" type="xml">
<tree string="Analytic Entries">
<field name="date"/>
- <field name="ref" invisible="context.get('to_invoice', False)"/>
<field name="name"/>
<field name="user_id"/>
- <field name="journal_id" invisible="context.get('to_invoice', False)"/>
<field name="amount" sum="Total" invisible="context.get('to_invoice', False)"/>
- <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" invisible="not context.get('to_invoice', False)"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity"/>
- <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" invisible="not context.get('to_invoice', False)"/>
<field domain="[('type','=','normal')]" name="account_id"/>
- <field name="general_account_id" invisible="context.get('to_invoice', False)"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
@@ -189,25 +229,15 @@
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<search string="Search Analytic Lines">
- <field name="name" string="Analytic Line"/>
+ <field name="name" string="Description"/>
<field name="date"/>
- <filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" help="Analytic Journal Items related to a sale journal."/>
- <filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" help="Analytic Journal Items related to a purchase journal."/>
- <filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]"/>
- <separator/>
<filter string="My Entries" domain="[('user_id','=',uid)]"/>
- <field name="account_id"/>
+ <field name="account_id" filter_domain="[('account_id','child_of',self)]"/>
<field name="user_id"/>
- <group string="Group By" expand="0">
- <filter string="Analytic Account" context="{'group_by':'account_id'}"/>
- <filter string="Fin. Account" context="{'group_by':'general_account_id'}"/>
- <filter string="Journal" context="{'group_by':'journal_id'}" name="group_journal"/>
- <separator/>
- <filter string="Product" context="{'group_by':'product_id'}"/>
- <filter string="User" context="{'group_by':'user_id'}"/>
- <separator/>
+ <group string="Group By..." expand="0">
+ <filter string="Analytic Account" context="{'group_by':'account_id'}" name="account_id"/>
+ <filter string="User" context="{'group_by':'user_id'}" name="user_id"/>
<filter string="Tasks Month" context="{'group_by':'date'}" name="group_date" help="Invoice Tasks by Month"/>
-
</group>
</search>
</field>
@@ -243,12 +273,11 @@
<field name="name">account.analytic.line.extended_form</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
- <form string="Project line">
+ <form string="Project line" version="7.0">
<group>
<group>
<field name="name"/>
<field name="account_id"/>
- <field name="journal_id"/>
</group>
<group>
<field name="date" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
@@ -256,19 +285,11 @@
</group>
<group string="Amount">
<field name="amount"/>
- <label for="amount_currency" groups="base.group_multi_currency"/>
- <div groups="base.group_multi_currency">
- <field name="amount_currency" class="oe_inline"/>
- <field name="currency_id" class="oe_inline"/>
- </div>
- <field invisible="1" name="general_account_id"/>
</group>
<group string="Product Information">
- <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
<label for="unit_amount"/>
<div>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
- <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
</div>
</group>
</group>
@@ -280,7 +301,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
- <field name="view_id" ref="account_analytic_line_extended_form"/>
+ <field name="view_id" ref="view_account_analytic_line_form"/>
</record>
#
@@ -288,7 +309,7 @@
#
<record id="view_account_analytic_journal_tree" model="ir.ui.view">
- <field name="name">account.analytic.journal.tree</field>
+ <field name="name">account.analytic.journal.tree</field>
<field name="model">account.analytic.journal</field>
<field name="arch" type="xml">
<tree string="Analytic Journal">
@@ -305,8 +326,8 @@
<field name="arch" type="xml">
<search string="Analytic Journals">
<field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Analytic Journal"/>
- <field name="type"/>
- <group expand="0" string="Group By">
+ <field name="type"/>
+ <group expand="0" string="Group By...">
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
</group>
</search>
@@ -317,7 +338,7 @@
<field name="name">account.analytic.journal.form</field>
<field name="model">account.analytic.journal</field>
<field name="arch" type="xml">
- <form string="Analytic Journal">
+ <form string="Analytic Journal" version="7.0">
<group col="4">
<field name="name"/>
<field name="code"/>
@@ -335,7 +356,6 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_analytic_journal_search" />
</record>
- <menuitem groups="analytic.group_analytic_accounting" action="action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/>
#
# Open journal entries
@@ -347,26 +367,6 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
- <menuitem groups="analytic.group_analytic_accounting"
- action="action_account_analytic_journal_open_form"
- id="account_analytic_journal_entries"
- parent="menu_finance_entries"/>
-
- #
- # Reporting
- #
-
-
- <record id="view_account_journal_1" model="ir.ui.view">
- <field name="name">account.journal.form.1</field>
- <field name="model">account.journal</field>
- <field name="inherit_id" ref="account.view_account_journal_form"/>
- <field name="arch" type="xml">
- <field name="type" position="after">
- <field name="analytic_journal_id" groups="analytic.group_analytic_accounting"/>
- </field>
- </field>
- </record>
- </data>
+ </data>
</openerp>
diff --git a/addons/account/project/views/report_analyticbalance.xml b/addons/analytic/views/report_analyticbalance.xml
index 09cd56fc83f..09cd56fc83f 100644
--- a/addons/account/project/views/report_analyticbalance.xml
+++ b/addons/analytic/views/report_analyticbalance.xml
diff --git a/addons/account/project/views/report_analyticcostledger.xml b/addons/analytic/views/report_analyticcostledger.xml
index cda37d4158f..cda37d4158f 100644
--- a/addons/account/project/views/report_analyticcostledger.xml
+++ b/addons/analytic/views/report_analyticcostledger.xml
diff --git a/addons/account/project/views/report_analyticcostledgerquantity.xml b/addons/analytic/views/report_analyticcostledgerquantity.xml
index de49d4972e5..de49d4972e5 100644
--- a/addons/account/project/views/report_analyticcostledgerquantity.xml
+++ b/addons/analytic/views/report_analyticcostledgerquantity.xml
diff --git a/addons/account/project/views/report_analyticjournal.xml b/addons/analytic/views/report_analyticjournal.xml
index 1b3a4fda97c..1b3a4fda97c 100644
--- a/addons/account/project/views/report_analyticjournal.xml
+++ b/addons/analytic/views/report_analyticjournal.xml
diff --git a/addons/account/project/views/report_invertedanalyticbalance.xml b/addons/analytic/views/report_invertedanalyticbalance.xml
index e545ec8525b..e545ec8525b 100644
--- a/addons/account/project/views/report_invertedanalyticbalance.xml
+++ b/addons/analytic/views/report_invertedanalyticbalance.xml
diff --git a/addons/account/project/wizard/__init__.py b/addons/analytic/wizard/__init__.py
index 972373f87af..de0737e07c3 100644
--- a/addons/account/project/wizard/__init__.py
+++ b/addons/analytic/wizard/__init__.py
@@ -24,7 +24,6 @@ import account_analytic_balance_report
import account_analytic_inverted_balance_report
import account_analytic_cost_ledger_report
import account_analytic_cost_ledger_for_journal_report
-import project_account_analytic_line
import account_analytic_chart
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_balance_report.py b/addons/analytic/wizard/account_analytic_balance_report.py
index 062945fa53e..062945fa53e 100644
--- a/addons/account/project/wizard/account_analytic_balance_report.py
+++ b/addons/analytic/wizard/account_analytic_balance_report.py
diff --git a/addons/account/project/wizard/account_analytic_balance_report_view.xml b/addons/analytic/wizard/account_analytic_balance_report_view.xml
index d4d5d652980..d4d5d652980 100644
--- a/addons/account/project/wizard/account_analytic_balance_report_view.xml
+++ b/addons/analytic/wizard/account_analytic_balance_report_view.xml
diff --git a/addons/account/project/wizard/account_analytic_chart.py b/addons/analytic/wizard/account_analytic_chart.py
index 4a26eec7c95..410830a0e9e 100644
--- a/addons/account/project/wizard/account_analytic_chart.py
+++ b/addons/analytic/wizard/account_analytic_chart.py
@@ -35,7 +35,7 @@ class account_analytic_chart(osv.osv_memory):
result_context = {}
if context is None:
context = {}
- result = mod_obj.get_object_reference(cr, uid, 'account', 'action_account_analytic_account_tree2')
+ result = mod_obj.get_object_reference(cr, uid, 'analytic', 'action_account_analytic_account_tree2')
id = result and result[1] or False
result = act_obj.read(cr, uid, [id], context=context)[0]
data = self.read(cr, uid, ids, [])[0]
diff --git a/addons/account/project/wizard/account_analytic_chart_view.xml b/addons/analytic/wizard/account_analytic_chart_view.xml
index 2fb44f50489..8cbab1d5878 100644
--- a/addons/account/project/wizard/account_analytic_chart_view.xml
+++ b/addons/analytic/wizard/account_analytic_chart_view.xml
@@ -31,13 +31,5 @@
<field name="target">new</field>
</record>
- <menuitem
- name="Chart of Analytic Accounts"
- parent="account.menu_finance_charts"
- action="action_account_analytic_chart"
- id="menu_action_analytic_account_tree2"
- icon="STOCK_INDENT"
- groups="analytic.group_analytic_accounting"/>
-
</data>
</openerp>
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py b/addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report.py
index ab84af4880a..ab84af4880a 100644
--- a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
+++ b/addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report.py
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml b/addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report_view.xml
index 55b13e345f0..55b13e345f0 100644
--- a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml
+++ b/addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report_view.xml
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_report.py b/addons/analytic/wizard/account_analytic_cost_ledger_report.py
index 978863f5900..978863f5900 100644
--- a/addons/account/project/wizard/account_analytic_cost_ledger_report.py
+++ b/addons/analytic/wizard/account_analytic_cost_ledger_report.py
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_view.xml b/addons/analytic/wizard/account_analytic_cost_ledger_view.xml
index 25ab748732b..25ab748732b 100644
--- a/addons/account/project/wizard/account_analytic_cost_ledger_view.xml
+++ b/addons/analytic/wizard/account_analytic_cost_ledger_view.xml
diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.py b/addons/analytic/wizard/account_analytic_inverted_balance_report.py
index 93946960297..93946960297 100644
--- a/addons/account/project/wizard/account_analytic_inverted_balance_report.py
+++ b/addons/analytic/wizard/account_analytic_inverted_balance_report.py
diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.xml b/addons/analytic/wizard/account_analytic_inverted_balance_report.xml
index 5188c013b4d..5188c013b4d 100644
--- a/addons/account/project/wizard/account_analytic_inverted_balance_report.xml
+++ b/addons/analytic/wizard/account_analytic_inverted_balance_report.xml
diff --git a/addons/account/project/wizard/account_analytic_journal_report.py b/addons/analytic/wizard/account_analytic_journal_report.py
index d8790e805d8..d8790e805d8 100644
--- a/addons/account/project/wizard/account_analytic_journal_report.py
+++ b/addons/analytic/wizard/account_analytic_journal_report.py
diff --git a/addons/account/project/wizard/account_analytic_journal_report_view.xml b/addons/analytic/wizard/account_analytic_journal_report_view.xml
index b196081451a..3aaea712582 100644
--- a/addons/account/project/wizard/account_analytic_journal_report_view.xml
+++ b/addons/analytic/wizard/account_analytic_journal_report_view.xml
@@ -32,7 +32,7 @@
</record>
<record model="ir.values" id="account_analytic_journal_values">
- <field name="model_id" ref="account.model_account_analytic_journal" />
+ <field name="model_id" ref="analytic.model_account_analytic_journal" />
<field name="name">Account Analytic Journal</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_journal'))" />
@@ -40,12 +40,5 @@
<field name="model">account.analytic.journal</field>
</record>
- <menuitem groups="analytic.group_analytic_accounting" id="next_id_40"
- name="Analytic" parent="account.menu_finance_generic_reporting"
- sequence="4"/>
- <menuitem groups="analytic.group_analytic_accounting"
- action="account.action_account_analytic_journal"
- id="account_analytic_journal_print" parent="account.next_id_40"/>
-
</data>
</openerp>
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index 1cdfc5e198c..322119ce3fb 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -140,7 +140,7 @@ class hr_expense_expense(osv.osv):
def expense_confirm(self, cr, uid, ids, context=None):
for expense in self.browse(cr, uid, ids):
if not expense.line_ids:
- raise osv.except_osv(_('Error!'),_('You cannot submit expense which has no expense line.'))
+ raise osv.except_osv(_('Error!'), _('You cannot submit expense which has no expense line.'))
if expense.employee_id and expense.employee_id.parent_id.user_id:
self.message_subscribe_users(cr, uid, [expense.id], user_ids=[expense.employee_id.parent_id.user_id.id])
return self.write(cr, uid, ids, {'state': 'confirm', 'date_confirm': time.strftime('%Y-%m-%d')}, context=context)
diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml
index 0e92e7854ce..84df423faf8 100644
--- a/addons/hr_expense/hr_expense_demo.xml
+++ b/addons/hr_expense/hr_expense_demo.xml
@@ -45,7 +45,7 @@
<record id="expenses_line0" model="hr.expense.line">
<field name="name">Travel Expenses</field>
<field name="date_value" eval="time.strftime('%Y-08-10')"/>
- <field name="analytic_account" ref="account.analytic_consultancy"/>
+ <field name="analytic_account" ref="analytic.analytic_consultancy"/>
<field name="expense_id" ref="expenses0"/>
<field eval="200.0" name="unit_amount"/>
<field name="uom_id" ref="product.product_uom_unit"/>
@@ -61,7 +61,7 @@
<record id="travel_by_air_sep" model="hr.expense.line">
<field name="name">Travel by Air</field>
<field name="date_value" eval="time.strftime('%Y-09-03')"/>
- <field name="analytic_account" ref="account.analytic_consultancy"/>
+ <field name="analytic_account" ref="analytic.analytic_consultancy"/>
<field name="product_id" ref="air_ticket"/>
<field name="expense_id" ref="sep_expenses"/>
<field eval="700.0" name="unit_amount"/>
@@ -72,7 +72,7 @@
<record id="hotel_bill_sep" model="hr.expense.line">
<field name="name">Hotel Expenses - Thymbra</field>
<field name="date_value" eval="time.strftime('%Y-09-20')"/>
- <field name="analytic_account" ref="account.analytic_nebula"/>
+ <field name="analytic_account" ref="analytic.analytic_nebula"/>
<field name="product_id" ref="hotel_rent"/>
<field name="expense_id" ref="sep_expenses"/>
<field eval="400.0" name="unit_amount"/>
@@ -83,7 +83,7 @@
<record id="car_travel_sep" model="hr.expense.line">
<field name="name">Bruxelles - Paris</field>
<field name="date_value" eval="time.strftime('%Y-09-15')"/>
- <field name="analytic_account" ref="account.analytic_nebula"/>
+ <field name="analytic_account" ref="analytic.analytic_nebula"/>
<field name="product_id" ref="car_travel"/>
<field name="expense_id" ref="sep_expenses"/>
<field eval="0.30" name="unit_amount"/>
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index 2d72636ac47..6d284d223ac 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -67,8 +67,8 @@
<button name="validate" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
<button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" />
<button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" groups="base.group_hr_user" />
- <button name="done" states="accepted" string="Generate Accounting Entries" type="workflow" groups="account.group_account_invoice" class="oe_highlight"/>
- <button name="action_view_move" states="done" string="Open Accounting Entries" type="object" groups="account.group_account_invoice"/>
+ <button name="done" states="accepted" string="Generate Accounting Entries" type="workflow" groups="account.group_account_invoice,account.group_account_user" class="oe_highlight"/>
+ <button name="action_view_move" states="done" string="Open Accounting Entries" type="object" groups="account.group_account_invoice,account.group_account_user"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,accepted,done,paid" statusbar_colors='{"confirm":"blue","cancelled":"red"}'/>
</header>
<sheet>
diff --git a/addons/hr_expense/hr_expense_workflow.xml b/addons/hr_expense/hr_expense_workflow.xml
index c01bb4cd14b..f8f2e9942c9 100644
--- a/addons/hr_expense/hr_expense_workflow.xml
+++ b/addons/hr_expense/hr_expense_workflow.xml
@@ -84,7 +84,6 @@
<field name="act_from" ref="act_accepted"/>
<field name="act_to" ref="act_done"/>
<field name="signal">done</field>
- <field name="group_id" ref="base.group_hr_user"/>
</record>
<record id="t10" model="workflow.transition">
diff --git a/addons/hr_expense/security/ir.model.access.csv b/addons/hr_expense/security/ir.model.access.csv
index 361a3d8c74f..a5b860256fc 100644
--- a/addons/hr_expense/security/ir.model.access.csv
+++ b/addons/hr_expense/security/ir.model.access.csv
@@ -12,7 +12,7 @@ access_account_journal_user,account.journal.user,account.model_account_journal,b
access_account_journal_employee,account.journal.employee,account.model_account_journal,base.group_user,1,0,0,0
access_account_invoice_user,account.invoice.user,account.model_account_invoice,base.group_hr_user,1,1,1,1
access_account_invoice_line_user,account.invoice.line.user,account.model_account_invoice_line,base.group_hr_user,1,1,1,1
-access_account_analytic_journal_user,account.ianalytic.journal.user,account.model_account_analytic_journal,base.group_hr_user,1,1,1,1
+access_account_analytic_journal_user,account.ianalytic.journal.user,analytic.model_account_analytic_journal,base.group_hr_user,1,1,1,1
access_account_invoice_tax_user,account.invoice.tax.user,account.model_account_invoice_tax,base.group_hr_user,1,1,1,1
access_account_period_user,account.period.user,account.model_account_period,base.group_hr_user,1,1,1,1
access_account_fiscalyear_user,account.fiscalyear.user,account.model_account_fiscalyear,base.group_hr_user,1,1,1,1
diff --git a/addons/hr_timesheet/hr_timesheet_demo.xml b/addons/hr_timesheet/hr_timesheet_demo.xml
index 2abea3ada67..bccd7aa1b70 100644
--- a/addons/hr_timesheet/hr_timesheet_demo.xml
+++ b/addons/hr_timesheet/hr_timesheet_demo.xml
@@ -12,16 +12,16 @@
<field name="product_id" ref="product.product_product_consultant"/>
<field name="journal_id" ref="analytic_journal"/>
</record>
- <record id="account.analytic_administratif" model="account.analytic.account">
+ <record id="analytic.analytic_administratif" model="account.analytic.account">
<field name="use_timesheets">True</field>
</record>
- <record id="account.analytic_partners" model="account.analytic.account">
+ <record id="analytic.analytic_partners" model="account.analytic.account">
<field name="use_timesheets">True</field>
</record>
- <record id="account.analytic_consultancy" model="account.analytic.account">
+ <record id="analytic.analytic_consultancy" model="account.analytic.account">
<field name="use_timesheets">True</field>
</record>
- <record id="account.analytic_super_product_trainings" model="account.analytic.account">
+ <record id="analytic.analytic_super_product_trainings" model="account.analytic.account">
<field name="use_timesheets">True</field>
</record>
@@ -32,7 +32,7 @@
<field eval="2.00" name="unit_amount"/>
<field name="product_id" ref="product.product_product_consultant"/>
<field name="product_uom_id" ref="product.product_uom_hour"/>
- <field name="account_id" ref="account.analytic_administratif"></field>
+ <field name="account_id" ref="analytic.analytic_administratif"></field>
<field eval="-60.00" name="amount"/>
<field name="general_account_id" ref="account.a_expense"/>
<field name="journal_id" ref="analytic_journal"/>
@@ -45,7 +45,7 @@
<field eval="1.00" name="unit_amount"/>
<field name="product_id" ref="product.product_product_consultant"/>
<field name="product_uom_id" ref="product.product_uom_hour"/>
- <field name="account_id" ref="account.analytic_administratif"></field>
+ <field name="account_id" ref="analytic.analytic_administratif"></field>
<field eval="-30.00" name="amount"/>
<field name="general_account_id" ref="account.a_expense"/>
<field name="journal_id" ref="analytic_journal"/>
@@ -58,7 +58,7 @@
<field eval="03.00" name="unit_amount"/>
<field name="product_id" ref="product.product_product_consultant"/>
<field name="product_uom_id" ref="product.product_uom_hour"/>
- <field name="account_id" ref="account.analytic_administratif"></field>
+ <field name="account_id" ref="analytic.analytic_administratif"></field>
<field eval="-90.00" name="amount"/>
<field name="general_account_id" ref="account.a_expense"/>
<field name="journal_id" ref="analytic_journal"/>
@@ -71,7 +71,7 @@
<field eval="01.00" name="unit_amount"/>
<field name="product_id" ref="product.product_product_consultant"/>
<field name="product_uom_id" ref="product.product_uom_hour"/>
- <field name="account_id" ref="account.analytic_administratif"></field>
+ <field name="account_id" ref="analytic.analytic_administratif"></field>
<field eval="-30.00" name="amount"/>
<field name="general_account_id" ref="account.a_expense"/>
<field name="journal_id" ref="analytic_journal"/>
@@ -84,7 +84,7 @@
<field eval="01.00" name="unit_amount"/>
<field name="product_id" ref="product.product_product_consultant"/>
<field name="product_uom_id" ref="product.product_uom_hour"/>
- <field name="account_id" ref="account.analytic_administratif"></field>
+ <field name="account_id" ref="analytic.analytic_administratif"></field>
<field eval="-30.00" name="amount"/>
<field name="general_account_id" ref="account.a_expense"/>
<field name="journal_id" ref="analytic_journal"/>
diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv
index 689d425054a..b48988700db 100644
--- a/addons/hr_timesheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet/security/ir.model.access.csv
@@ -3,10 +3,10 @@ access_hr_analytic_timesheet,hr.analytic.timesheet,model_hr_analytic_timesheet,b
access_hr_analytic_timesheet_employee,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_user,1,1,1,1
access_hr_account_analytic_line,account.account.analytic.line,account.model_account_analytic_line,base.group_hr_user,1,1,1,1
access_hr_account_analytic_line_employee,account.account.analytic.line employee,account.model_account_analytic_line,base.group_user,1,1,1,1
-access_account_analytic_journal,account.account.analytic.journal,account.model_account_analytic_journal,base.group_hr_user,1,1,1,1
+access_account_analytic_journal,account.account.analytic.journal,analytic.model_account_analytic_journal,base.group_hr_user,1,1,1,1
access_product_product_user,product.product user,product.model_product_product,base.group_hr_user,1,1,1,1
access_product_template_hr_timesheet,product.template.hr.timesheet,product.model_product_template,base.group_hr_user,1,1,1,1
access_product_uom_hr_timesheet,product.uom.hr.timesheet,product.model_product_uom,base.group_hr_user,1,1,1,1
access_account_fiscalyear_hr_user,account.account.fiscalyear.user,account.model_account_fiscalyear,base.group_hr_user,1,1,1,1
access_hr_analytic_timesheet_user,hr.analytic.timesheet.user,model_hr_analytic_timesheet,base.group_user,1,1,1,0
-access_account_analytic_journal_user,account.account.analytic.journal.user,account.model_account_analytic_journal,base.group_user,1,0,0,0
+access_account_analytic_journal_user,account.account.analytic.journal.user,analytic.model_account_analytic_journal,base.group_user,1,0,0,0
diff --git a/addons/hr_timesheet/test/hr_timesheet_demo.yml b/addons/hr_timesheet/test/hr_timesheet_demo.yml
index 723e3a1a08c..2c81912d130 100644
--- a/addons/hr_timesheet/test/hr_timesheet_demo.yml
+++ b/addons/hr_timesheet/test/hr_timesheet_demo.yml
@@ -7,5 +7,5 @@
!record {model: hr.analytic.timesheet, id: working_hours_coding, view: False}:
user_id: base.user_demo
date: !eval time.strftime('%Y-%m-%d')
- account_id: account.analytic_administratif
+ account_id: analytic.analytic_administratif
unit_amount: 1.0
diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml
index e518ba683ea..4f0cd11911f 100644
--- a/addons/hr_timesheet/test/test_hr_timesheet.yml
+++ b/addons/hr_timesheet/test/test_hr_timesheet.yml
@@ -42,7 +42,7 @@
import time
from datetime import datetime, date, timedelta
uid = ref('base.user_demo')
- new_id = self.create(cr, uid, {'account_id': ref('account.analytic_nebula'),'analytic_amount': 7.0,
+ new_id = self.create(cr, uid, {'account_id': ref('analytic.analytic_nebula'),'analytic_amount': 7.0,
'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S') ,
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module',
'name': 'Gilles Gravie', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'present'})
@@ -55,7 +55,7 @@
import time
from datetime import datetime, date, timedelta
uid = ref('base.user_demo')
- new_id = self.create(cr, uid, {'account_id': ref('account.analytic_spark'), 'analytic_amount': 7.0,
+ new_id = self.create(cr, uid, {'account_id': ref('analytic.analytic_spark'), 'analytic_amount': 7.0,
'date': (datetime.now()+timedelta(2)).strftime('%Y-%m-%d %H:%M:%S'),
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module',
'name': 'Gilles Gravie', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'})
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml
index 0ebe16ad49f..079596730e6 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml
@@ -11,13 +11,13 @@
<field name="customer_name">Offered developments</field>
<field name="factor">100.0</field>
</record>
- <record id="account.analytic_spark" model="account.analytic.account">
+ <record id="analytic.analytic_spark" model="account.analytic.account">
<field name="to_invoice" ref="timesheet_invoice_factor1"/>
</record>
- <record id="account.analytic_nebula" model="account.analytic.account">
+ <record id="analytic.analytic_nebula" model="account.analytic.account">
<field name="to_invoice" ref="timesheet_invoice_factor1"/>
</record>
- <record id="account.analytic_partners_camp_to_camp" model="account.analytic.account">
+ <record id="analytic.analytic_partners_camp_to_camp" model="account.analytic.account">
<field name="to_invoice" ref="timesheet_invoice_factor1"/>
</record>
</data>
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
index bc06ed16ee2..f1a1f6fd26d 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
@@ -80,9 +80,9 @@
<record id="view_account_analytic_line_search_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.search.to_invoice</field>
<field name="model">account.analytic.line</field>
- <field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_filter"/>
<field name="arch" type="xml">
- <xpath expr="//filter[@name='others']" position="after">
+ <xpath expr="//field[@name='date']" position="after">
<separator/>
<filter name="to_invoice" string="To Invoice" context="{'to_invoice': 1}" domain="[('invoice_id','=',False), ('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/>
<filter name="invoiced" string="Invoiced" domain="[('invoice_id','!=',False), ('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/>
@@ -107,7 +107,7 @@
<record id="view_account_analytic_line_tree_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.tree.to_invoice</field>
<field name="model">account.analytic.line</field>
- <field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_tree"/>
<field name="arch" type="xml">
<field name="account_id" position="after">
<field name="to_invoice"/>
@@ -117,7 +117,7 @@
<record id="view_account_analytic_line_form_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.form.to_invoice</field>
<field name="model">account.analytic.line</field>
- <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_form"/>
<field name="arch" type="xml">
<field name="amount" position="before">
<field name="to_invoice"/>
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
index aac83b7e598..6ac9baf98cc 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
@@ -35,7 +35,7 @@ class report_timesheet_line(osv.osv):
'cost': fields.float('Cost', readonly=True),
'product_id': fields.many2one('product.product', 'Product',readonly=True),
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
- 'general_account_id': fields.many2one('account.account', 'General Account', readonly=True),
+ 'general_account_id': fields.many2one('account.account', 'Financial Account', readonly=True),
'invoice_id': fields.many2one('account.invoice', 'Invoiced', readonly=True),
'month': fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month', readonly=True),
diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
index 3a185736fe5..2f9b4e2ea32 100644
--- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
+++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
@@ -4,7 +4,7 @@
I create an account analytic line.
-
!record {model: account.analytic.line, id: account_analytic_line_developyamlforhrmodule0 }:
- account_id: account.analytic_agrolait
+ account_id: analytic.analytic_agrolait
amount: -1.0
general_account_id: account.a_expense
journal_id: hr_timesheet.analytic_journal
@@ -16,20 +16,20 @@
-
Assign partner name and price list in analytic account.
-
- !record {model: account.analytic.account, id: account.analytic_agrolait}:
+ !record {model: account.analytic.account, id: analytic.analytic_agrolait}:
partner_id: base.res_partner_2
pricelist_id: product.list0
-
I open this account and make the state as pending.
-
!python {model: account.analytic.account}: |
- self.set_open(cr, uid, [ref('account.analytic_agrolait')], None)
- self.set_pending(cr, uid, [ref('account.analytic_agrolait')], None)
+ self.set_open(cr, uid, [ref('analytic.analytic_agrolait')], None)
+ self.set_pending(cr, uid, [ref('analytic.analytic_agrolait')], None)
-
I assign account on analytic account line.
-
!python {model: hr.analytic.timesheet}: |
- self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule0')], ref('account.analytic_agrolait'))
+ self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule0')], ref('analytic.analytic_agrolait'))
-
I create a Tax Codes
diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml
index dac550a369a..15b243d0ac8 100644
--- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml
+++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml
@@ -4,7 +4,7 @@
I create an account analytic line.
-
!record {model: account.analytic.line, id: account_analytic_line_developyamlforhrmodule1 }:
- account_id: account.analytic_agrolait
+ account_id: analytic.analytic_agrolait
amount: -1.0
general_account_id: account.a_expense
journal_id: hr_timesheet.analytic_journal
@@ -16,20 +16,20 @@
-
Assign partner name and price list in analytic account.
-
- !record {model: account.analytic.account, id: account.analytic_agrolait}:
+ !record {model: account.analytic.account, id: analytic.analytic_agrolait}:
partner_id: base.res_partner_2
pricelist_id: product.list0
-
I open this account and make the state as pending.
-
!python {model: account.analytic.account}: |
- self.set_open(cr, uid, [ref('account.analytic_agrolait')], None)
- self.set_pending(cr, uid, [ref('account.analytic_agrolait')], None)
+ self.set_open(cr, uid, [ref('analytic.analytic_agrolait')], None)
+ self.set_pending(cr, uid, [ref('analytic.analytic_agrolait')], None)
-
I assign account on analytic account line.
-
!python {model: hr.analytic.timesheet}: |
- self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule1')], ref('account.analytic_agrolait'))
+ self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule1')], ref('analytic.analytic_agrolait'))
-
I create a Tax Code
-
diff --git a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
index c63133bd154..7b2738710f1 100644
--- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
+++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml
@@ -45,7 +45,7 @@
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
timesheet_ids:
- - account_id: account.analytic_agrolait
+ - account_id: analytic.analytic_agrolait
date: !eval time.strftime('%Y-%m-%d')
name: 'Develop yaml for hr module'
user_id: base.user_demo
@@ -74,7 +74,7 @@
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
timesheet_ids:
- - account_id: account.analytic_agrolait
+ - account_id: analytic.analytic_agrolait
date: !eval time.strftime('%Y-%m-%d')
name: 'Develop yaml for hr module'
unit_amount: 2.00
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index 61f62fd200d..820bb5d2b30 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -20,7 +20,7 @@ access_stock_location_mrp_worker,stock.location mrp_worker,stock.model_stock_loc
access_stock_move_mrp_worker,stock.move mrp_worker,stock.model_stock_move,mrp.group_mrp_user,1,1,1,0
access_stock_picking_mrp_worker,stock.picking mrp_worker,stock.model_stock_picking,mrp.group_mrp_user,1,1,1,1
access_stock_warehouse,stock.warehouse mrp_worker,stock.model_stock_warehouse,mrp.group_mrp_user,1,0,0,0
-access_account_analytic_journal_mrp_worker,account.analytic.journal mrp_worker,account.model_account_analytic_journal,mrp.group_mrp_user,1,0,0,0
+access_account_analytic_journal_mrp_worker,account.analytic.journal mrp_worker,analytic.model_account_analytic_journal,mrp.group_mrp_user,1,0,0,0
access_account_account,account.account mrp_worker,account.model_account_account,mrp.group_mrp_user,1,0,0,0
access_hr_timesheet_group_mrp_worker,resource.calendar mrp_manager,resource.model_resource_calendar,mrp.group_mrp_manager,1,1,1,1
access_procurement_user,procurement.order.user,model_procurement_order,base.group_user,1,1,1,1
diff --git a/addons/multi_company/multi_company_demo.xml b/addons/multi_company/multi_company_demo.xml
index 6287fd2286d..e2c3afebd3f 100644
--- a/addons/multi_company/multi_company_demo.xml
+++ b/addons/multi_company/multi_company_demo.xml
@@ -143,7 +143,7 @@
<field name="sequence_id" ref="account.sequence_sale_journal"/>
<field name="default_credit_account_id" ref="account.a_sale"/>
<field name="default_debit_account_id" ref="account.a_sale"/>
- <field name="analytic_journal_id" ref="account.cose_journal_sale"/>
+ <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_in"/>
</record>
@@ -155,7 +155,7 @@
<field name="sequence_id" ref="account.sequence_refund_sales_journal"/>
<field name="default_credit_account_id" ref="account.a_sale"/>
<field name="default_debit_account_id" ref="account.a_sale"/>
- <field name="analytic_journal_id" ref="account.cose_journal_sale"/>
+ <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_in"/>
</record>
@@ -191,7 +191,7 @@
<field name="sequence_id" ref="account.sequence_bank_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_in"/>
</record>
@@ -203,7 +203,7 @@
<field name="sequence_id" ref="account.sequence_check_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_in"/>
</record>
@@ -215,7 +215,7 @@
<field name="sequence_id" ref="account.sequence_cash_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_in"/>
</record>
@@ -228,7 +228,7 @@
<field name="sequence_id" ref="account.sequence_sale_journal"/>
<field name="default_credit_account_id" ref="account.a_sale"/>
<field name="default_debit_account_id" ref="account.a_sale"/>
- <field name="analytic_journal_id" ref="account.cose_journal_sale"/>
+ <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_us"/>
</record>
@@ -240,7 +240,7 @@
<field name="sequence_id" ref="account.sequence_refund_sales_journal"/>
<field name="default_credit_account_id" ref="account.a_sale"/>
<field name="default_debit_account_id" ref="account.a_sale"/>
- <field name="analytic_journal_id" ref="account.cose_journal_sale"/>
+ <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_us"/>
</record>
@@ -276,7 +276,7 @@
<field name="sequence_id" ref="account.sequence_bank_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_us"/>
</record>
@@ -288,7 +288,7 @@
<field name="sequence_id" ref="account.sequence_check_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_us"/>
</record>
@@ -300,7 +300,7 @@
<field name="sequence_id" ref="account.sequence_cash_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_us"/>
</record>
@@ -314,7 +314,7 @@
<field name="sequence_id" ref="account.sequence_sale_journal"/>
<field name="default_credit_account_id" ref="account.a_sale"/>
<field name="default_debit_account_id" ref="account.a_sale"/>
- <field name="analytic_journal_id" ref="account.cose_journal_sale"/>
+ <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_be"/>
</record>
@@ -326,7 +326,7 @@
<field name="sequence_id" ref="account.sequence_refund_sales_journal"/>
<field name="default_credit_account_id" ref="account.a_sale"/>
<field name="default_debit_account_id" ref="account.a_sale"/>
- <field name="analytic_journal_id" ref="account.cose_journal_sale"/>
+ <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_be"/>
</record>
@@ -362,7 +362,7 @@
<field name="sequence_id" ref="account.sequence_bank_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_be"/>
</record>
@@ -374,7 +374,7 @@
<field name="sequence_id" ref="account.sequence_check_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_be"/>
</record>
@@ -386,7 +386,7 @@
<field name="sequence_id" ref="account.sequence_cash_journal"/>
<field name="default_debit_account_id" ref="account.cash"/>
<field name="default_credit_account_id" ref="account.cash"/>
- <field name="analytic_journal_id" ref="account.sit"/>
+ <field name="analytic_journal_id" ref="analytic.sit"/>
<field name="user_id" ref="base.user_root"/>
<field name="company_id" ref="res_company_oerp_be"/>
</record>
diff --git a/addons/project/project.py b/addons/project/project.py
index e9a92a1af3d..870923304c1 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -166,14 +166,18 @@ class project(osv.osv):
def unlink(self, cr, uid, ids, context=None):
alias_ids = []
mail_alias = self.pool.get('mail.alias')
+ analytic_account_to_delete = set()
for proj in self.browse(cr, uid, ids, context=context):
if proj.tasks:
raise osv.except_osv(_('Invalid Action!'),
_('You cannot delete a project containing tasks. You can either delete all the project\'s tasks and then delete the project or simply deactivate the project.'))
elif proj.alias_id:
alias_ids.append(proj.alias_id.id)
+ if proj.analytic_account_id and not proj.analytic_account_id.line_ids:
+ analytic_account_to_delete.add(proj.analytic_account_id.id)
res = super(project, self).unlink(cr, uid, ids, context=context)
mail_alias.unlink(cr, uid, alias_ids, context=context)
+ self.pool['account.analytic.account'].unlink(cr, uid, list(analytic_account_to_delete), context=context)
return res
def _get_attached_docs(self, cr, uid, ids, field_name, arg, context):
@@ -1221,12 +1225,12 @@ class account_analytic_account(osv.osv):
self.project_create(cr, uid, account.id, vals_for_project, context=context)
return super(account_analytic_account, self).write(cr, uid, ids, vals, context=context)
- def unlink(self, cr, uid, ids, *args, **kwargs):
- project_obj = self.pool.get('project.project')
- analytic_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)])
- if analytic_ids:
- raise osv.except_osv(_('Warning!'), _('Please delete the project linked with this account first.'))
- return super(account_analytic_account, self).unlink(cr, uid, ids, *args, **kwargs)
+ def unlink(self, cr, uid, ids, context=None):
+ proj_ids = self.pool['project.project'].search(cr, uid, [('analytic_account_id', 'in', ids)])
+ has_tasks = self.pool['project.task'].search(cr, uid, [('project_id', 'in', proj_ids)], count=True, context=context)
+ if has_tasks:
+ raise osv.except_osv(_('Warning!'), _('Please remove existing tasks in the project linked to the accounts you want to delete.'))
+ return super(account_analytic_account, self).unlink(cr, uid, ids, context=context)
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
if args is None:
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 016313b5e44..56a9799786b 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -517,6 +517,13 @@ class account_analytic_account(osv.Model):
res = super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context)
return res or (vals.get('use_issues') and not 'project_creation_in_progress' in context)
+ def unlink(self, cr, uid, ids, context=None):
+ proj_ids = self.pool['project.project'].search(cr, uid, [('analytic_account_id', 'in', ids)])
+ has_issues = self.pool['project.issue'].search(cr, uid, [('project_id', 'in', proj_ids)], count=True, context=context)
+ if has_issues:
+ raise osv.except_osv(_('Warning!'), _('Please remove existing issues in the project linked to the accounts you want to delete.'))
+ return super(account_analytic_account, self).unlink(cr, uid, ids, context=context)
+
class project_project(osv.Model):
_inherit = 'project.project'
diff --git a/addons/project_issue_sheet/security/ir.model.access.csv b/addons/project_issue_sheet/security/ir.model.access.csv
index a524f4cf05f..3273f1f4247 100644
--- a/addons/project_issue_sheet/security/ir.model.access.csv
+++ b/addons/project_issue_sheet/security/ir.model.access.csv
@@ -4,12 +4,12 @@ access_hr_analytic_timesheet_project_user,hr_analytic_timesheet user,hr_timeshee
access_hr_analytic_timesheet_project_manager,hr_analytic_timesheet manager,hr_timesheet_sheet.model_hr_analytic_timesheet,project.group_project_manager,1,0,0,0
access_hr_timesheet_sheet_sheet_project_manager,hr_timesheet_sheet.sheet manager,hr_timesheet_sheet.model_hr_timesheet_sheet_sheet,project.group_project_manager,1,0,0,0
access_hr_analytic_timesheet_project_manager,account.analytic.line.timesheet.project.manager,account.model_account_analytic_line,project.group_project_manager,1,1,1,1
-access_account_analytic_journal_project_manager,account.analytic.journal.project.manager,account.model_account_analytic_journal,project.group_project_manager,1,1,1,1
+access_account_analytic_journal_project_manager,account.analytic.journal.project.manager,analytic.model_account_analytic_journal,project.group_project_manager,1,1,1,1
access_account_fiscalyear_project_manager,account.fiscalyear.project.manager,account.model_account_fiscalyear,project.group_project_manager,1,1,1,1
access_hr_timesheet_invoice_factor_project_manager,hr_timesheet_invoice.factor.project.manager,hr_timesheet_invoice.model_hr_timesheet_invoice_factor,project.group_project_manager,1,1,1,1
access_account_invoice_project_manager,account.invoice.project.manager,account.model_account_invoice,project.group_project_manager,1,1,1,1
access_analytic_account_line_project_user,analytic_account_line_timesheet user,analytic.model_account_analytic_line,project.group_project_user,1,1,1,0
-access_account_analytic_journal_project_user,account.analytic.journal.project.user,account.model_account_analytic_journal,project.group_project_user,1,1,1,0
+access_account_analytic_journal_project_user,account.analytic.journal.project.user,analytic.model_account_analytic_journal,project.group_project_user,1,1,1,0
access_account_fiscalyear_project_user,account.fiscalyear.project.user,account.model_account_fiscalyear,project.group_project_user,1,1,1,0
access_hr_timesheet_invoice_factor_project_user,hr_timesheet_invoice.factor.project.user,hr_timesheet_invoice.model_hr_timesheet_invoice_factor,project.group_project_user,1,1,1,0
access_account_invoice_project_user,account.invoice.project.user,account.model_account_invoice,project.group_project_user,1,1,1,0
diff --git a/addons/project_timesheet/project_timesheet_view.xml b/addons/project_timesheet/project_timesheet_view.xml
index 368d7728d12..f9a71638c37 100644
--- a/addons/project_timesheet/project_timesheet_view.xml
+++ b/addons/project_timesheet/project_timesheet_view.xml
@@ -49,7 +49,7 @@
<record id="view_account_analytic_line_search_account_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.search.account_id</field>
<field name="model">account.analytic.line</field>
- <field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_filter"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field name="account_id" string="Analytic account/project"/>
@@ -59,7 +59,7 @@
<record id="view_account_analytic_line_form_inherit_account_id" model="ir.ui.view">
<field name="name">account.analytic.line.form.account_id</field>
<field name="model">account.analytic.line</field>
- <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_form"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field name="account_id" string="Analytic Account/Project" on_change="on_change_account_id(account_id)"/>
@@ -69,7 +69,7 @@
<record id="view_account_analytic_line_tree_inherit_account_id" model="ir.ui.view">
<field name="name">account.analytic.line.tree.account_id</field>
<field name="model">account.analytic.line</field>
- <field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
+ <field name="inherit_id" ref="analytic.view_account_analytic_line_tree"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field name="account_id" string="Analytic account/project" on_change="on_change_account_id(account_id)"/>