Merge lp:~openerp-dev/openobject-addons/trunk-move-account-project-cod into lp:openobject-addons
- trunk-move-account-project-cod
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-addons/trunk-move-account-project-cod |
Merge into: | lp:openobject-addons |
Diff against target: |
3293 lines (+1053/-1008) 69 files modified
account/__init__.py (+1/-1) account/__openerp__.py (+1/-16) account/account.py (+1/-0) account/account_analytic.py (+1/-0) account/account_analytic_line.py (+2/-1) account/account_analytic_view.xml (+136/-0) account/demo/account_minimal.xml (+6/-6) account/partner_view.xml (+2/-2) account/project/__init__.py (+0/-28) account/project/project.py (+0/-50) account/project/project_view.xml (+0/-372) account/project/report/cost_ledger.py (+0/-111) account/project/report/inverted_analytic_balance.py (+0/-130) account/project/report/quantity_cost_ledger.py (+0/-127) account/report/account_analytic_entries_report.py (+2/-2) account/report/account_analytic_entries_report_view.xml (+2/-2) account/security/account_security.xml (+1/-1) account/security/ir.model.access.csv (+3/-4) account/test/account_fiscalyear_close.yml (+1/-1) account/test/account_report.yml (+10/-10) account_analytic_analysis/account_analytic_analysis_view.xml (+17/-2) account_analytic_analysis/analytic_account_demo.xml (+6/-6) account_analytic_plans/test/acount_analytic_plans_report.yml (+2/-2) account_budget/account_budget_demo.xml (+17/-17) account_budget/test/account_budget.yml (+2/-2) account_budget/test/account_budget_report.yml (+1/-1) account_voucher/test/case1_usd_usd.yml (+1/-1) account_voucher/test/case1_usd_usd_payment_rate.yml (+1/-1) account_voucher/test/case2_usd_eur_debtor_in_eur.yml (+2/-2) account_voucher/test/case2_usd_eur_debtor_in_usd.yml (+2/-2) account_voucher/test/case3_eur_eur.yml (+1/-1) account_voucher/test/case4_cad_chf.yml (+1/-1) account_voucher/test/case5_suppl_usd_usd.yml (+2/-2) account_voucher/test/case_eur_usd.yml (+1/-1) analytic/__init__.py (+3/-1) analytic/__openerp__.py (+21/-5) analytic/models/__init__.py (+3/-0) analytic/models/analytic.py (+18/-1) analytic/report/__init__.py (+3/-3) analytic/report/analytic_balance.py (+1/-1) analytic/report/analytic_cost_ledger.py (+111/-0) analytic/report/analytic_inverted_balance.py (+130/-0) analytic/report/analytic_journal.py (+1/-1) analytic/report/analytic_quantity_cost_ledger.py (+127/-0) analytic/views/analytic_view.xml (+315/-0) analytic/wizard/account_analytic_chart.py (+1/-1) analytic/wizard/account_analytic_chart_view.xml (+0/-8) analytic/wizard/account_analytic_journal_report_view.xml (+1/-8) hr_expense/hr_expense.py (+2/-0) hr_expense/hr_expense_demo.xml (+4/-4) hr_expense/hr_expense_view.xml (+2/-2) hr_expense/hr_expense_workflow.xml (+0/-1) hr_timesheet/hr_timesheet_demo.xml (+15/-15) hr_timesheet/test/hr_timesheet_demo.yml (+1/-1) hr_timesheet/test/test_hr_timesheet.yml (+2/-2) hr_timesheet_invoice/hr_timesheet_invoice_demo.xml (+7/-7) hr_timesheet_invoice/hr_timesheet_invoice_view.xml (+4/-4) hr_timesheet_invoice/report/hr_timesheet_invoice_report.py (+1/-1) hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml (+5/-5) hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml (+5/-5) hr_timesheet_sheet/report/hr_timesheet_report.py (+1/-1) hr_timesheet_sheet/report/hr_timesheet_report_view.xml (+1/-1) hr_timesheet_sheet/report/timesheet_report.py (+1/-1) hr_timesheet_sheet/report/timesheet_report_view.xml (+1/-1) hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml (+2/-2) multi_company/multi_company_demo.xml (+15/-15) project/project.py (+11/-3) project_issue/project_issue.py (+10/-0) project_timesheet/project_timesheet_view.xml (+3/-3) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/trunk-move-account-project-cod |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+217571@code.launchpad.net |
Commit message
Description of the change
Hello,
I have done following changes,
-> merged account/
-> renamed report name
->when deleting a project IF there are no analytic lines defined on the analytic account of the project also delete the analytic account.
-> when delete an analytic acccount whene there is project IF the project contains NO taks NOR issues also delete the project (instead of the Warning! Please delete the project linked with this account first.)
-> merged https:/
Thanks,
cod
- 9399. By Chirag Dodiya(OpenERP)
-
[IMP]Removed some unused code and improved some file
- 9400. By Chirag Dodiya(OpenERP)
-
[IMP]Improved model_id in account analytic view file
Unmerged revisions
- 9400. By Chirag Dodiya(OpenERP)
-
[IMP]Improved model_id in account analytic view file
- 9399. By Chirag Dodiya(OpenERP)
-
[IMP]Removed some unused code and improved some file
- 9398. By Chirag Dodiya(OpenERP)
-
[IMP]Improved demo data and yml
- 9397. By Chirag Dodiya(OpenERP)
-
[IMP]Improved analytic account demo file
- 9396. By Chirag Dodiya(OpenERP)
-
[IMP]Improved hr timesheet demo file
- 9395. By Chirag Dodiya(OpenERP)
-
[IMP]Improved some demo and data file and also imporved code whent try to unlink project and try to unlink analytic acccount
- 9394. By Chirag Dodiya(OpenERP)
-
[IMP]Improved some report file set proper template
- 9393. By Chirag Dodiya(OpenERP)
-
[MRG]Merged lp:~openerp-dev/openobject-addons/trunk-improve-visibility-contract-analytic-bth-jar
- 9392. By Chirag Dodiya(OpenERP)
-
[IMP]Removed some code which is already in account_analytic py and xml file
- 9391. By Chirag Dodiya(OpenERP)
-
[IMP]Improved code,removed some code which is already in account_analytic.py
Preview Diff
1 | === modified file 'account/__init__.py' |
2 | --- account/__init__.py 2012-11-29 22:26:45 +0000 |
3 | +++ account/__init__.py 2014-04-29 11:49:43 +0000 |
4 | @@ -22,7 +22,6 @@ |
5 | import partner |
6 | import account |
7 | import installer |
8 | -import project |
9 | import account_invoice |
10 | import account_bank_statement |
11 | import account_bank |
12 | @@ -38,5 +37,6 @@ |
13 | import res_currency |
14 | import edi |
15 | import res_config |
16 | +import account_analytic |
17 | |
18 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
19 | |
20 | === modified file 'account/__openerp__.py' |
21 | --- account/__openerp__.py 2014-04-29 08:18:08 +0000 |
22 | +++ account/__openerp__.py 2014-04-29 11:49:43 +0000 |
23 | @@ -96,24 +96,16 @@ |
24 | 'wizard/account_automatic_reconcile_view.xml', |
25 | 'wizard/account_financial_report_view.xml', |
26 | 'wizard/pos_box.xml', |
27 | - 'project/wizard/project_account_analytic_line_view.xml', |
28 | 'account_end_fy.xml', |
29 | 'account_invoice_view.xml', |
30 | 'data/account_data.xml', |
31 | 'data/data_account_type.xml', |
32 | 'data/configurable_account_chart.xml', |
33 | 'account_invoice_workflow.xml', |
34 | - 'project/project_view.xml', |
35 | - 'project/project_report.xml', |
36 | - 'project/wizard/account_analytic_balance_report_view.xml', |
37 | - 'project/wizard/account_analytic_cost_ledger_view.xml', |
38 | - 'project/wizard/account_analytic_inverted_balance_report.xml', |
39 | - 'project/wizard/account_analytic_journal_report_view.xml', |
40 | - 'project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml', |
41 | - 'project/wizard/account_analytic_chart_view.xml', |
42 | 'partner_view.xml', |
43 | 'product_view.xml', |
44 | 'account_assert_test.xml', |
45 | + 'account_analytic_view.xml', |
46 | 'process/statement_process.xml', |
47 | 'process/customer_invoice_process.xml', |
48 | 'process/supplier_invoice_process.xml', |
49 | @@ -137,11 +129,6 @@ |
50 | 'views/report_partnerledgerother.xml', |
51 | 'views/report_financial.xml', |
52 | 'views/report_generalledger.xml', |
53 | - 'project/views/report_analyticbalance.xml', |
54 | - 'project/views/report_analyticjournal.xml', |
55 | - 'project/views/report_analyticcostledgerquantity.xml', |
56 | - 'project/views/report_analyticcostledger.xml', |
57 | - 'project/views/report_invertedanalyticbalance.xml', |
58 | ], |
59 | 'js': [ |
60 | 'static/src/js/account_move_reconciliation.js', |
61 | @@ -158,8 +145,6 @@ |
62 | ], |
63 | 'demo': [ |
64 | 'demo/account_demo.xml', |
65 | - 'project/project_demo.xml', |
66 | - 'project/analytic_account_demo.xml', |
67 | 'demo/account_minimal.xml', |
68 | 'demo/account_invoice_demo.xml', |
69 | 'account_unit_test.xml', |
70 | |
71 | === modified file 'account/account.py' |
72 | --- account/account.py 2014-04-15 14:29:34 +0000 |
73 | +++ account/account.py 2014-04-29 11:49:43 +0000 |
74 | @@ -734,6 +734,7 @@ |
75 | 'loss_account_id' : fields.many2one('account.account', 'Loss Account'), |
76 | 'internal_account_id' : fields.many2one('account.account', 'Internal Transfers Account', select=1), |
77 | 'cash_control' : fields.boolean('Cash Control', help='If you want the journal should be control at opening/closing, check this option'), |
78 | + 'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"), |
79 | } |
80 | |
81 | _defaults = { |
82 | |
83 | === added file 'account/account_analytic.py' |
84 | --- account/account_analytic.py 1970-01-01 00:00:00 +0000 |
85 | +++ account/account_analytic.py 2014-04-29 11:49:43 +0000 |
86 | @@ -0,0 +1,1 @@ |
87 | +# -*- coding: utf-8 -*- |
88 | |
89 | === modified file 'account/account_analytic_line.py' |
90 | --- account/account_analytic_line.py 2013-10-27 12:31:04 +0000 |
91 | +++ account/account_analytic_line.py 2014-04-29 11:49:43 +0000 |
92 | @@ -29,13 +29,14 @@ |
93 | _columns = { |
94 | 'product_uom_id': fields.many2one('product.uom', 'Unit of Measure'), |
95 | 'product_id': fields.many2one('product.product', 'Product'), |
96 | - 'general_account_id': fields.many2one('account.account', 'General Account', required=True, ondelete='restrict'), |
97 | + 'general_account_id': fields.many2one('account.account', 'Financial Account', required=True, ondelete='restrict'), |
98 | 'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True), |
99 | 'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True), |
100 | 'code': fields.char('Code', size=8), |
101 | 'ref': fields.char('Ref.', size=64), |
102 | '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), |
103 | '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), |
104 | + 'partner_id': fields.related('account_id', 'partner_id', type='many2one', relation='res.partner', string='Partner', store=True), |
105 | } |
106 | |
107 | _defaults = { |
108 | |
109 | === added file 'account/account_analytic_view.xml' |
110 | --- account/account_analytic_view.xml 1970-01-01 00:00:00 +0000 |
111 | +++ account/account_analytic_view.xml 2014-04-29 11:49:43 +0000 |
112 | @@ -0,0 +1,136 @@ |
113 | +<?xml version="1.0" encoding="utf-8"?> |
114 | +<openerp> |
115 | + <data> |
116 | + <record id="view_account_analytic_line_form_1" model="ir.ui.view"> |
117 | + <field name="name">account.analytic.line.form.1</field> |
118 | + <field name="model">account.analytic.line</field> |
119 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_form"/> |
120 | + <field name="arch" type="xml"> |
121 | + <xpath expr="//field[@name='account_id']" position="after"> |
122 | + <field name="journal_id"/> |
123 | + </xpath> |
124 | + <xpath expr="//field[@name='date']" position="after"> |
125 | + <field name="product_id" string="Product"/> |
126 | + <field name="ref"/> |
127 | + </xpath> |
128 | + <xpath expr="//field[@name='company_id']" position="after"> |
129 | + <field name="partner_id"/> |
130 | + </xpath> |
131 | + <xpath expr="//field[@name='amount']" position="after"> |
132 | + <label for="amount_currency" groups="base.group_multi_currency"/> |
133 | + <div groups="base.group_multi_currency"> |
134 | + <field name="amount_currency" class="oe_inline"/> |
135 | + <field name="currency_id" class="oe_inline"/> |
136 | + </div> |
137 | + <field invisible="1" name="general_account_id"/> |
138 | + </xpath> |
139 | + <xpath expr="//group[@string='Product Information']" position="replace"> |
140 | + <group string="Product Information"> |
141 | + <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/> |
142 | + <label for="unit_amount"/> |
143 | + <div> |
144 | + <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/> |
145 | + <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/> |
146 | + </div> |
147 | + </group> |
148 | + </xpath> |
149 | + <xpath expr="//group[@string='Product Information']" position="after"> |
150 | + <group string="General Accounting"> |
151 | + <field name="general_account_id"/> |
152 | + <field name="move_id" readonly="1"/> |
153 | + </group> |
154 | + </xpath> |
155 | + </field> |
156 | + </record> |
157 | + <record id="view_account_analytic_line_tree_1" model="ir.ui.view"> |
158 | + <field name="name">account.analytic.line.tree.1</field> |
159 | + <field name="model">account.analytic.line</field> |
160 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_tree"/> |
161 | + <field name="arch" type="xml"> |
162 | + <xpath expr="//field[@name='date']" position="after"> |
163 | + <field name="ref" invisible="context.get('to_invoice', False)"/> |
164 | + </xpath> |
165 | + <xpath expr="//field[@name='user_id']" position="after"> |
166 | + <field name="partner_id"/> |
167 | + <field name="journal_id" invisible="context.get('to_invoice', False)"/> |
168 | + </xpath> |
169 | + <xpath expr="//field[@name='amount']" position="after"> |
170 | + <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)"/> |
171 | + </xpath> |
172 | + <xpath expr="//field[@name='unit_amount']" position="after"> |
173 | + <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)"/> |
174 | + </xpath> |
175 | + <xpath expr="//field[@name='account_id']" position="after"> |
176 | + <field name="general_account_id" invisible="context.get('to_invoice', False)"/> |
177 | + </xpath> |
178 | + </field> |
179 | + </record> |
180 | + <record id="view_account_analytic_line_filter_1" model="ir.ui.view"> |
181 | + <field name="name">account.analytic.line.select.1</field> |
182 | + <field name="model">account.analytic.line</field> |
183 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_filter"/> |
184 | + <field name="arch" type="xml"> |
185 | + <xpath expr="//field[@name='date']" position="after"> |
186 | + <field name="product_id"/> |
187 | + <filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" help="Analytic Journal Items related to a sale journal."/> |
188 | + <filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" help="Analytic Journal Items related to a purchase journal."/> |
189 | + <filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]"/> |
190 | + </xpath> |
191 | + <xpath expr="//field[@name='account_id']" position="after"> |
192 | + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
193 | + </xpath> |
194 | + <xpath expr="//filter[@string='Analytic Account']" position="after"> |
195 | + <filter string="Financial Account" context="{'group_by':'general_account_id'}"/> |
196 | + <filter string="Journal" context="{'group_by':'journal_id'}" name="group_journal"/> |
197 | + </xpath> |
198 | + <xpath expr="//filter[@string='User']" position="before"> |
199 | + <filter string="Product" context="{'group_by':'product_id'}"/> |
200 | + <filter string="Partner" context="{'group_by':'partner_id'}"/> |
201 | + </xpath> |
202 | + </field> |
203 | + </record> |
204 | + |
205 | + <menuitem groups="analytic.group_analytic_accounting" |
206 | + action="analytic.action_account_analytic_journal_open_form" |
207 | + id="account_analytic_journal_entries" |
208 | + parent="menu_finance_entries"/> |
209 | + |
210 | + <record id="view_account_journal_1" model="ir.ui.view"> |
211 | + <field name="name">account.journal.form.1</field> |
212 | + <field name="model">account.journal</field> |
213 | + <field name="inherit_id" ref="account.view_account_journal_form"/> |
214 | + <field name="arch" type="xml"> |
215 | + <field name="type" position="after"> |
216 | + <field name="analytic_journal_id" groups="analytic.group_analytic_accounting"/> |
217 | + </field> |
218 | + </field> |
219 | + </record> |
220 | + |
221 | + <record model="ir.values" id="account_analytic_journal_values"> |
222 | + <field name="model_id" ref="analytic.model_account_analytic_journal" /> |
223 | + <field name="name">Account Analytic Journal</field> |
224 | + <field name="key2">client_print_multi</field> |
225 | + <field name="value" eval="'ir.actions.act_window,' + str(ref('analytic.action_account_analytic_journal'))" /> |
226 | + <field name="key">action</field> |
227 | + <field name="model">account.analytic.journal</field> |
228 | + </record> |
229 | + <menuitem groups="analytic.group_analytic_accounting" id="next_id_40" |
230 | + name="Analytic" parent="account.menu_finance_generic_reporting" |
231 | + sequence="4"/> |
232 | + <menuitem groups="analytic.group_analytic_accounting" |
233 | + action="analytic.action_account_analytic_journal" |
234 | + id="account_analytic_journal_print" parent="account.next_id_40"/> |
235 | + <menuitem |
236 | + name="Chart of Analytic Accounts" |
237 | + parent="account.menu_finance_charts" |
238 | + action="analytic.action_account_analytic_chart" |
239 | + id="menu_action_analytic_account_tree2" |
240 | + icon="STOCK_INDENT" |
241 | + groups="analytic.group_analytic_accounting"/> |
242 | + <menuitem action="analytic.action_account_analytic_account_form" id="account_analytic_def_account" |
243 | + parent="menu_analytic_accounting" |
244 | + groups="analytic.group_analytic_accounting"/> |
245 | + |
246 | + <menuitem groups="analytic.group_analytic_accounting" action="analytic.action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/> |
247 | + </data> |
248 | +</openerp> |
249 | |
250 | === modified file 'account/demo/account_minimal.xml' |
251 | --- account/demo/account_minimal.xml 2013-10-27 12:31:04 +0000 |
252 | +++ account/demo/account_minimal.xml 2014-04-29 11:49:43 +0000 |
253 | @@ -315,7 +315,7 @@ |
254 | <field name="sequence_id" ref="sequence_sale_journal"/> |
255 | <field name="default_credit_account_id" ref="a_sale"/> |
256 | <field name="default_debit_account_id" ref="a_sale"/> |
257 | - <field name="analytic_journal_id" ref="cose_journal_sale"/> |
258 | + <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/> |
259 | <field name="user_id" ref="base.user_root"/> |
260 | </record> |
261 | <record id="refund_sales_journal" model="account.journal"> |
262 | @@ -325,7 +325,7 @@ |
263 | <field name="sequence_id" ref="sequence_refund_sales_journal"/> |
264 | <field name="default_credit_account_id" ref="a_sale"/> |
265 | <field name="default_debit_account_id" ref="a_sale"/> |
266 | - <field name="analytic_journal_id" ref="cose_journal_sale"/> |
267 | + <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/> |
268 | <field name="user_id" ref="base.user_root"/> |
269 | </record> |
270 | |
271 | @@ -357,7 +357,7 @@ |
272 | <field name="sequence_id" ref="sequence_bank_journal"/> |
273 | <field name="default_debit_account_id" ref="bnk"/> |
274 | <field name="default_credit_account_id" ref="bnk"/> |
275 | - <field name="analytic_journal_id" ref="sit"/> |
276 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
277 | <field name="user_id" ref="base.user_root"/> |
278 | </record> |
279 | <record id="check_journal" model="account.journal"> |
280 | @@ -367,7 +367,7 @@ |
281 | <field name="sequence_id" ref="sequence_check_journal"/> |
282 | <field name="default_debit_account_id" ref="cash"/> |
283 | <field name="default_credit_account_id" ref="cash"/> |
284 | - <field name="analytic_journal_id" ref="sit"/> |
285 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
286 | <field name="user_id" ref="base.user_root"/> |
287 | </record> |
288 | <record id="cash_journal" model="account.journal"> |
289 | @@ -387,7 +387,7 @@ |
290 | <field name="sequence_id" ref="sequence_cash_journal"/> |
291 | <field name="default_debit_account_id" ref="cash"/> |
292 | <field name="default_credit_account_id" ref="cash"/> |
293 | - <field name="analytic_journal_id" ref="sit"/> |
294 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
295 | <field name="user_id" ref="base.user_root"/> |
296 | </record> |
297 | <record id="miscellaneous_journal" model="account.journal"> |
298 | @@ -395,7 +395,7 @@ |
299 | <field name="code">TMIS</field> |
300 | <field name="type">general</field> |
301 | <field name="sequence_id" ref="sequence_miscellaneous_journal"/> |
302 | - <field name="analytic_journal_id" ref="sit"/> |
303 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
304 | <field name="user_id" ref="base.user_root"/> |
305 | </record> |
306 | <record id="opening_journal" model="account.journal"> |
307 | |
308 | === modified file 'account/partner_view.xml' |
309 | --- account/partner_view.xml 2014-04-21 05:05:34 +0000 |
310 | +++ account/partner_view.xml 2014-04-29 11:49:43 +0000 |
311 | @@ -54,8 +54,8 @@ |
312 | <field name="context">{'search_default_partner_id': [active_id], 'default_partner_id': active_id}</field> |
313 | <field name="name">Contracts/Analytic Accounts</field> |
314 | <field name="res_model">account.analytic.account</field> |
315 | - <field name="view_id" ref="view_account_analytic_account_tree"/> |
316 | - <field name="search_view_id" ref="view_account_analytic_account_search"/> |
317 | + <field name="view_id" ref="analytic.view_account_analytic_account_tree"/> |
318 | + <field name="search_view_id" ref="analytic.view_account_analytic_account_search"/> |
319 | </record> |
320 | <record model="ir.ui.view" id="partner_view_buttons"> |
321 | <field name="name">partner.view.buttons</field> |
322 | |
323 | === removed directory 'account/project' |
324 | === removed file 'account/project/__init__.py' |
325 | --- account/project/__init__.py 2011-01-14 00:11:01 +0000 |
326 | +++ account/project/__init__.py 1970-01-01 00:00:00 +0000 |
327 | @@ -1,28 +0,0 @@ |
328 | -# -*- coding: utf-8 -*- |
329 | -############################################################################## |
330 | -# |
331 | -# OpenERP, Open Source Management Solution |
332 | -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
333 | -# |
334 | -# This program is free software: you can redistribute it and/or modify |
335 | -# it under the terms of the GNU Affero General Public License as |
336 | -# published by the Free Software Foundation, either version 3 of the |
337 | -# License, or (at your option) any later version. |
338 | -# |
339 | -# This program is distributed in the hope that it will be useful, |
340 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
341 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
342 | -# GNU Affero General Public License for more details. |
343 | -# |
344 | -# You should have received a copy of the GNU Affero General Public License |
345 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
346 | -# |
347 | -############################################################################## |
348 | - |
349 | -import project |
350 | -import report |
351 | -import wizard |
352 | - |
353 | - |
354 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
355 | - |
356 | |
357 | === removed file 'account/project/project.py' |
358 | --- account/project/project.py 2013-10-27 12:31:04 +0000 |
359 | +++ account/project/project.py 1970-01-01 00:00:00 +0000 |
360 | @@ -1,50 +0,0 @@ |
361 | -# -*- coding: utf-8 -*- |
362 | -############################################################################## |
363 | -# |
364 | -# OpenERP, Open Source Management Solution |
365 | -# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). |
366 | -# |
367 | -# This program is free software: you can redistribute it and/or modify |
368 | -# it under the terms of the GNU Affero General Public License as |
369 | -# published by the Free Software Foundation, either version 3 of the |
370 | -# License, or (at your option) any later version. |
371 | -# |
372 | -# This program is distributed in the hope that it will be useful, |
373 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
374 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
375 | -# GNU Affero General Public License for more details. |
376 | -# |
377 | -# You should have received a copy of the GNU Affero General Public License |
378 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
379 | -# |
380 | -############################################################################## |
381 | - |
382 | -from openerp.osv import fields, osv |
383 | - |
384 | -class account_analytic_journal(osv.osv): |
385 | - _name = 'account.analytic.journal' |
386 | - _description = 'Analytic Journal' |
387 | - _columns = { |
388 | - 'name': fields.char('Journal Name', size=64, required=True), |
389 | - 'code': fields.char('Journal Code', size=8), |
390 | - '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."), |
391 | - 'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."), |
392 | - 'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'), |
393 | - 'company_id': fields.many2one('res.company', 'Company', required=True), |
394 | - } |
395 | - _defaults = { |
396 | - 'active': True, |
397 | - 'type': 'general', |
398 | - 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, |
399 | - } |
400 | - |
401 | - |
402 | -class account_journal(osv.osv): |
403 | - _inherit="account.journal" |
404 | - |
405 | - _columns = { |
406 | - 'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"), |
407 | - } |
408 | - |
409 | - |
410 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
411 | |
412 | === removed file 'account/project/project_view.xml' |
413 | --- account/project/project_view.xml 2013-10-27 12:31:04 +0000 |
414 | +++ account/project/project_view.xml 1970-01-01 00:00:00 +0000 |
415 | @@ -1,372 +0,0 @@ |
416 | -<?xml version="1.0" encoding="utf-8"?> |
417 | -<openerp> |
418 | - <data> |
419 | - |
420 | - <record id="view_account_analytic_account_list" model="ir.ui.view"> |
421 | - <field name="name">account.analytic.account.list</field> |
422 | - <field name="model">account.analytic.account</field> |
423 | - <field eval="8" name="priority"/> |
424 | - <field name="arch" type="xml"> |
425 | - <tree toolbar="1" colors="red:state=='pending';grey:state in ('cancelled','close');blue:type=='view'" string="Analytic Accounts"> |
426 | - <field name="complete_name"/> |
427 | - <field name="partner_id"/> |
428 | - <field name="code"/> |
429 | - <field name="date_start"/> |
430 | - <field name="date"/> |
431 | - <field name="user_id" invisible="1"/> |
432 | - <field name="manager_id"/> |
433 | - <field name="parent_id" invisible="1"/> |
434 | - <field name="state" invisible="1"/> |
435 | - <field name="type" invisible="1"/> |
436 | - <field name="template_id" invisible="1"/> |
437 | - <field name="company_id" groups="base.group_multi_company"/> |
438 | - </tree> |
439 | - </field> |
440 | - </record> |
441 | - |
442 | - <record id="view_account_analytic_account_search" model="ir.ui.view"> |
443 | - <field name="name">account.analytic.account.search</field> |
444 | - <field name="model">account.analytic.account</field> |
445 | - <field name="arch" type="xml"> |
446 | - <search string="Analytic Account"> |
447 | - <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Analytic Account"/> |
448 | - <field name="date"/> |
449 | - <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
450 | - <field name="manager_id"/> |
451 | - <field name="parent_id"/> |
452 | - <field name="user_id"/> |
453 | - <filter string="Open" domain="[('state','=','open')]" help="Current Accounts"/> |
454 | - <filter string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/> |
455 | - <group expand="0" string="Group By..."> |
456 | - <filter string="Associated Partner" domain="[]" context="{'group_by':'partner_id'}"/> |
457 | - <filter string="Type" domain="[]" context="{'group_by':'type'}"/> |
458 | - <filter string="Template" domain="[]" context="{'group_by':'template_id'}"/> |
459 | - <filter string="Parent Account" domain="[]" context="{'group_by':'parent_id'}"/> |
460 | - <filter string="Status" domain="[]" context="{'group_by':'state'}" groups="base.group_no_one"/> |
461 | - </group> |
462 | - </search> |
463 | - </field> |
464 | - </record> |
465 | - |
466 | - <record id="view_account_analytic_account_tree" model="ir.ui.view"> |
467 | - <field name="name">account.analytic.account.tree</field> |
468 | - <field name="model">account.analytic.account</field> |
469 | - <field name="field_parent">child_complete_ids</field> |
470 | - <field name="arch" type="xml"> |
471 | - <tree colors="blue:state=='pending';grey:state in ('close','cancelled');blue:type=='view'" string="Analytic account" toolbar="1"> |
472 | - <field name="name" invisible="1"/> |
473 | - <field name="complete_name"/> |
474 | - <field name="code"/> |
475 | - <field name="debit"/> |
476 | - <field name="credit"/> |
477 | - <field name="balance"/> |
478 | - <field name="state" invisible="1"/> |
479 | - <field name="currency_id" groups="base.group_multi_currency"/> |
480 | - <field name="date" invisible="1"/> |
481 | - <field name="user_id" invisible="1"/> |
482 | - <field name="partner_id" invisible="1"/> |
483 | - <field name="parent_id" invisible="1"/> |
484 | - <field name="type"/> |
485 | - <field name="company_id" groups="base.group_multi_company"/> |
486 | - <field name="template_id" invisible="1"/> |
487 | - </tree> |
488 | - </field> |
489 | - </record> |
490 | - |
491 | - |
492 | - <record id="action_account_analytic_account_form" model="ir.actions.act_window"> |
493 | - <field name="name">Analytic Accounts</field> |
494 | - <field name="type">ir.actions.act_window</field> |
495 | - <field name="res_model">account.analytic.account</field> |
496 | - <field name="context">{}</field> <!-- repair invalid context by setting empty one --> |
497 | - <field name="view_type">form</field> |
498 | - <field name="view_mode">tree,form</field> |
499 | - <field name="view_id" ref="view_account_analytic_account_tree"/> |
500 | - <field name="search_view_id" ref="account.view_account_analytic_account_search"/> |
501 | - </record> |
502 | - <menuitem action="action_account_analytic_account_form" id="account_analytic_def_account" |
503 | - parent="menu_analytic_accounting" |
504 | - groups="analytic.group_analytic_accounting"/> |
505 | - |
506 | - <record id="act_account_renew_view" model="ir.actions.act_window"> |
507 | - <field name="name">Accounts to Renew</field> |
508 | - <field name="type">ir.actions.act_window</field> |
509 | - <field name="res_model">account.analytic.account</field> |
510 | - <field name="view_type">form</field> |
511 | - <field name="view_mode">tree,form</field> |
512 | - <field name="domain">[('date','<',time.strftime('%Y-%m-%d %H:%M:%S'))]</field> |
513 | - <field name="filter" eval="True"/> |
514 | - </record> |
515 | - |
516 | - <record id="action_account_analytic_account_tree2" model="ir.actions.act_window"> |
517 | - <field name="name">Chart of Analytic Accounts</field> |
518 | - <field name="res_model">account.analytic.account</field> |
519 | - <field name="view_type">tree</field> |
520 | - <field name="view_id" ref="view_account_analytic_account_tree"/> |
521 | - <field name="domain">[('parent_id','=',False)]</field> |
522 | - <field name="help" type="html"> |
523 | - <p> |
524 | - Click to add a new analytic account. |
525 | - </p><p> |
526 | - The normal chart of accounts has a structure defined by the |
527 | - legal requirement of the country. The analytic chart of |
528 | - accounts structure should reflect your own business needs in |
529 | - term of costs/revenues reporting. |
530 | - </p><p> |
531 | - They are usually structured by contracts, projects, products or |
532 | - departements. Most of the OpenERP operations (invoices, |
533 | - timesheets, expenses, etc) generate analytic entries on the |
534 | - related account. |
535 | - </p> |
536 | - </field> |
537 | - </record> |
538 | - |
539 | - |
540 | - <record id="view_account_analytic_line_form" model="ir.ui.view"> |
541 | - <field name="name">account.analytic.line.form</field> |
542 | - <field name="model">account.analytic.line</field> |
543 | - <field name="priority">1</field> |
544 | - <field name="arch" type="xml"> |
545 | - <form string="Analytic Entry" version="7.0"> |
546 | - <group> |
547 | - <group> |
548 | - <field name="name"/> |
549 | - <field name="account_id"/> |
550 | - <field name="journal_id"/> |
551 | - <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}"/> |
552 | - </group> |
553 | - <group> |
554 | - <field name="date"/> |
555 | - <field name="ref"/> |
556 | - <field name="company_id" groups="base.group_multi_company"/> |
557 | - </group> |
558 | - <group string="Amount"> |
559 | - <field name="amount"/> |
560 | - <label for="amount_currency" groups="base.group_multi_currency"/> |
561 | - <div groups="base.group_multi_currency"> |
562 | - <field name="amount_currency" class="oe_inline"/> |
563 | - <field name="currency_id" class="oe_inline"/> |
564 | - </div> |
565 | - </group> |
566 | - <group string="Product Information"> |
567 | - <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/> |
568 | - <label for="unit_amount"/> |
569 | - <div> |
570 | - <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/> |
571 | - <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/> |
572 | - </div> |
573 | - </group> |
574 | - <group string="General Accounting"> |
575 | - <field name="general_account_id"/> |
576 | - <field name="move_id" readonly="1"/> |
577 | - </group> |
578 | - </group> |
579 | - </form> |
580 | - </field> |
581 | - </record> |
582 | - <record id="view_account_analytic_line_tree" model="ir.ui.view"> |
583 | - <field name="name">account.analytic.line.tree</field> |
584 | - <field name="model">account.analytic.line</field> |
585 | - <field name="arch" type="xml"> |
586 | - <tree string="Analytic Entries"> |
587 | - <field name="date"/> |
588 | - <field name="ref" invisible="context.get('to_invoice', False)"/> |
589 | - <field name="name"/> |
590 | - <field name="user_id"/> |
591 | - <field name="journal_id" invisible="context.get('to_invoice', False)"/> |
592 | - <field name="amount" sum="Total" invisible="context.get('to_invoice', False)"/> |
593 | - <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)"/> |
594 | - <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity"/> |
595 | - <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)"/> |
596 | - <field domain="[('type','=','normal')]" name="account_id"/> |
597 | - <field name="general_account_id" invisible="context.get('to_invoice', False)"/> |
598 | - <field name="company_id" groups="base.group_multi_company"/> |
599 | - </tree> |
600 | - </field> |
601 | - </record> |
602 | - <record id="view_account_analytic_line_filter" model="ir.ui.view"> |
603 | - <field name="name">account.analytic.line.select</field> |
604 | - <field name="model">account.analytic.line</field> |
605 | - <field name="arch" type="xml"> |
606 | - <search string="Search Analytic Lines"> |
607 | - <field name="name" string="Analytic Line"/> |
608 | - <field name="date"/> |
609 | - <filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" help="Analytic Journal Items related to a sale journal."/> |
610 | - <filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" help="Analytic Journal Items related to a purchase journal."/> |
611 | - <filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]"/> |
612 | - <separator/> |
613 | - <filter string="My Entries" domain="[('user_id','=',uid)]"/> |
614 | - <field name="account_id"/> |
615 | - <field name="user_id"/> |
616 | - <group string="Group By..." expand="0"> |
617 | - <filter string="Analytic Account" context="{'group_by':'account_id'}"/> |
618 | - <filter string="Fin. Account" context="{'group_by':'general_account_id'}"/> |
619 | - <filter string="Journal" context="{'group_by':'journal_id'}" name="group_journal"/> |
620 | - <separator/> |
621 | - <filter string="Product" context="{'group_by':'product_id'}"/> |
622 | - <filter string="User" context="{'group_by':'user_id'}"/> |
623 | - <separator/> |
624 | - <filter string="Tasks Month" context="{'group_by':'date'}" name="group_date" help="Invoice Tasks by Month"/> |
625 | - |
626 | - </group> |
627 | - </search> |
628 | - </field> |
629 | - </record> |
630 | - <record id="action_account_analytic_line_form" model="ir.actions.act_window"> |
631 | - <field name="name">Analytic Entries</field> |
632 | - <field name="type">ir.actions.act_window</field> |
633 | - <field name="res_model">account.analytic.line</field> |
634 | - <field name="view_type">form</field> |
635 | - <field name="context">{"search_default_user_id":uid}</field> |
636 | - <field name="view_id" ref="view_account_analytic_line_tree"/> |
637 | - </record> |
638 | - |
639 | - <!-- Entries by Line --> |
640 | - |
641 | - <record id="action_account_tree1" model="ir.actions.act_window"> |
642 | - <field name="name">Analytic Items</field> |
643 | - <field name="res_model">account.analytic.line</field> |
644 | - <field name="view_type">form</field> |
645 | - <field name="view_mode">tree,form</field> |
646 | - <field name="domain">[('account_id','child_of',[active_id])]</field> |
647 | - <field name="context">{'account_id':active_id}</field> |
648 | - <field name="search_view_id" ref="view_account_analytic_line_filter"/> |
649 | - </record> |
650 | - <record id="ir_open_account_analytic_account" model="ir.values"> |
651 | - <field eval="'tree_but_open'" name="key2"/> |
652 | - <field eval="'account.analytic.account'" name="model"/> |
653 | - <field name="name">Open Account Tree</field> |
654 | - <field eval="'ir.actions.act_window,%d'%action_account_tree1" name="value"/> |
655 | - </record> |
656 | - |
657 | - <record id="account_analytic_line_extended_form" model="ir.ui.view"> |
658 | - <field name="name">account.analytic.line.extended_form</field> |
659 | - <field name="model">account.analytic.line</field> |
660 | - <field name="arch" type="xml"> |
661 | - <form string="Project line" version="7.0"> |
662 | - <group> |
663 | - <group> |
664 | - <field name="name"/> |
665 | - <field name="account_id"/> |
666 | - <field name="journal_id"/> |
667 | - </group> |
668 | - <group> |
669 | - <field name="date" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/> |
670 | - <field name="company_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/> |
671 | - </group> |
672 | - <group string="Amount"> |
673 | - <field name="amount"/> |
674 | - <label for="amount_currency" groups="base.group_multi_currency"/> |
675 | - <div groups="base.group_multi_currency"> |
676 | - <field name="amount_currency" class="oe_inline"/> |
677 | - <field name="currency_id" class="oe_inline"/> |
678 | - </div> |
679 | - <field invisible="1" name="general_account_id"/> |
680 | - </group> |
681 | - <group string="Product Information"> |
682 | - <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/> |
683 | - <label for="unit_amount"/> |
684 | - <div> |
685 | - <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/> |
686 | - <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/> |
687 | - </div> |
688 | - </group> |
689 | - </group> |
690 | - </form> |
691 | - </field> |
692 | - </record> |
693 | - <record id="action_account_analytic_account_line_extended_form" model="ir.actions.act_window"> |
694 | - <field name="name">account.analytic.line.extended</field> |
695 | - <field name="type">ir.actions.act_window</field> |
696 | - <field name="res_model">account.analytic.line</field> |
697 | - <field name="view_type">form</field> |
698 | - <field name="view_id" ref="account_analytic_line_extended_form"/> |
699 | - </record> |
700 | - |
701 | - # |
702 | - # Analytic Journal |
703 | - # |
704 | - |
705 | - <record id="view_account_analytic_journal_tree" model="ir.ui.view"> |
706 | - <field name="name">account.analytic.journal.tree</field> |
707 | - <field name="model">account.analytic.journal</field> |
708 | - <field name="arch" type="xml"> |
709 | - <tree string="Analytic Journal"> |
710 | - <field name="code"/> |
711 | - <field name="name"/> |
712 | - <field name="type"/> |
713 | - </tree> |
714 | - </field> |
715 | - </record> |
716 | - |
717 | - <record id="view_analytic_journal_search" model="ir.ui.view"> |
718 | - <field name="name">account.analytic.journal.search</field> |
719 | - <field name="model">account.analytic.journal</field> |
720 | - <field name="arch" type="xml"> |
721 | - <search string="Analytic Journals"> |
722 | - <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Analytic Journal"/> |
723 | - <field name="type"/> |
724 | - <group expand="0" string="Group By..."> |
725 | - <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/> |
726 | - </group> |
727 | - </search> |
728 | - </field> |
729 | - </record> |
730 | - |
731 | - <record id="view_account_analytic_journal_form" model="ir.ui.view"> |
732 | - <field name="name">account.analytic.journal.form</field> |
733 | - <field name="model">account.analytic.journal</field> |
734 | - <field name="arch" type="xml"> |
735 | - <form string="Analytic Journal" version="7.0"> |
736 | - <group col="4"> |
737 | - <field name="name"/> |
738 | - <field name="code"/> |
739 | - <field name="type"/> |
740 | - <field name="active"/> |
741 | - <field name="company_id" groups="base.group_multi_company"/> |
742 | - </group> |
743 | - </form> |
744 | - </field> |
745 | - </record> |
746 | - <record id="action_account_analytic_journal_form" model="ir.actions.act_window"> |
747 | - <field name="name">Analytic Journals</field> |
748 | - <field name="res_model">account.analytic.journal</field> |
749 | - <field name="view_type">form</field> |
750 | - <field name="view_mode">tree,form</field> |
751 | - <field name="search_view_id" ref="view_analytic_journal_search" /> |
752 | - </record> |
753 | - <menuitem groups="analytic.group_analytic_accounting" action="action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/> |
754 | - |
755 | - # |
756 | - # Open journal entries |
757 | - # |
758 | - |
759 | - <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window"> |
760 | - <field name="name">Analytic Journal Items</field> |
761 | - <field name="res_model">account.analytic.line</field> |
762 | - <field name="view_type">form</field> |
763 | - <field name="view_mode">tree,form</field> |
764 | - </record> |
765 | - <menuitem groups="analytic.group_analytic_accounting" |
766 | - action="action_account_analytic_journal_open_form" |
767 | - id="account_analytic_journal_entries" |
768 | - parent="menu_finance_entries"/> |
769 | - |
770 | - # |
771 | - # Reporting |
772 | - # |
773 | - |
774 | - |
775 | - <record id="view_account_journal_1" model="ir.ui.view"> |
776 | - <field name="name">account.journal.form.1</field> |
777 | - <field name="model">account.journal</field> |
778 | - <field name="inherit_id" ref="account.view_account_journal_form"/> |
779 | - <field name="arch" type="xml"> |
780 | - <field name="type" position="after"> |
781 | - <field name="analytic_journal_id" groups="analytic.group_analytic_accounting"/> |
782 | - </field> |
783 | - </field> |
784 | - </record> |
785 | - |
786 | - </data> |
787 | -</openerp> |
788 | |
789 | === removed file 'account/project/report/cost_ledger.py' |
790 | --- account/project/report/cost_ledger.py 2014-04-02 16:40:53 +0000 |
791 | +++ account/project/report/cost_ledger.py 1970-01-01 00:00:00 +0000 |
792 | @@ -1,111 +0,0 @@ |
793 | -# -*- coding: utf-8 -*- |
794 | -############################################################################## |
795 | -# |
796 | -# OpenERP, Open Source Management Solution |
797 | -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
798 | -# |
799 | -# This program is free software: you can redistribute it and/or modify |
800 | -# it under the terms of the GNU Affero General Public License as |
801 | -# published by the Free Software Foundation, either version 3 of the |
802 | -# License, or (at your option) any later version. |
803 | -# |
804 | -# This program is distributed in the hope that it will be useful, |
805 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
806 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
807 | -# GNU Affero General Public License for more details. |
808 | -# |
809 | -# You should have received a copy of the GNU Affero General Public License |
810 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
811 | -# |
812 | -############################################################################## |
813 | - |
814 | -import time |
815 | -from openerp.osv import osv |
816 | -from openerp.report import report_sxw |
817 | - |
818 | - |
819 | -class account_analytic_cost_ledger(report_sxw.rml_parse): |
820 | - def __init__(self, cr, uid, name, context): |
821 | - super(account_analytic_cost_ledger, self).__init__(cr, uid, name, context=context) |
822 | - self.localcontext.update( { |
823 | - 'time': time, |
824 | - 'lines_g': self._lines_g, |
825 | - 'lines_a': self._lines_a, |
826 | - 'account_sum_debit': self._account_sum_debit, |
827 | - 'account_sum_credit': self._account_sum_credit, |
828 | - 'account_sum_balance': self._account_sum_balance, |
829 | - 'sum_debit': self._sum_debit, |
830 | - 'sum_credit': self._sum_credit, |
831 | - 'sum_balance': self._sum_balance, |
832 | - }) |
833 | - self.children = {} # a memo for the method _get_children |
834 | - |
835 | - def _get_children(self, accounts): |
836 | - """ return all children accounts of the given accounts |
837 | - :param accounts: list of browse records of 'account.analytic.account' |
838 | - :return: tuple of account ids |
839 | - """ |
840 | - analytic_obj = self.pool.get('account.analytic.account') |
841 | - res = set() |
842 | - for account in accounts: |
843 | - if account.id not in self.children: |
844 | - self.children[account.id] = analytic_obj.search(self.cr, self.uid, [('parent_id', 'child_of', [account.id])]) |
845 | - res.update(self.children[account.id]) |
846 | - return tuple(res) |
847 | - |
848 | - def _lines_g(self, account, date1, date2): |
849 | - self.cr.execute("SELECT sum(aal.amount) AS balance, aa.code AS code, aa.name AS name, aa.id AS id \ |
850 | - FROM account_account AS aa, account_analytic_line AS aal \ |
851 | - WHERE (aal.account_id IN %s) AND (aal.date>=%s) AND (aal.date<=%s) AND (aal.general_account_id=aa.id) AND aa.active \ |
852 | - GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code", (self._get_children([account]), date1, date2)) |
853 | - res = self.cr.dictfetchall() |
854 | - for r in res: |
855 | - r['debit'] = r['balance'] if r['balance'] > 0 else 0.0 |
856 | - r['credit'] = -r['balance'] if r['balance'] < 0 else 0.0 |
857 | - return res |
858 | - |
859 | - def _lines_a(self, general_account, account, date1, date2): |
860 | - self.cr.execute("SELECT aal.name AS name, aal.code AS code, aal.amount AS balance, aal.date AS date, aaj.code AS cj FROM account_analytic_line AS aal, account_analytic_journal AS aaj \ |
861 | - WHERE (aal.general_account_id=%s) AND (aal.account_id IN %s) AND (aal.date>=%s) AND (aal.date<=%s) \ |
862 | - AND (aal.journal_id=aaj.id) \ |
863 | - ORDER BY aal.date, aaj.code, aal.code", (general_account['id'], self._get_children([account]), date1, date2)) |
864 | - res = self.cr.dictfetchall() |
865 | - for r in res: |
866 | - r['debit'] = r['balance'] if r['balance'] > 0 else 0.0 |
867 | - r['credit'] = -r['balance'] if r['balance'] < 0 else 0.0 |
868 | - return res |
869 | - |
870 | - def _account_sum_debit(self, account, date1, date2): |
871 | - return self._sum_debit([account], date1, date2) |
872 | - |
873 | - def _account_sum_credit(self, account, date1, date2): |
874 | - return self._sum_credit([account], date1, date2) |
875 | - |
876 | - def _account_sum_balance(self, account, date1, date2): |
877 | - debit = self._account_sum_debit(account, date1, date2) |
878 | - credit = self._account_sum_credit(account, date1, date2) |
879 | - return (debit-credit) |
880 | - |
881 | - def _sum_debit(self, accounts, date1, date2): |
882 | - self.cr.execute("SELECT sum(amount) FROM account_analytic_line WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0", |
883 | - (self._get_children(accounts), date1, date2,)) |
884 | - return self.cr.fetchone()[0] or 0.0 |
885 | - |
886 | - def _sum_credit(self, accounts, date1, date2): |
887 | - self.cr.execute("SELECT -sum(amount) FROM account_analytic_line WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0", |
888 | - (self._get_children(accounts), date1, date2,)) |
889 | - return self.cr.fetchone()[0] or 0.0 |
890 | - |
891 | - def _sum_balance(self, accounts, date1, date2): |
892 | - debit = self._sum_debit(accounts, date1, date2) |
893 | - credit = self._sum_credit(accounts, date1, date2) |
894 | - return (debit-credit) |
895 | - |
896 | - |
897 | -class report_analyticcostledger(osv.AbstractModel): |
898 | - _name = 'report.account.report_analyticcostledger' |
899 | - _inherit = 'report.abstract_report' |
900 | - _template = 'account.report_analyticcostledger' |
901 | - _wrapped_report_class = account_analytic_cost_ledger |
902 | - |
903 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
904 | |
905 | === removed file 'account/project/report/inverted_analytic_balance.py' |
906 | --- account/project/report/inverted_analytic_balance.py 2014-04-02 16:40:53 +0000 |
907 | +++ account/project/report/inverted_analytic_balance.py 1970-01-01 00:00:00 +0000 |
908 | @@ -1,130 +0,0 @@ |
909 | -# -*- coding: utf-8 -*- |
910 | -############################################################################## |
911 | -# |
912 | -# OpenERP, Open Source Management Solution |
913 | -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
914 | -# |
915 | -# This program is free software: you can redistribute it and/or modify |
916 | -# it under the terms of the GNU Affero General Public License as |
917 | -# published by the Free Software Foundation, either version 3 of the |
918 | -# License, or (at your option) any later version. |
919 | -# |
920 | -# This program is distributed in the hope that it will be useful, |
921 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
922 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
923 | -# GNU Affero General Public License for more details. |
924 | -# |
925 | -# You should have received a copy of the GNU Affero General Public License |
926 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
927 | -# |
928 | -############################################################################## |
929 | - |
930 | -import time |
931 | -from openerp.osv import osv |
932 | -from openerp.report import report_sxw |
933 | - |
934 | -class account_inverted_analytic_balance(report_sxw.rml_parse): |
935 | - def __init__(self, cr, uid, name, context): |
936 | - super(account_inverted_analytic_balance, self).__init__(cr, uid, name, context=context) |
937 | - self.localcontext.update( { |
938 | - 'time': time, |
939 | - 'lines_g': self._lines_g, |
940 | - 'lines_a': self._lines_a, |
941 | - 'sum_debit': self._sum_debit, |
942 | - 'sum_credit': self._sum_credit, |
943 | - 'sum_balance': self._sum_balance, |
944 | - 'sum_quantity': self._sum_quantity, |
945 | - }) |
946 | - |
947 | - def _lines_g(self, accounts, date1, date2): |
948 | - ids = map(lambda x: x.id, accounts) |
949 | - self.cr.execute("SELECT aa.name AS name, aa.code AS code, " |
950 | - "sum(aal.amount) AS balance, " |
951 | - "sum(aal.unit_amount) AS quantity, aa.id AS id \ |
952 | - FROM account_analytic_line AS aal, account_account AS aa \ |
953 | - WHERE (aal.general_account_id=aa.id) " |
954 | - "AND (aal.account_id IN %s) " |
955 | - "AND (date>=%s) AND (date<=%s) AND aa.active \ |
956 | - GROUP BY aal.general_account_id, aa.name, aa.code, aal.code, aa.id " |
957 | - "ORDER BY aal.code", |
958 | - (tuple(ids), date1, date2)) |
959 | - res = self.cr.dictfetchall() |
960 | - for r in res: |
961 | - if r['balance'] > 0: |
962 | - r['debit'] = r['balance'] |
963 | - r['credit'] = 0.0 |
964 | - elif r['balance'] < 0: |
965 | - r['debit'] = 0.0 |
966 | - r['credit'] = -r['balance'] |
967 | - else: |
968 | - r['debit'] = 0.0 |
969 | - r['credit'] = 0.0 |
970 | - return res |
971 | - |
972 | - def _lines_a(self, accounts, general_account_id, date1, date2): |
973 | - ids = map(lambda x: x.id, accounts) |
974 | - self.cr.execute("SELECT sum(aal.amount) AS balance, " |
975 | - "sum(aal.unit_amount) AS quantity, " |
976 | - "aaa.code AS code, aaa.name AS name, account_id \ |
977 | - FROM account_analytic_line AS aal, " |
978 | - "account_analytic_account AS aaa \ |
979 | - WHERE aal.account_id=aaa.id AND aal.account_id IN %s " |
980 | - "AND aal.general_account_id=%s AND aal.date>=%s " |
981 | - "AND aal.date<=%s \ |
982 | - GROUP BY aal.account_id, general_account_id, aaa.code, aaa.name " |
983 | - "ORDER BY aal.account_id", |
984 | - (tuple(ids), general_account_id, date1, date2)) |
985 | - res = self.cr.dictfetchall() |
986 | - |
987 | - aaa_obj = self.pool.get('account.analytic.account') |
988 | - res2 = aaa_obj.read(self.cr, self.uid, ids, ['complete_name']) |
989 | - complete_name = {} |
990 | - for r in res2: |
991 | - complete_name[r['id']] = r['complete_name'] |
992 | - for r in res: |
993 | - r['complete_name'] = complete_name[r['account_id']] |
994 | - if r['balance'] > 0: |
995 | - r['debit'] = r['balance'] |
996 | - r['credit'] = 0.0 |
997 | - elif r['balance'] < 0: |
998 | - r['debit'] = 0.0 |
999 | - r['credit'] = -r['balance'] |
1000 | - else: |
1001 | - r['debit'] = 0.0 |
1002 | - r['credit'] = 0.0 |
1003 | - return res |
1004 | - |
1005 | - def _sum_debit(self, accounts, date1, date2): |
1006 | - ids = map(lambda x: x.id, accounts) |
1007 | - self.cr.execute("SELECT sum(amount) \ |
1008 | - FROM account_analytic_line \ |
1009 | - WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0", (tuple(ids),date1, date2,)) |
1010 | - return self.cr.fetchone()[0] or 0.0 |
1011 | - |
1012 | - def _sum_credit(self, accounts, date1, date2): |
1013 | - ids = map(lambda x: x.id, accounts) |
1014 | - self.cr.execute("SELECT -sum(amount) \ |
1015 | - FROM account_analytic_line \ |
1016 | - WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0", (tuple(ids),date1, date2,)) |
1017 | - return self.cr.fetchone()[0] or 0.0 |
1018 | - |
1019 | - def _sum_balance(self, accounts, date1, date2): |
1020 | - debit = self._sum_debit(accounts, date1, date2) |
1021 | - credit = self._sum_credit(accounts, date1, date2) |
1022 | - return (debit-credit) |
1023 | - |
1024 | - def _sum_quantity(self, accounts, date1, date2): |
1025 | - ids = map(lambda x: x.id, accounts) |
1026 | - self.cr.execute("SELECT sum(unit_amount) \ |
1027 | - FROM account_analytic_line \ |
1028 | - WHERE account_id IN %s AND date>=%s AND date<=%s", (tuple(ids),date1, date2,)) |
1029 | - return self.cr.fetchone()[0] or 0.0 |
1030 | - |
1031 | - |
1032 | -class report_invertedanalyticbalance(osv.AbstractModel): |
1033 | - _name = 'report.account.report_invertedanalyticbalance' |
1034 | - _inherit = 'report.abstract_report' |
1035 | - _template = 'account.report_invertedanalyticbalance' |
1036 | - _wrapped_report_class = account_inverted_analytic_balance |
1037 | - |
1038 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1039 | |
1040 | === removed file 'account/project/report/quantity_cost_ledger.py' |
1041 | --- account/project/report/quantity_cost_ledger.py 2014-04-02 16:40:53 +0000 |
1042 | +++ account/project/report/quantity_cost_ledger.py 1970-01-01 00:00:00 +0000 |
1043 | @@ -1,127 +0,0 @@ |
1044 | -# -*- coding: utf-8 -*- |
1045 | -############################################################################## |
1046 | -# |
1047 | -# OpenERP, Open Source Management Solution |
1048 | -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
1049 | -# |
1050 | -# This program is free software: you can redistribute it and/or modify |
1051 | -# it under the terms of the GNU Affero General Public License as |
1052 | -# published by the Free Software Foundation, either version 3 of the |
1053 | -# License, or (at your option) any later version. |
1054 | -# |
1055 | -# This program is distributed in the hope that it will be useful, |
1056 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1057 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1058 | -# GNU Affero General Public License for more details. |
1059 | -# |
1060 | -# You should have received a copy of the GNU Affero General Public License |
1061 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1062 | -# |
1063 | -############################################################################## |
1064 | -import time |
1065 | -from openerp.osv import osv |
1066 | -from openerp.report import report_sxw |
1067 | - |
1068 | - |
1069 | -class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): |
1070 | - def __init__(self, cr, uid, name, context): |
1071 | - super(account_analytic_quantity_cost_ledger, self).__init__(cr, uid, name, context=context) |
1072 | - self.localcontext.update( { |
1073 | - 'time': time, |
1074 | - 'lines_g': self._lines_g, |
1075 | - 'lines_a': self._lines_a, |
1076 | - 'sum_quantity': self._sum_quantity, |
1077 | - 'account_sum_quantity': self._account_sum_quantity, |
1078 | - }) |
1079 | - |
1080 | - def _lines_g(self, account_id, date1, date2, journals): |
1081 | - if not journals: |
1082 | - self.cr.execute("SELECT sum(aal.unit_amount) AS quantity, \ |
1083 | - aa.code AS code, aa.name AS name, aa.id AS id \ |
1084 | - FROM account_account AS aa, account_analytic_line AS aal \ |
1085 | - WHERE (aal.account_id=%s) AND (aal.date>=%s) \ |
1086 | - AND (aal.date<=%s) AND (aal.general_account_id=aa.id) \ |
1087 | - AND aa.active \ |
1088 | - GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code", |
1089 | - (account_id, date1, date2)) |
1090 | - else: |
1091 | - journal_ids = journals |
1092 | - self.cr.execute("SELECT sum(aal.unit_amount) AS quantity, \ |
1093 | - aa.code AS code, aa.name AS name, aa.id AS id \ |
1094 | - FROM account_account AS aa, account_analytic_line AS aal \ |
1095 | - WHERE (aal.account_id=%s) AND (aal.date>=%s) \ |
1096 | - AND (aal.date<=%s) AND (aal.general_account_id=aa.id) \ |
1097 | - AND aa.active \ |
1098 | - AND (aal.journal_id IN %s ) \ |
1099 | - GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code", |
1100 | - (account_id, date1, date2, tuple(journal_ids))) |
1101 | - res = self.cr.dictfetchall() |
1102 | - return res |
1103 | - |
1104 | - def _lines_a(self, general_account_id, account_id, date1, date2, journals): |
1105 | - if not journals: |
1106 | - self.cr.execute("SELECT aal.name AS name, aal.code AS code, \ |
1107 | - aal.unit_amount AS quantity, aal.date AS date, \ |
1108 | - aaj.code AS cj \ |
1109 | - FROM account_analytic_line AS aal, \ |
1110 | - account_analytic_journal AS aaj \ |
1111 | - WHERE (aal.general_account_id=%s) AND (aal.account_id=%s) \ |
1112 | - AND (aal.date>=%s) AND (aal.date<=%s) \ |
1113 | - AND (aal.journal_id=aaj.id) \ |
1114 | - ORDER BY aal.date, aaj.code, aal.code", |
1115 | - (general_account_id, account_id, date1, date2)) |
1116 | - else: |
1117 | - journal_ids = journals |
1118 | - self.cr.execute("SELECT aal.name AS name, aal.code AS code, \ |
1119 | - aal.unit_amount AS quantity, aal.date AS date, \ |
1120 | - aaj.code AS cj \ |
1121 | - FROM account_analytic_line AS aal, \ |
1122 | - account_analytic_journal AS aaj \ |
1123 | - WHERE (aal.general_account_id=%s) AND (aal.account_id=%s) \ |
1124 | - AND (aal.date>=%s) AND (aal.date<=%s) \ |
1125 | - AND (aal.journal_id=aaj.id) AND (aaj.id IN %s) \ |
1126 | - ORDER BY aal.date, aaj.code, aal.code", |
1127 | - (general_account_id, account_id, date1, date2,tuple(journal_ids))) |
1128 | - res = self.cr.dictfetchall() |
1129 | - return res |
1130 | - |
1131 | - def _account_sum_quantity(self, account_id, date1, date2, journals): |
1132 | - if not journals: |
1133 | - self.cr.execute("SELECT sum(unit_amount) \ |
1134 | - FROM account_analytic_line \ |
1135 | - WHERE account_id=%s AND date>=%s AND date<=%s", |
1136 | - (account_id, date1, date2)) |
1137 | - else: |
1138 | - journal_ids = journals |
1139 | - self.cr.execute("SELECT sum(unit_amount) \ |
1140 | - FROM account_analytic_line \ |
1141 | - WHERE account_id = %s AND date >= %s AND date <= %s \ |
1142 | - AND journal_id IN %s", |
1143 | - (account_id, date1, date2, tuple(journal_ids),)) |
1144 | - return self.cr.fetchone()[0] or 0.0 |
1145 | - |
1146 | - def _sum_quantity(self, accounts, date1, date2, journals): |
1147 | - ids = map(lambda x: x.id, accounts) |
1148 | - if not ids: |
1149 | - return 0.0 |
1150 | - if not journals: |
1151 | - self.cr.execute("SELECT sum(unit_amount) \ |
1152 | - FROM account_analytic_line \ |
1153 | - WHERE account_id IN %s AND date>=%s AND date<=%s", |
1154 | - (tuple(ids), date1, date2,)) |
1155 | - else: |
1156 | - journal_ids = journals |
1157 | - self.cr.execute("SELECT sum(unit_amount) \ |
1158 | - FROM account_analytic_line \ |
1159 | - WHERE account_id IN %s AND date >= %s AND date <= %s \ |
1160 | - AND journal_id IN %s",(tuple(ids), date1, date2, tuple(journal_ids))) |
1161 | - return self.cr.fetchone()[0] or 0.0 |
1162 | - |
1163 | - |
1164 | -class report_analyticcostledgerquantity(osv.AbstractModel): |
1165 | - _name = 'report.account.report_analyticcostledgerquantity' |
1166 | - _inherit = 'report.abstract_report' |
1167 | - _template = 'account.report_analyticcostledgerquantity' |
1168 | - _wrapped_report_class = account_analytic_quantity_cost_ledger |
1169 | - |
1170 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1171 | |
1172 | === modified file 'account/report/account_analytic_entries_report.py' |
1173 | --- account/report/account_analytic_entries_report.py 2014-01-29 16:03:48 +0000 |
1174 | +++ account/report/account_analytic_entries_report.py 2014-04-29 11:49:43 +0000 |
1175 | @@ -33,8 +33,8 @@ |
1176 | 'partner_id': fields.many2one('res.partner', 'Partner'), |
1177 | 'company_id': fields.many2one('res.company', 'Company', required=True), |
1178 | 'currency_id': fields.many2one('res.currency', 'Currency', required=True), |
1179 | - 'account_id': fields.many2one('account.analytic.account', 'Account', required=False), |
1180 | - 'general_account_id': fields.many2one('account.account', 'General Account', required=True), |
1181 | + 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=False), |
1182 | + 'general_account_id': fields.many2one('account.account', 'Financial Account', required=True), |
1183 | 'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True), |
1184 | 'move_id': fields.many2one('account.move.line', 'Move', required=True), |
1185 | 'product_id': fields.many2one('product.product', 'Product', required=True), |
1186 | |
1187 | === modified file 'account/report/account_analytic_entries_report_view.xml' |
1188 | --- account/report/account_analytic_entries_report_view.xml 2014-01-29 16:03:48 +0000 |
1189 | +++ account/report/account_analytic_entries_report_view.xml 2014-04-29 11:49:43 +0000 |
1190 | @@ -14,8 +14,8 @@ |
1191 | <group expand="0" string="Group By..."> |
1192 | <filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/> |
1193 | <filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/> |
1194 | - <filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/> |
1195 | - <filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
1196 | + <filter string="Analytic Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/> |
1197 | + <filter string="Financial Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
1198 | <filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/> |
1199 | <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/> |
1200 | <filter string="Product Unit of Measure" icon="terp-mrp" context="{'group_by':'product_uom_id'}"/> |
1201 | |
1202 | === modified file 'account/security/account_security.xml' |
1203 | --- account/security/account_security.xml 2013-10-27 12:31:04 +0000 |
1204 | +++ account/security/account_security.xml 2014-04-29 11:49:43 +0000 |
1205 | @@ -64,7 +64,7 @@ |
1206 | |
1207 | <record id="analytic_journal_comp_rule" model="ir.rule"> |
1208 | <field name="name">Analytic journal multi-company</field> |
1209 | - <field name="model_id" ref="model_account_analytic_journal"/> |
1210 | + <field name="model_id" ref="analytic.model_account_analytic_journal"/> |
1211 | <field name="global" eval="True"/> |
1212 | <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> |
1213 | </record> |
1214 | |
1215 | === modified file 'account/security/ir.model.access.csv' |
1216 | --- account/security/ir.model.access.csv 2013-10-27 12:31:04 +0000 |
1217 | +++ account/security/ir.model.access.csv 2014-04-29 11:49:43 +0000 |
1218 | @@ -24,8 +24,8 @@ |
1219 | access_account_bank_statement_line,account.bank.statement.line,model_account_bank_statement_line,account.group_account_user,1,1,1,1 |
1220 | access_account_analytic_line_manager,account.analytic.line manager,model_account_analytic_line,account.group_account_manager,1,0,0,0 |
1221 | access_account_analytic_account,account.analytic.account,analytic.model_account_analytic_account,base.group_user,1,0,0,0 |
1222 | -access_account_analytic_journal,account.analytic.journal,model_account_analytic_journal,account.group_account_user,1,0,0,0 |
1223 | -access_account_analytic_journal_user,account.analytic.journal,model_account_analytic_journal,base.group_user,1,1,1,0 |
1224 | +access_account_analytic_journal,account.analytic.journal,analytic.model_account_analytic_journal,account.group_account_user,1,0,0,0 |
1225 | +access_account_analytic_journal_user,account.analytic.journal,analytic.model_account_analytic_journal,base.group_user,1,1,1,0 |
1226 | access_account_invoice_uinvoice,account.invoice,model_account_invoice,account.group_account_invoice,1,1,1,1 |
1227 | access_account_invoice_line_uinvoice,account.invoice.line,model_account_invoice_line,account.group_account_invoice,1,1,1,1 |
1228 | access_account_invoice_tax_uinvoice,account.invoice.tax,model_account_invoice_tax,account.group_account_invoice,1,1,1,1 |
1229 | @@ -41,8 +41,7 @@ |
1230 | access_account_period_manager,account.period,model_account_period,account.group_account_manager,1,1,1,1 |
1231 | access_account_period_invoice,account.period invoice,model_account_period,account.group_account_invoice,1,0,0,0 |
1232 | access_account_invoice_group_invoice,account.invoice group invoice,model_account_invoice,account.group_account_invoice,1,1,1,1 |
1233 | -access_account_analytic_journal_manager,account.analytic.journal,model_account_analytic_journal,account.group_account_manager,1,1,1,1 |
1234 | -access_account_fiscalyear,account.fiscalyear,model_account_fiscalyear,account.group_account_manager,1,1,1,1 |
1235 | +access_account_analytic_journal_manager,account.analytic.journal,analytic.model_account_analytic_journal,account.group_account_manager,1,1,1,1access_account_fiscalyear,account.fiscalyear,model_account_fiscalyear,account.group_account_manager,1,1,1,1 |
1236 | access_account_fiscalyear_invoice,account.fiscalyear.invoice,model_account_fiscalyear,account.group_account_invoice,1,0,0,0 |
1237 | access_account_fiscalyear_partner_manager,account.fiscalyear.partnermanager,model_account_fiscalyear,base.group_partner_manager,1,0,0,0 |
1238 | access_account_fiscalyear_employee,account.fiscalyear employee,model_account_fiscalyear,base.group_user,1,0,0,0 |
1239 | |
1240 | === modified file 'account/test/account_fiscalyear_close.yml' |
1241 | --- account/test/account_fiscalyear_close.yml 2013-11-27 15:32:57 +0000 |
1242 | +++ account/test/account_fiscalyear_close.yml 2014-04-29 11:49:43 +0000 |
1243 | @@ -34,7 +34,7 @@ |
1244 | name: End of Year |
1245 | code: NEW |
1246 | type: situation |
1247 | - analytic_journal_id: sit |
1248 | + analytic_journal_id: analytic.sit |
1249 | default_debit_account_id: cash |
1250 | default_credit_account_id: cash |
1251 | company_id: base.main_company |
1252 | |
1253 | === modified file 'account/test/account_report.yml' |
1254 | --- account/test/account_report.yml 2014-04-02 16:40:53 +0000 |
1255 | +++ account/test/account_report.yml 2014-04-29 11:49:43 +0000 |
1256 | @@ -135,47 +135,47 @@ |
1257 | - |
1258 | !python {model: account.analytic.account}: | |
1259 | ctx={} |
1260 | - ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}) |
1261 | + ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]}) |
1262 | data_dict = {} |
1263 | from openerp.tools import test_reports |
1264 | - test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account') |
1265 | + test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account') |
1266 | |
1267 | - |
1268 | Print the Cost Ledger Report through the wizard |
1269 | - |
1270 | !python {model: account.analytic.account}: | |
1271 | ctx={} |
1272 | - 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')]}) |
1273 | + 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')]}) |
1274 | data_dict = {} |
1275 | from openerp.tools import test_reports |
1276 | - test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account') |
1277 | + test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account') |
1278 | |
1279 | - |
1280 | Print the Cost Ledger(Only Quantities) Report through the wizard |
1281 | - |
1282 | !python {model: account.analytic.account}: | |
1283 | ctx={} |
1284 | - 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')]}) |
1285 | + 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')]}) |
1286 | data_dict = {} |
1287 | from openerp.tools import test_reports |
1288 | - test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account') |
1289 | + test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account') |
1290 | |
1291 | - |
1292 | Print the Analytic Journal Report through the wizard |
1293 | - |
1294 | !python {model: account.analytic.journal}: | |
1295 | ctx={} |
1296 | - ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]}) |
1297 | + ctx.update({'model': 'account.analytic.journal','active_ids': [ref('analytic.cose_journal_sale'), ref('account.exp'), ref('analytic.sit')]}) |
1298 | data_dict = {} |
1299 | from openerp.tools import test_reports |
1300 | - test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account') |
1301 | + test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account') |
1302 | |
1303 | - |
1304 | Print the Inverted Analytic Balance Report through the wizard |
1305 | - |
1306 | !python {model: account.analytic.account}: | |
1307 | ctx={} |
1308 | - ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}) |
1309 | + ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]}) |
1310 | data_dict = {} |
1311 | from openerp.tools import test_reports |
1312 | - test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account') |
1313 | + test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account') |
1314 | |
1315 | === modified file 'account_analytic_analysis/account_analytic_analysis_view.xml' |
1316 | --- account_analytic_analysis/account_analytic_analysis_view.xml 2014-04-01 12:36:57 +0000 |
1317 | +++ account_analytic_analysis/account_analytic_analysis_view.xml 2014-04-29 11:49:43 +0000 |
1318 | @@ -197,7 +197,7 @@ |
1319 | <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view"> |
1320 | <field name="name">account.analytic.account.list.contract</field> |
1321 | <field name="model">account.analytic.account</field> |
1322 | - <field name="inherit_id" ref="account.view_account_analytic_account_list"/> |
1323 | + <field name="inherit_id" ref="analytic.view_account_analytic_account_list"/> |
1324 | <field name="arch" type="xml"> |
1325 | <field name="date_start" position="before"> |
1326 | <field name="last_invoice_date"/> |
1327 | @@ -280,7 +280,7 @@ |
1328 | <field name="view_mode">tree,form</field> |
1329 | <field name="domain">[('invoice_id','=',False)]</field> |
1330 | <field name="context">{'search_default_to_invoice': 1}</field> |
1331 | - <field name="search_view_id" ref="account.view_account_analytic_line_filter"/> |
1332 | + <field name="search_view_id" ref="analytic.view_account_analytic_line_filter"/> |
1333 | <field name="help" type="html"> |
1334 | <p> |
1335 | You will find here timesheets and purchases you did for |
1336 | @@ -338,6 +338,21 @@ |
1337 | </field> |
1338 | </record> |
1339 | <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config"/> |
1340 | + |
1341 | + <record id="account_analytic_analysis_form_form" model="ir.ui.view"> |
1342 | + <field name="name">account.analytic.account.invoice.form.inherit</field> |
1343 | + <field name="model">account.analytic.account</field> |
1344 | + <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/> |
1345 | + <field eval="20" name="priority"/> |
1346 | + <field name="arch" type="xml"> |
1347 | + <xpath expr='//div[@name="buttons"]' position='inside'> |
1348 | + <button string="Time & Materials to Invoice" |
1349 | + name="%(action_hr_tree_invoiced_all)d" |
1350 | + type="action" |
1351 | + context="{'search_default_account_id': [active_id], 'default_account_id': active_id}"/> |
1352 | + </xpath> |
1353 | + </field> |
1354 | + </record> |
1355 | |
1356 | </data> |
1357 | </openerp> |
1358 | |
1359 | === modified file 'account_analytic_analysis/analytic_account_demo.xml' |
1360 | --- account_analytic_analysis/analytic_account_demo.xml 2013-10-27 12:31:04 +0000 |
1361 | +++ account_analytic_analysis/analytic_account_demo.xml 2014-04-29 11:49:43 +0000 |
1362 | @@ -1,7 +1,7 @@ |
1363 | <?xml version="1.0" encoding="utf-8"?> |
1364 | <openerp> |
1365 | <data noupdate="1"> |
1366 | - <record id="account.analytic_consultancy" model="account.analytic.account"> |
1367 | + <record id="analytic.analytic_consultancy" model="account.analytic.account"> |
1368 | <field name="partner_id" ref="base.res_partner_15"/> |
1369 | <field name="invoice_on_timesheets">True</field> |
1370 | <field name="hours_qtt_est">1200</field> |
1371 | @@ -12,16 +12,16 @@ |
1372 | </record> |
1373 | |
1374 | <record id="sale.sale_order_4" model="sale.order"> |
1375 | - <field name="project_id" ref="account.analytic_consultancy"/> |
1376 | + <field name="project_id" ref="analytic.analytic_consultancy"/> |
1377 | </record> |
1378 | |
1379 | <record id="hr_timesheet.working_hours_maintenance" model="hr.analytic.timesheet"> |
1380 | - <field name="account_id" ref="account.analytic_consultancy"/> |
1381 | + <field name="account_id" ref="analytic.analytic_consultancy"/> |
1382 | <field name="to_invoice" ref="hr_timesheet_invoice.timesheet_invoice_factor1"/> |
1383 | <field name="unit_amount">100</field> |
1384 | </record> |
1385 | |
1386 | - <record id="account.analytic_super_product_trainings" model="account.analytic.account"> |
1387 | + <record id="analytic.analytic_super_product_trainings" model="account.analytic.account"> |
1388 | <field name="partner_id" ref="base.res_partner_18"/> |
1389 | <field name="invoice_on_timesheets">True</field> |
1390 | <field name="hours_qtt_est">500</field> |
1391 | @@ -32,11 +32,11 @@ |
1392 | </record> |
1393 | |
1394 | <record id="sale.sale_order_6" model="sale.order"> |
1395 | - <field name="project_id" ref="account.analytic_super_product_trainings"/> |
1396 | + <field name="project_id" ref="analytic.analytic_super_product_trainings"/> |
1397 | <field name="partner_id" ref="base.res_partner_1"/> |
1398 | </record> |
1399 | |
1400 | - <record id="account.analytic_support_internal" model="account.analytic.account"> |
1401 | + <record id="analytic.analytic_support_internal" model="account.analytic.account"> |
1402 | <field name="partner_id" ref="base.res_partner_1"/> |
1403 | <field name="use_timesheets">True</field> |
1404 | <field name="invoice_on_timesheets">True</field> |
1405 | |
1406 | === modified file 'account_analytic_plans/test/acount_analytic_plans_report.yml' |
1407 | --- account_analytic_plans/test/acount_analytic_plans_report.yml 2014-04-02 16:40:53 +0000 |
1408 | +++ account_analytic_plans/test/acount_analytic_plans_report.yml 2014-04-29 11:49:43 +0000 |
1409 | @@ -5,7 +5,7 @@ |
1410 | import os, time |
1411 | import openerp.report |
1412 | from openerp import tools |
1413 | - 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':{}}} |
1414 | - data, format = openerp.report.render_report(cr, uid, [ref('account.analytic_root')], 'account_analytic_plans.report_crossoveredanalyticplans', data_dict, {}) |
1415 | + 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':{}}} |
1416 | + data, format = openerp.report.render_report(cr, uid, [ref('analytic.analytic_root')], 'account_analytic_plans.report_crossoveredanalyticplans', data_dict, {}) |
1417 | if tools.config['test_report_directory']: |
1418 | file(os.path.join(tools.config['test_report_directory'], 'account_analytic_plans-crossovered_analyitic.'+format), 'wb+').write(data) |
1419 | |
1420 | === modified file 'account_budget/account_budget_demo.xml' |
1421 | --- account_budget/account_budget_demo.xml 2011-11-01 11:28:40 +0000 |
1422 | +++ account_budget/account_budget_demo.xml 2014-04-29 11:49:43 +0000 |
1423 | @@ -42,7 +42,7 @@ |
1424 | <!-- Budget lines --> |
1425 | <data noupdate="1"> |
1426 | <record id="crossovered_budget_lines_0" model="crossovered.budget.lines"> |
1427 | - <field name="analytic_account_id" ref="account.analytic_consultancy"/> |
1428 | + <field name="analytic_account_id" ref="analytic.analytic_consultancy"/> |
1429 | <field name="general_budget_id" ref="account_budget_post_purchase0"/> |
1430 | <field eval="str(time.localtime(time.time())[0]+1)+'-01-01'" name="date_from"/> |
1431 | <field eval="-500.0" name="planned_amount"/> |
1432 | @@ -50,7 +50,7 @@ |
1433 | <field eval="str(time.localtime(time.time())[0]+1)+'-01-31'" name="date_to"/> |
1434 | </record> |
1435 | <record id="crossovered_budget_lines_1" model="crossovered.budget.lines"> |
1436 | - <field name="analytic_account_id" ref="account.analytic_consultancy"/> |
1437 | + <field name="analytic_account_id" ref="analytic.analytic_consultancy"/> |
1438 | <field name="general_budget_id" ref="account_budget_post_purchase0"/> |
1439 | <field eval="str(time.localtime(time.time())[0]+1)+'-02-01'" name="date_from"/> |
1440 | <field eval="-250.0" name="planned_amount"/> |
1441 | @@ -58,7 +58,7 @@ |
1442 | <field eval="str(time.localtime(time.time())[0]+1)+'-02-28'" name="date_to"/> |
1443 | </record> |
1444 | <record id="crossovered_budget_lines_2" model="crossovered.budget.lines"> |
1445 | - <field name="analytic_account_id" ref="account.analytic_consultancy"/> |
1446 | + <field name="analytic_account_id" ref="analytic.analytic_consultancy"/> |
1447 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1448 | <field eval="str(time.localtime(time.time())[0]+1)+'-01-01'" name="date_from"/> |
1449 | <field eval="500.0" name="planned_amount"/> |
1450 | @@ -66,7 +66,7 @@ |
1451 | <field eval="str(time.localtime(time.time())[0]+1)+'-01-31'" name="date_to"/> |
1452 | </record> |
1453 | <record id="crossovered_budget_lines_3" model="crossovered.budget.lines"> |
1454 | - <field name="analytic_account_id" ref="account.analytic_consultancy"/> |
1455 | + <field name="analytic_account_id" ref="analytic.analytic_consultancy"/> |
1456 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1457 | <field eval="str(time.localtime(time.time())[0]+1)+'-02-07'" name="date_from"/> |
1458 | <field eval="900.0" name="planned_amount"/> |
1459 | @@ -74,7 +74,7 @@ |
1460 | <field eval="str(time.localtime(time.time())[0]+1)+'-02-28'" name="date_to"/> |
1461 | </record> |
1462 | <record id="crossovered_budget_lines_4" model="crossovered.budget.lines"> |
1463 | - <field name="analytic_account_id" ref="account.analytic_consultancy"/> |
1464 | + <field name="analytic_account_id" ref="analytic.analytic_consultancy"/> |
1465 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1466 | <field eval="str(time.localtime(time.time())[0]+1)+'-03-01'" name="date_from"/> |
1467 | <field eval="300.0" name="planned_amount"/> |
1468 | @@ -84,7 +84,7 @@ |
1469 | </data> |
1470 | <data noupdate="1"> |
1471 | <record id="crossovered_budget_lines_5" model="crossovered.budget.lines"> |
1472 | - <field name="analytic_account_id" ref="account.analytic_super_product_trainings"/> |
1473 | + <field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/> |
1474 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1475 | <field eval="str(time.localtime(time.time())[0]+1)+'-03-16'" name="date_from"/> |
1476 | <field eval="375.0" name="planned_amount"/> |
1477 | @@ -93,7 +93,7 @@ |
1478 | <field eval="str(time.localtime(time.time())[0]+1)+'-03-31'" name="date_to"/> |
1479 | </record> |
1480 | <record id="crossovered_budget_lines_6" model="crossovered.budget.lines"> |
1481 | - <field name="analytic_account_id" ref="account.analytic_super_product_trainings"/> |
1482 | + <field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/> |
1483 | <field name="general_budget_id" ref="account_budget_post_purchase0"/> |
1484 | <field eval="str(time.localtime(time.time())[0]+1)+'-04-01'" name="date_from"/> |
1485 | <field eval="-150.0" name="planned_amount"/> |
1486 | @@ -101,7 +101,7 @@ |
1487 | <field eval="str(time.localtime(time.time())[0]+1)+'-04-30'" name="date_to"/> |
1488 | </record> |
1489 | <record id="crossovered_budget_lines_7" model="crossovered.budget.lines"> |
1490 | - <field name="analytic_account_id" ref="account.analytic_super_product_trainings"/> |
1491 | + <field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/> |
1492 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1493 | <field eval="str(time.localtime(time.time())[0]+1)+'-05-01'" name="date_from"/> |
1494 | <field eval="375.0" name="planned_amount"/> |
1495 | @@ -112,7 +112,7 @@ |
1496 | </data> |
1497 | <data noupdate="1"> |
1498 | <record id="crossovered_budget_lines_8" model="crossovered.budget.lines"> |
1499 | - <field name="analytic_account_id" ref="account.analytic_seagate_p1"/> |
1500 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/> |
1501 | <field name="general_budget_id" ref="account_budget_post_purchase0"/> |
1502 | <field eval="str(time.localtime(time.time())[0]+1)+'-06-01'" name="date_from"/> |
1503 | <field eval="-7500.0" name="planned_amount"/> |
1504 | @@ -120,7 +120,7 @@ |
1505 | <field eval="str(time.localtime(time.time())[0]+1)+'-06-15'" name="date_to"/> |
1506 | </record> |
1507 | <record id="crossovered_budget_lines_9" model="crossovered.budget.lines"> |
1508 | - <field name="analytic_account_id" ref="account.analytic_seagate_p1"/> |
1509 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/> |
1510 | <field name="general_budget_id" ref="account_budget_post_purchase0"/> |
1511 | <field eval="str(time.localtime(time.time())[0]+1)+'-06-16'" name="date_from"/> |
1512 | <field eval="-5000.0" name="planned_amount"/> |
1513 | @@ -128,7 +128,7 @@ |
1514 | <field eval="str(time.localtime(time.time())[0]+1)+'-06-30'" name="date_to"/> |
1515 | </record> |
1516 | <record id="crossovered_budget_lines_10" model="crossovered.budget.lines"> |
1517 | - <field name="analytic_account_id" ref="account.analytic_seagate_p1"/> |
1518 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/> |
1519 | <field name="general_budget_id" ref="account_budget_post_purchase0"/> |
1520 | <field eval="str(time.localtime(time.time())[0]+1)+'-07-01'" name="date_from"/> |
1521 | <field eval="-2000.0" name="planned_amount"/> |
1522 | @@ -136,7 +136,7 @@ |
1523 | <field eval="str(time.localtime(time.time())[0]+1)+'-07-15'" name="date_to"/> |
1524 | </record> |
1525 | <record id="crossovered_budget_lines_11" model="crossovered.budget.lines"> |
1526 | - <field name="analytic_account_id" ref="account.analytic_seagate_p1"/> |
1527 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/> |
1528 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1529 | <field eval="str(time.localtime(time.time())[0]+1)+'-07-16'" name="date_from"/> |
1530 | <field eval="20000.0" name="planned_amount"/> |
1531 | @@ -144,7 +144,7 @@ |
1532 | <field eval="str(time.localtime(time.time())[0]+1)+'-07-31'" name="date_to"/> |
1533 | </record> |
1534 | <record id="crossovered_budget_lines_12" model="crossovered.budget.lines"> |
1535 | - <field name="analytic_account_id" ref="account.analytic_seagate_p1"/> |
1536 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/> |
1537 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1538 | <field eval="str(time.localtime(time.time())[0]+1)+'-08-01'" name="date_from"/> |
1539 | <field eval="20000.0" name="planned_amount"/> |
1540 | @@ -154,7 +154,7 @@ |
1541 | </data> |
1542 | <data noupdate="1"> |
1543 | <record id="crossovered_budget_lines_13" model="crossovered.budget.lines"> |
1544 | - <field name="analytic_account_id" ref="account.analytic_seagate_p2"/> |
1545 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/> |
1546 | <field name="general_budget_id" ref="account_budget_post_purchase0"/> |
1547 | <field eval="str(time.localtime(time.time())[0]+1)+'-08-16'" name="date_from"/> |
1548 | <field eval="-3000.0" name="planned_amount"/> |
1549 | @@ -162,7 +162,7 @@ |
1550 | <field eval="str(time.localtime(time.time())[0]+1)+'-08-31'" name="date_to"/> |
1551 | </record> |
1552 | <record id="crossovered_budget_lines_14" model="crossovered.budget.lines"> |
1553 | - <field name="analytic_account_id" ref="account.analytic_seagate_p2"/> |
1554 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/> |
1555 | <field name="general_budget_id" ref="account_budget_post_purchase0"/> |
1556 | <field eval="str(time.localtime(time.time())[0]+1)+'-09-01'" name="date_from"/> |
1557 | <field eval="-1000.0" name="planned_amount"/> |
1558 | @@ -170,7 +170,7 @@ |
1559 | <field eval="str(time.localtime(time.time())[0]+1)+'-09-15'" name="date_to"/> |
1560 | </record> |
1561 | <record id="crossovered_budget_lines_15" model="crossovered.budget.lines"> |
1562 | - <field name="analytic_account_id" ref="account.analytic_seagate_p2"/> |
1563 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/> |
1564 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1565 | <field eval="str(time.localtime(time.time())[0]+1)+'-09-16'" name="date_from"/> |
1566 | <field eval="10000.0" name="planned_amount"/> |
1567 | @@ -178,7 +178,7 @@ |
1568 | <field eval="str(time.localtime(time.time())[0]+1)+'-09-30'" name="date_to"/> |
1569 | </record> |
1570 | <record id="crossovered_budget_lines_16" model="crossovered.budget.lines"> |
1571 | - <field name="analytic_account_id" ref="account.analytic_seagate_p2"/> |
1572 | + <field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/> |
1573 | <field name="general_budget_id" ref="account_budget_post_sales0"/> |
1574 | <field eval="str(time.localtime(time.time())[0]+1)+'-10-01'" name="date_from"/> |
1575 | <field eval="10000.0" name="planned_amount"/> |
1576 | |
1577 | === modified file 'account_budget/test/account_budget.yml' |
1578 | --- account_budget/test/account_budget.yml 2011-01-14 00:11:01 +0000 |
1579 | +++ account_budget/test/account_budget.yml 2014-04-29 11:49:43 +0000 |
1580 | @@ -16,12 +16,12 @@ |
1581 | - |
1582 | !record {model: crossovered.budget, id: crossovered_budget_budget0}: |
1583 | crossovered_budget_line: |
1584 | - - analytic_account_id: account.analytic_consultancy |
1585 | + - analytic_account_id: analytic.analytic_consultancy |
1586 | date_from: !eval "'%s-01-01' %(datetime.now().year+1)" |
1587 | date_to: !eval "'%s-12-31' %(datetime.now().year+1)" |
1588 | general_budget_id: account_budget.account_budget_post_purchase0 |
1589 | planned_amount: 10000.0 |
1590 | - - analytic_account_id: account.analytic_super_product_trainings |
1591 | + - analytic_account_id: analytic.analytic_super_product_trainings |
1592 | date_from: !eval "'%s-09-01' %(datetime.now().year+1)" |
1593 | date_to: !eval "'%s-09-30' %(datetime.now().year+1)" |
1594 | general_budget_id: account_budget.account_budget_post_sales0 |
1595 | |
1596 | === modified file 'account_budget/test/account_budget_report.yml' |
1597 | --- account_budget/test/account_budget_report.yml 2014-04-02 16:40:53 +0000 |
1598 | +++ account_budget/test/account_budget_report.yml 2014-04-29 11:49:43 +0000 |
1599 | @@ -2,7 +2,7 @@ |
1600 | Print the Analytic Budget Report through wizard |
1601 | - |
1602 | !python {model: account.analytic.account}: | |
1603 | - ctx = {'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]} |
1604 | + ctx = {'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]} |
1605 | from openerp.tools import test_reports |
1606 | test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data={}, context=ctx, our_module='account_budget') |
1607 | |
1608 | |
1609 | === modified file 'account_voucher/test/case1_usd_usd.yml' |
1610 | --- account_voucher/test/case1_usd_usd.yml 2013-10-27 12:31:04 +0000 |
1611 | +++ account_voucher/test/case1_usd_usd.yml 2014-04-29 11:49:43 +0000 |
1612 | @@ -60,7 +60,7 @@ |
1613 | name: Bank Journal(USD) |
1614 | code: BUSD |
1615 | type: bank |
1616 | - analytic_journal_id: account.sit |
1617 | + analytic_journal_id: analytic.sit |
1618 | sequence_id: account.sequence_bank_journal |
1619 | default_debit_account_id: account_cash_usd_id |
1620 | default_credit_account_id: account_cash_usd_id |
1621 | |
1622 | === modified file 'account_voucher/test/case1_usd_usd_payment_rate.yml' |
1623 | --- account_voucher/test/case1_usd_usd_payment_rate.yml 2013-05-14 12:03:41 +0000 |
1624 | +++ account_voucher/test/case1_usd_usd_payment_rate.yml 2014-04-29 11:49:43 +0000 |
1625 | @@ -60,7 +60,7 @@ |
1626 | name: Bank Journal(USD) |
1627 | code: BUSD |
1628 | type: bank |
1629 | - analytic_journal_id: account.sit |
1630 | + analytic_journal_id: analytic.sit |
1631 | sequence_id: account.sequence_bank_journal |
1632 | default_debit_account_id: account_cash_usd_id |
1633 | default_credit_account_id: account_cash_usd_id |
1634 | |
1635 | === modified file 'account_voucher/test/case2_usd_eur_debtor_in_eur.yml' |
1636 | --- account_voucher/test/case2_usd_eur_debtor_in_eur.yml 2013-10-27 12:31:04 +0000 |
1637 | +++ account_voucher/test/case2_usd_eur_debtor_in_eur.yml 2014-04-29 11:49:43 +0000 |
1638 | @@ -54,7 +54,7 @@ |
1639 | name: Bank Journal(EUR) |
1640 | code: BEUR |
1641 | type: bank |
1642 | - analytic_journal_id: account.sit |
1643 | + analytic_journal_id: analytic.sit |
1644 | sequence_id: account.sequence_bank_journal |
1645 | default_debit_account_id: account.cash |
1646 | default_credit_account_id: account.cash |
1647 | @@ -66,7 +66,7 @@ |
1648 | name: Bank Journal(USD) |
1649 | code: BUSD |
1650 | type: bank |
1651 | - analytic_journal_id: account.sit |
1652 | + analytic_journal_id: analytic.sit |
1653 | sequence_id: account.sequence_bank_journal |
1654 | default_debit_account_id: account_cash_usd_id |
1655 | default_credit_account_id: account_cash_usd_id |
1656 | |
1657 | === modified file 'account_voucher/test/case2_usd_eur_debtor_in_usd.yml' |
1658 | --- account_voucher/test/case2_usd_eur_debtor_in_usd.yml 2013-10-27 12:31:04 +0000 |
1659 | +++ account_voucher/test/case2_usd_eur_debtor_in_usd.yml 2014-04-29 11:49:43 +0000 |
1660 | @@ -54,7 +54,7 @@ |
1661 | name: Bank Journal(EUR) |
1662 | code: BEUR |
1663 | type: bank |
1664 | - analytic_journal_id: account.sit |
1665 | + analytic_journal_id: analytic.sit |
1666 | sequence_id: account.sequence_bank_journal |
1667 | default_debit_account_id: account.cash |
1668 | default_credit_account_id: account.cash |
1669 | @@ -66,7 +66,7 @@ |
1670 | name: Bank Journal(USD) |
1671 | code: BUSD |
1672 | type: bank |
1673 | - analytic_journal_id: account.sit |
1674 | + analytic_journal_id: analytic.sit |
1675 | sequence_id: account.sequence_bank_journal |
1676 | default_debit_account_id: account_cash_usd_id |
1677 | default_credit_account_id: account_cash_usd_id |
1678 | |
1679 | === modified file 'account_voucher/test/case3_eur_eur.yml' |
1680 | --- account_voucher/test/case3_eur_eur.yml 2013-10-27 12:31:04 +0000 |
1681 | +++ account_voucher/test/case3_eur_eur.yml 2014-04-29 11:49:43 +0000 |
1682 | @@ -22,7 +22,7 @@ |
1683 | name: Bank Journal(EUR) |
1684 | code: BEUR |
1685 | type: bank |
1686 | - analytic_journal_id: account.sit |
1687 | + analytic_journal_id: analytic.sit |
1688 | sequence_id: account.sequence_bank_journal |
1689 | default_debit_account_id: account.cash |
1690 | default_credit_account_id: account.cash |
1691 | |
1692 | === modified file 'account_voucher/test/case4_cad_chf.yml' |
1693 | --- account_voucher/test/case4_cad_chf.yml 2013-10-27 12:31:04 +0000 |
1694 | +++ account_voucher/test/case4_cad_chf.yml 2014-04-29 11:49:43 +0000 |
1695 | @@ -55,7 +55,7 @@ |
1696 | name: Bank Journal(CHF) |
1697 | code: BCHF |
1698 | type: bank |
1699 | - analytic_journal_id: account.sit |
1700 | + analytic_journal_id: analytic.sit |
1701 | sequence_id: account.sequence_bank_journal |
1702 | default_debit_account_id: account_cash_chf_id |
1703 | default_credit_account_id: account_cash_chf_id |
1704 | |
1705 | === modified file 'account_voucher/test/case5_suppl_usd_usd.yml' |
1706 | --- account_voucher/test/case5_suppl_usd_usd.yml 2013-10-27 12:31:04 +0000 |
1707 | +++ account_voucher/test/case5_suppl_usd_usd.yml 2014-04-29 11:49:43 +0000 |
1708 | @@ -41,7 +41,7 @@ |
1709 | name: Bank Journal(EUR) |
1710 | code: BEUR |
1711 | type: bank |
1712 | - analytic_journal_id: account.sit |
1713 | + analytic_journal_id: analytic.sit |
1714 | sequence_id: account.sequence_bank_journal |
1715 | default_debit_account_id: account.cash |
1716 | default_credit_account_id: account.cash |
1717 | @@ -53,7 +53,7 @@ |
1718 | name: Bank Journal(USD) |
1719 | code: BUSD |
1720 | type: bank |
1721 | - analytic_journal_id: account.sit |
1722 | + analytic_journal_id: analytic.sit |
1723 | sequence_id: account.sequence_bank_journal |
1724 | default_debit_account_id: account_cash_usd_id2 |
1725 | default_credit_account_id: account_cash_usd_id2 |
1726 | |
1727 | === modified file 'account_voucher/test/case_eur_usd.yml' |
1728 | --- account_voucher/test/case_eur_usd.yml 2013-10-27 12:31:04 +0000 |
1729 | +++ account_voucher/test/case_eur_usd.yml 2014-04-29 11:49:43 +0000 |
1730 | @@ -39,7 +39,7 @@ |
1731 | name: Bank Journal Test(USD) |
1732 | code: BEUSD |
1733 | type: bank |
1734 | - analytic_journal_id: account.sit |
1735 | + analytic_journal_id: analytic.sit |
1736 | sequence_id: account.sequence_bank_journal |
1737 | default_debit_account_id: account_eur_usd_id |
1738 | default_credit_account_id: account_eur_usd_id |
1739 | |
1740 | === modified file 'analytic/__init__.py' |
1741 | --- analytic/__init__.py 2011-01-14 00:11:01 +0000 |
1742 | +++ analytic/__init__.py 2014-04-29 11:49:43 +0000 |
1743 | @@ -19,7 +19,9 @@ |
1744 | # |
1745 | ############################################################################## |
1746 | |
1747 | -import analytic |
1748 | +import models |
1749 | +import report |
1750 | +import wizard |
1751 | |
1752 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1753 | |
1754 | |
1755 | === modified file 'analytic/__openerp__.py' |
1756 | --- analytic/__openerp__.py 2012-12-19 17:32:15 +0000 |
1757 | +++ analytic/__openerp__.py 2014-04-29 11:49:43 +0000 |
1758 | @@ -37,11 +37,27 @@ |
1759 | 'data': [ |
1760 | 'security/analytic_security.xml', |
1761 | 'security/ir.model.access.csv', |
1762 | - 'analytic_sequence.xml', |
1763 | - 'analytic_view.xml', |
1764 | - 'analytic_data.xml', |
1765 | - ], |
1766 | - 'demo': [], |
1767 | + 'data/analytic_sequence.xml', |
1768 | + 'views/analytic_view.xml', |
1769 | + 'data/analytic_data.xml', |
1770 | + 'wizard/project_account_analytic_line_view.xml', |
1771 | + 'analytic_report.xml', |
1772 | + 'wizard/account_analytic_balance_report_view.xml', |
1773 | + 'wizard/account_analytic_cost_ledger_view.xml', |
1774 | + 'wizard/account_analytic_inverted_balance_report.xml', |
1775 | + 'wizard/account_analytic_journal_report_view.xml', |
1776 | + 'wizard/account_analytic_cost_ledger_for_journal_report_view.xml', |
1777 | + 'wizard/account_analytic_chart_view.xml', |
1778 | + 'views/report_analyticbalance.xml', |
1779 | + 'views/report_analyticjournal.xml', |
1780 | + 'views/report_analyticcostledgerquantity.xml', |
1781 | + 'views/report_analyticcostledger.xml', |
1782 | + 'views/report_invertedanalyticbalance.xml', |
1783 | + ], |
1784 | + 'demo': [ |
1785 | + 'data/analytic_demo.xml', |
1786 | + 'data/analytic_account_demo.xml', |
1787 | + ], |
1788 | 'installable': True, |
1789 | 'auto_install': False, |
1790 | } |
1791 | |
1792 | === renamed file 'account/project/project_report.xml' => 'analytic/analytic_report.xml' |
1793 | === added directory 'analytic/data' |
1794 | === renamed file 'account/project/analytic_account_demo.xml' => 'analytic/data/analytic_account_demo.xml' |
1795 | === renamed file 'analytic/analytic_data.xml' => 'analytic/data/analytic_data.xml' |
1796 | === renamed file 'account/project/project_demo.xml' => 'analytic/data/analytic_demo.xml' |
1797 | === renamed file 'analytic/analytic_sequence.xml' => 'analytic/data/analytic_sequence.xml' |
1798 | === added directory 'analytic/models' |
1799 | === added file 'analytic/models/__init__.py' |
1800 | --- analytic/models/__init__.py 1970-01-01 00:00:00 +0000 |
1801 | +++ analytic/models/__init__.py 2014-04-29 11:49:43 +0000 |
1802 | @@ -0,0 +1,3 @@ |
1803 | +# -*- coding: utf-8 -*- |
1804 | + |
1805 | +import analytic |
1806 | \ No newline at end of file |
1807 | |
1808 | === renamed file 'analytic/analytic.py' => 'analytic/models/analytic.py' |
1809 | --- analytic/analytic.py 2014-04-01 12:36:57 +0000 |
1810 | +++ analytic/models/analytic.py 2014-04-29 11:49:43 +0000 |
1811 | @@ -321,7 +321,7 @@ |
1812 | 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='restrict', select=True, domain=[('type','<>','view')]), |
1813 | 'user_id': fields.many2one('res.users', 'User'), |
1814 | 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), |
1815 | - |
1816 | + 'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True), |
1817 | } |
1818 | |
1819 | def _get_default_date(self, cr, uid, context=None): |
1820 | @@ -349,4 +349,21 @@ |
1821 | (_check_no_view, 'You cannot create analytic line on view account.', ['account_id']), |
1822 | ] |
1823 | |
1824 | +class account_analytic_journal(osv.osv): |
1825 | + _name = 'account.analytic.journal' |
1826 | + _description = 'Analytic Journal' |
1827 | + _columns = { |
1828 | + 'name': fields.char('Journal Name', size=64, required=True), |
1829 | + 'code': fields.char('Journal Code', size=8), |
1830 | + '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."), |
1831 | + 'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."), |
1832 | + 'company_id': fields.many2one('res.company', 'Company', required=True), |
1833 | + 'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'), |
1834 | + } |
1835 | + _defaults = { |
1836 | + 'active': True, |
1837 | + 'type': 'general', |
1838 | + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, |
1839 | + } |
1840 | + |
1841 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1842 | |
1843 | === renamed directory 'account/project/report' => 'analytic/report' |
1844 | === modified file 'analytic/report/__init__.py' |
1845 | --- account/project/report/__init__.py 2011-01-14 00:11:01 +0000 |
1846 | +++ analytic/report/__init__.py 2014-04-29 11:49:43 +0000 |
1847 | @@ -21,9 +21,9 @@ |
1848 | |
1849 | import analytic_journal |
1850 | import analytic_balance |
1851 | -import inverted_analytic_balance |
1852 | -import cost_ledger |
1853 | -import quantity_cost_ledger |
1854 | +import analytic_inverted_balance |
1855 | +import analytic_cost_ledger |
1856 | +import analytic_quantity_cost_ledger |
1857 | |
1858 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1859 | |
1860 | |
1861 | === modified file 'analytic/report/analytic_balance.py' |
1862 | --- account/project/report/analytic_balance.py 2014-04-02 16:40:53 +0000 |
1863 | +++ analytic/report/analytic_balance.py 2014-04-29 11:49:43 +0000 |
1864 | @@ -151,7 +151,7 @@ |
1865 | class report_analyticbalance(osv.AbstractModel): |
1866 | _name = 'report.account.report_analyticbalance' |
1867 | _inherit = 'report.abstract_report' |
1868 | - _template = 'account.report_analyticbalance' |
1869 | + _template = 'analytic.report_analyticbalance' |
1870 | _wrapped_report_class = account_analytic_balance |
1871 | |
1872 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1873 | |
1874 | === added file 'analytic/report/analytic_cost_ledger.py' |
1875 | --- analytic/report/analytic_cost_ledger.py 1970-01-01 00:00:00 +0000 |
1876 | +++ analytic/report/analytic_cost_ledger.py 2014-04-29 11:49:43 +0000 |
1877 | @@ -0,0 +1,111 @@ |
1878 | +# -*- coding: utf-8 -*- |
1879 | +############################################################################## |
1880 | +# |
1881 | +# OpenERP, Open Source Management Solution |
1882 | +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
1883 | +# |
1884 | +# This program is free software: you can redistribute it and/or modify |
1885 | +# it under the terms of the GNU Affero General Public License as |
1886 | +# published by the Free Software Foundation, either version 3 of the |
1887 | +# License, or (at your option) any later version. |
1888 | +# |
1889 | +# This program is distributed in the hope that it will be useful, |
1890 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1891 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1892 | +# GNU Affero General Public License for more details. |
1893 | +# |
1894 | +# You should have received a copy of the GNU Affero General Public License |
1895 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1896 | +# |
1897 | +############################################################################## |
1898 | + |
1899 | +import time |
1900 | +from openerp.osv import osv |
1901 | +from openerp.report import report_sxw |
1902 | + |
1903 | + |
1904 | +class account_analytic_cost_ledger(report_sxw.rml_parse): |
1905 | + def __init__(self, cr, uid, name, context): |
1906 | + super(account_analytic_cost_ledger, self).__init__(cr, uid, name, context=context) |
1907 | + self.localcontext.update( { |
1908 | + 'time': time, |
1909 | + 'lines_g': self._lines_g, |
1910 | + 'lines_a': self._lines_a, |
1911 | + 'account_sum_debit': self._account_sum_debit, |
1912 | + 'account_sum_credit': self._account_sum_credit, |
1913 | + 'account_sum_balance': self._account_sum_balance, |
1914 | + 'sum_debit': self._sum_debit, |
1915 | + 'sum_credit': self._sum_credit, |
1916 | + 'sum_balance': self._sum_balance, |
1917 | + }) |
1918 | + self.children = {} # a memo for the method _get_children |
1919 | + |
1920 | + def _get_children(self, accounts): |
1921 | + """ return all children accounts of the given accounts |
1922 | + :param accounts: list of browse records of 'account.analytic.account' |
1923 | + :return: tuple of account ids |
1924 | + """ |
1925 | + analytic_obj = self.pool.get('account.analytic.account') |
1926 | + res = set() |
1927 | + for account in accounts: |
1928 | + if account.id not in self.children: |
1929 | + self.children[account.id] = analytic_obj.search(self.cr, self.uid, [('parent_id', 'child_of', [account.id])]) |
1930 | + res.update(self.children[account.id]) |
1931 | + return tuple(res) |
1932 | + |
1933 | + def _lines_g(self, account, date1, date2): |
1934 | + self.cr.execute("SELECT sum(aal.amount) AS balance, aa.code AS code, aa.name AS name, aa.id AS id \ |
1935 | + FROM account_account AS aa, account_analytic_line AS aal \ |
1936 | + WHERE (aal.account_id IN %s) AND (aal.date>=%s) AND (aal.date<=%s) AND (aal.general_account_id=aa.id) AND aa.active \ |
1937 | + GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code", (self._get_children([account]), date1, date2)) |
1938 | + res = self.cr.dictfetchall() |
1939 | + for r in res: |
1940 | + r['debit'] = r['balance'] if r['balance'] > 0 else 0.0 |
1941 | + r['credit'] = -r['balance'] if r['balance'] < 0 else 0.0 |
1942 | + return res |
1943 | + |
1944 | + def _lines_a(self, general_account, account, date1, date2): |
1945 | + self.cr.execute("SELECT aal.name AS name, aal.code AS code, aal.amount AS balance, aal.date AS date, aaj.code AS cj FROM account_analytic_line AS aal, account_analytic_journal AS aaj \ |
1946 | + WHERE (aal.general_account_id=%s) AND (aal.account_id IN %s) AND (aal.date>=%s) AND (aal.date<=%s) \ |
1947 | + AND (aal.journal_id=aaj.id) \ |
1948 | + ORDER BY aal.date, aaj.code, aal.code", (general_account['id'], self._get_children([account]), date1, date2)) |
1949 | + res = self.cr.dictfetchall() |
1950 | + for r in res: |
1951 | + r['debit'] = r['balance'] if r['balance'] > 0 else 0.0 |
1952 | + r['credit'] = -r['balance'] if r['balance'] < 0 else 0.0 |
1953 | + return res |
1954 | + |
1955 | + def _account_sum_debit(self, account, date1, date2): |
1956 | + return self._sum_debit([account], date1, date2) |
1957 | + |
1958 | + def _account_sum_credit(self, account, date1, date2): |
1959 | + return self._sum_credit([account], date1, date2) |
1960 | + |
1961 | + def _account_sum_balance(self, account, date1, date2): |
1962 | + debit = self._account_sum_debit(account, date1, date2) |
1963 | + credit = self._account_sum_credit(account, date1, date2) |
1964 | + return (debit-credit) |
1965 | + |
1966 | + def _sum_debit(self, accounts, date1, date2): |
1967 | + self.cr.execute("SELECT sum(amount) FROM account_analytic_line WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0", |
1968 | + (self._get_children(accounts), date1, date2,)) |
1969 | + return self.cr.fetchone()[0] or 0.0 |
1970 | + |
1971 | + def _sum_credit(self, accounts, date1, date2): |
1972 | + self.cr.execute("SELECT -sum(amount) FROM account_analytic_line WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0", |
1973 | + (self._get_children(accounts), date1, date2,)) |
1974 | + return self.cr.fetchone()[0] or 0.0 |
1975 | + |
1976 | + def _sum_balance(self, accounts, date1, date2): |
1977 | + debit = self._sum_debit(accounts, date1, date2) |
1978 | + credit = self._sum_credit(accounts, date1, date2) |
1979 | + return (debit-credit) |
1980 | + |
1981 | + |
1982 | +class report_analyticcostledger(osv.AbstractModel): |
1983 | + _name = 'report.account.report_analyticcostledger' |
1984 | + _inherit = 'report.abstract_report' |
1985 | + _template = 'analytic.report_analyticcostledger' |
1986 | + _wrapped_report_class = account_analytic_cost_ledger |
1987 | + |
1988 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1989 | |
1990 | === added file 'analytic/report/analytic_inverted_balance.py' |
1991 | --- analytic/report/analytic_inverted_balance.py 1970-01-01 00:00:00 +0000 |
1992 | +++ analytic/report/analytic_inverted_balance.py 2014-04-29 11:49:43 +0000 |
1993 | @@ -0,0 +1,130 @@ |
1994 | +# -*- coding: utf-8 -*- |
1995 | +############################################################################## |
1996 | +# |
1997 | +# OpenERP, Open Source Management Solution |
1998 | +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
1999 | +# |
2000 | +# This program is free software: you can redistribute it and/or modify |
2001 | +# it under the terms of the GNU Affero General Public License as |
2002 | +# published by the Free Software Foundation, either version 3 of the |
2003 | +# License, or (at your option) any later version. |
2004 | +# |
2005 | +# This program is distributed in the hope that it will be useful, |
2006 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2007 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2008 | +# GNU Affero General Public License for more details. |
2009 | +# |
2010 | +# You should have received a copy of the GNU Affero General Public License |
2011 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2012 | +# |
2013 | +############################################################################## |
2014 | + |
2015 | +import time |
2016 | +from openerp.osv import osv |
2017 | +from openerp.report import report_sxw |
2018 | + |
2019 | +class account_inverted_analytic_balance(report_sxw.rml_parse): |
2020 | + def __init__(self, cr, uid, name, context): |
2021 | + super(account_inverted_analytic_balance, self).__init__(cr, uid, name, context=context) |
2022 | + self.localcontext.update( { |
2023 | + 'time': time, |
2024 | + 'lines_g': self._lines_g, |
2025 | + 'lines_a': self._lines_a, |
2026 | + 'sum_debit': self._sum_debit, |
2027 | + 'sum_credit': self._sum_credit, |
2028 | + 'sum_balance': self._sum_balance, |
2029 | + 'sum_quantity': self._sum_quantity, |
2030 | + }) |
2031 | + |
2032 | + def _lines_g(self, accounts, date1, date2): |
2033 | + ids = map(lambda x: x.id, accounts) |
2034 | + self.cr.execute("SELECT aa.name AS name, aa.code AS code, " |
2035 | + "sum(aal.amount) AS balance, " |
2036 | + "sum(aal.unit_amount) AS quantity, aa.id AS id \ |
2037 | + FROM account_analytic_line AS aal, account_account AS aa \ |
2038 | + WHERE (aal.general_account_id=aa.id) " |
2039 | + "AND (aal.account_id IN %s) " |
2040 | + "AND (date>=%s) AND (date<=%s) AND aa.active \ |
2041 | + GROUP BY aal.general_account_id, aa.name, aa.code, aal.code, aa.id " |
2042 | + "ORDER BY aal.code", |
2043 | + (tuple(ids), date1, date2)) |
2044 | + res = self.cr.dictfetchall() |
2045 | + for r in res: |
2046 | + if r['balance'] > 0: |
2047 | + r['debit'] = r['balance'] |
2048 | + r['credit'] = 0.0 |
2049 | + elif r['balance'] < 0: |
2050 | + r['debit'] = 0.0 |
2051 | + r['credit'] = -r['balance'] |
2052 | + else: |
2053 | + r['debit'] = 0.0 |
2054 | + r['credit'] = 0.0 |
2055 | + return res |
2056 | + |
2057 | + def _lines_a(self, accounts, general_account_id, date1, date2): |
2058 | + ids = map(lambda x: x.id, accounts) |
2059 | + self.cr.execute("SELECT sum(aal.amount) AS balance, " |
2060 | + "sum(aal.unit_amount) AS quantity, " |
2061 | + "aaa.code AS code, aaa.name AS name, account_id \ |
2062 | + FROM account_analytic_line AS aal, " |
2063 | + "account_analytic_account AS aaa \ |
2064 | + WHERE aal.account_id=aaa.id AND aal.account_id IN %s " |
2065 | + "AND aal.general_account_id=%s AND aal.date>=%s " |
2066 | + "AND aal.date<=%s \ |
2067 | + GROUP BY aal.account_id, general_account_id, aaa.code, aaa.name " |
2068 | + "ORDER BY aal.account_id", |
2069 | + (tuple(ids), general_account_id, date1, date2)) |
2070 | + res = self.cr.dictfetchall() |
2071 | + |
2072 | + aaa_obj = self.pool.get('account.analytic.account') |
2073 | + res2 = aaa_obj.read(self.cr, self.uid, ids, ['complete_name']) |
2074 | + complete_name = {} |
2075 | + for r in res2: |
2076 | + complete_name[r['id']] = r['complete_name'] |
2077 | + for r in res: |
2078 | + r['complete_name'] = complete_name[r['account_id']] |
2079 | + if r['balance'] > 0: |
2080 | + r['debit'] = r['balance'] |
2081 | + r['credit'] = 0.0 |
2082 | + elif r['balance'] < 0: |
2083 | + r['debit'] = 0.0 |
2084 | + r['credit'] = -r['balance'] |
2085 | + else: |
2086 | + r['debit'] = 0.0 |
2087 | + r['credit'] = 0.0 |
2088 | + return res |
2089 | + |
2090 | + def _sum_debit(self, accounts, date1, date2): |
2091 | + ids = map(lambda x: x.id, accounts) |
2092 | + self.cr.execute("SELECT sum(amount) \ |
2093 | + FROM account_analytic_line \ |
2094 | + WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0", (tuple(ids),date1, date2,)) |
2095 | + return self.cr.fetchone()[0] or 0.0 |
2096 | + |
2097 | + def _sum_credit(self, accounts, date1, date2): |
2098 | + ids = map(lambda x: x.id, accounts) |
2099 | + self.cr.execute("SELECT -sum(amount) \ |
2100 | + FROM account_analytic_line \ |
2101 | + WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0", (tuple(ids),date1, date2,)) |
2102 | + return self.cr.fetchone()[0] or 0.0 |
2103 | + |
2104 | + def _sum_balance(self, accounts, date1, date2): |
2105 | + debit = self._sum_debit(accounts, date1, date2) |
2106 | + credit = self._sum_credit(accounts, date1, date2) |
2107 | + return (debit-credit) |
2108 | + |
2109 | + def _sum_quantity(self, accounts, date1, date2): |
2110 | + ids = map(lambda x: x.id, accounts) |
2111 | + self.cr.execute("SELECT sum(unit_amount) \ |
2112 | + FROM account_analytic_line \ |
2113 | + WHERE account_id IN %s AND date>=%s AND date<=%s", (tuple(ids),date1, date2,)) |
2114 | + return self.cr.fetchone()[0] or 0.0 |
2115 | + |
2116 | + |
2117 | +class report_invertedanalyticbalance(osv.AbstractModel): |
2118 | + _name = 'report.account.report_invertedanalyticbalance' |
2119 | + _inherit = 'report.abstract_report' |
2120 | + _template = 'analytic.report_invertedanalyticbalance' |
2121 | + _wrapped_report_class = account_inverted_analytic_balance |
2122 | + |
2123 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2124 | |
2125 | === modified file 'analytic/report/analytic_journal.py' |
2126 | --- account/project/report/analytic_journal.py 2014-04-02 16:40:53 +0000 |
2127 | +++ analytic/report/analytic_journal.py 2014-04-29 11:49:43 +0000 |
2128 | @@ -62,7 +62,7 @@ |
2129 | class report_analyticjournal(osv.AbstractModel): |
2130 | _name = 'report.account.report_analyticjournal' |
2131 | _inherit = 'report.abstract_report' |
2132 | - _template = 'account.report_analyticjournal' |
2133 | + _template = 'analytic.report_analyticjournal' |
2134 | _wrapped_report_class = account_analytic_journal |
2135 | |
2136 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2137 | |
2138 | === added file 'analytic/report/analytic_quantity_cost_ledger.py' |
2139 | --- analytic/report/analytic_quantity_cost_ledger.py 1970-01-01 00:00:00 +0000 |
2140 | +++ analytic/report/analytic_quantity_cost_ledger.py 2014-04-29 11:49:43 +0000 |
2141 | @@ -0,0 +1,127 @@ |
2142 | +# -*- coding: utf-8 -*- |
2143 | +############################################################################## |
2144 | +# |
2145 | +# OpenERP, Open Source Management Solution |
2146 | +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
2147 | +# |
2148 | +# This program is free software: you can redistribute it and/or modify |
2149 | +# it under the terms of the GNU Affero General Public License as |
2150 | +# published by the Free Software Foundation, either version 3 of the |
2151 | +# License, or (at your option) any later version. |
2152 | +# |
2153 | +# This program is distributed in the hope that it will be useful, |
2154 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2155 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2156 | +# GNU Affero General Public License for more details. |
2157 | +# |
2158 | +# You should have received a copy of the GNU Affero General Public License |
2159 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2160 | +# |
2161 | +############################################################################## |
2162 | +import time |
2163 | +from openerp.osv import osv |
2164 | +from openerp.report import report_sxw |
2165 | + |
2166 | + |
2167 | +class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): |
2168 | + def __init__(self, cr, uid, name, context): |
2169 | + super(account_analytic_quantity_cost_ledger, self).__init__(cr, uid, name, context=context) |
2170 | + self.localcontext.update( { |
2171 | + 'time': time, |
2172 | + 'lines_g': self._lines_g, |
2173 | + 'lines_a': self._lines_a, |
2174 | + 'sum_quantity': self._sum_quantity, |
2175 | + 'account_sum_quantity': self._account_sum_quantity, |
2176 | + }) |
2177 | + |
2178 | + def _lines_g(self, account_id, date1, date2, journals): |
2179 | + if not journals: |
2180 | + self.cr.execute("SELECT sum(aal.unit_amount) AS quantity, \ |
2181 | + aa.code AS code, aa.name AS name, aa.id AS id \ |
2182 | + FROM account_account AS aa, account_analytic_line AS aal \ |
2183 | + WHERE (aal.account_id=%s) AND (aal.date>=%s) \ |
2184 | + AND (aal.date<=%s) AND (aal.general_account_id=aa.id) \ |
2185 | + AND aa.active \ |
2186 | + GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code", |
2187 | + (account_id, date1, date2)) |
2188 | + else: |
2189 | + journal_ids = journals |
2190 | + self.cr.execute("SELECT sum(aal.unit_amount) AS quantity, \ |
2191 | + aa.code AS code, aa.name AS name, aa.id AS id \ |
2192 | + FROM account_account AS aa, account_analytic_line AS aal \ |
2193 | + WHERE (aal.account_id=%s) AND (aal.date>=%s) \ |
2194 | + AND (aal.date<=%s) AND (aal.general_account_id=aa.id) \ |
2195 | + AND aa.active \ |
2196 | + AND (aal.journal_id IN %s ) \ |
2197 | + GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code", |
2198 | + (account_id, date1, date2, tuple(journal_ids))) |
2199 | + res = self.cr.dictfetchall() |
2200 | + return res |
2201 | + |
2202 | + def _lines_a(self, general_account_id, account_id, date1, date2, journals): |
2203 | + if not journals: |
2204 | + self.cr.execute("SELECT aal.name AS name, aal.code AS code, \ |
2205 | + aal.unit_amount AS quantity, aal.date AS date, \ |
2206 | + aaj.code AS cj \ |
2207 | + FROM account_analytic_line AS aal, \ |
2208 | + account_analytic_journal AS aaj \ |
2209 | + WHERE (aal.general_account_id=%s) AND (aal.account_id=%s) \ |
2210 | + AND (aal.date>=%s) AND (aal.date<=%s) \ |
2211 | + AND (aal.journal_id=aaj.id) \ |
2212 | + ORDER BY aal.date, aaj.code, aal.code", |
2213 | + (general_account_id, account_id, date1, date2)) |
2214 | + else: |
2215 | + journal_ids = journals |
2216 | + self.cr.execute("SELECT aal.name AS name, aal.code AS code, \ |
2217 | + aal.unit_amount AS quantity, aal.date AS date, \ |
2218 | + aaj.code AS cj \ |
2219 | + FROM account_analytic_line AS aal, \ |
2220 | + account_analytic_journal AS aaj \ |
2221 | + WHERE (aal.general_account_id=%s) AND (aal.account_id=%s) \ |
2222 | + AND (aal.date>=%s) AND (aal.date<=%s) \ |
2223 | + AND (aal.journal_id=aaj.id) AND (aaj.id IN %s) \ |
2224 | + ORDER BY aal.date, aaj.code, aal.code", |
2225 | + (general_account_id, account_id, date1, date2,tuple(journal_ids))) |
2226 | + res = self.cr.dictfetchall() |
2227 | + return res |
2228 | + |
2229 | + def _account_sum_quantity(self, account_id, date1, date2, journals): |
2230 | + if not journals: |
2231 | + self.cr.execute("SELECT sum(unit_amount) \ |
2232 | + FROM account_analytic_line \ |
2233 | + WHERE account_id=%s AND date>=%s AND date<=%s", |
2234 | + (account_id, date1, date2)) |
2235 | + else: |
2236 | + journal_ids = journals |
2237 | + self.cr.execute("SELECT sum(unit_amount) \ |
2238 | + FROM account_analytic_line \ |
2239 | + WHERE account_id = %s AND date >= %s AND date <= %s \ |
2240 | + AND journal_id IN %s", |
2241 | + (account_id, date1, date2, tuple(journal_ids),)) |
2242 | + return self.cr.fetchone()[0] or 0.0 |
2243 | + |
2244 | + def _sum_quantity(self, accounts, date1, date2, journals): |
2245 | + ids = map(lambda x: x.id, accounts) |
2246 | + if not ids: |
2247 | + return 0.0 |
2248 | + if not journals: |
2249 | + self.cr.execute("SELECT sum(unit_amount) \ |
2250 | + FROM account_analytic_line \ |
2251 | + WHERE account_id IN %s AND date>=%s AND date<=%s", |
2252 | + (tuple(ids), date1, date2,)) |
2253 | + else: |
2254 | + journal_ids = journals |
2255 | + self.cr.execute("SELECT sum(unit_amount) \ |
2256 | + FROM account_analytic_line \ |
2257 | + WHERE account_id IN %s AND date >= %s AND date <= %s \ |
2258 | + AND journal_id IN %s",(tuple(ids), date1, date2, tuple(journal_ids))) |
2259 | + return self.cr.fetchone()[0] or 0.0 |
2260 | + |
2261 | + |
2262 | +class report_analyticcostledgerquantity(osv.AbstractModel): |
2263 | + _name = 'report.account.report_analyticcostledgerquantity' |
2264 | + _inherit = 'report.abstract_report' |
2265 | + _template = 'analytic.report_analyticcostledgerquantity' |
2266 | + _wrapped_report_class = account_analytic_quantity_cost_ledger |
2267 | + |
2268 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2269 | |
2270 | === renamed directory 'account/project/views' => 'analytic/views' |
2271 | === renamed file 'analytic/analytic_view.xml' => 'analytic/views/analytic_view.xml' |
2272 | --- analytic/analytic_view.xml 2014-04-01 12:36:57 +0000 |
2273 | +++ analytic/views/analytic_view.xml 2014-04-29 11:49:43 +0000 |
2274 | @@ -62,5 +62,320 @@ |
2275 | </form> |
2276 | </field> |
2277 | </record> |
2278 | + |
2279 | + <record id="view_account_analytic_account_list" model="ir.ui.view"> |
2280 | + <field name="name">account.analytic.account.list</field> |
2281 | + <field name="model">account.analytic.account</field> |
2282 | + <field eval="8" name="priority"/> |
2283 | + <field name="arch" type="xml"> |
2284 | + <tree toolbar="1" colors="red:state=='pending';grey:state in ('cancelled','close');blue:type=='view'" string="Analytic Accounts"> |
2285 | + <field name="complete_name"/> |
2286 | + <field name="partner_id"/> |
2287 | + <field name="code"/> |
2288 | + <field name="date_start"/> |
2289 | + <field name="date"/> |
2290 | + <field name="user_id" invisible="1"/> |
2291 | + <field name="manager_id"/> |
2292 | + <field name="parent_id" invisible="1"/> |
2293 | + <field name="state" invisible="1"/> |
2294 | + <field name="type" invisible="1"/> |
2295 | + <field name="template_id" invisible="1"/> |
2296 | + <field name="company_id" groups="base.group_multi_company"/> |
2297 | + </tree> |
2298 | + </field> |
2299 | + </record> |
2300 | + |
2301 | + <record id="view_account_analytic_account_search" model="ir.ui.view"> |
2302 | + <field name="name">account.analytic.account.search</field> |
2303 | + <field name="model">account.analytic.account</field> |
2304 | + <field name="arch" type="xml"> |
2305 | + <search string="Analytic Account"> |
2306 | + <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Analytic Account"/> |
2307 | + <field name="date"/> |
2308 | + <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
2309 | + <field name="manager_id"/> |
2310 | + <field name="parent_id"/> |
2311 | + <field name="user_id"/> |
2312 | + <filter string="Open" domain="[('state','=','open')]" help="Current Accounts"/> |
2313 | + <filter string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/> |
2314 | + <group expand="0" string="Group By..."> |
2315 | + <filter string="Associated Partner" domain="[]" context="{'group_by':'partner_id'}"/> |
2316 | + <filter string="Type" domain="[]" context="{'group_by':'type'}"/> |
2317 | + <filter string="Template" domain="[]" context="{'group_by':'template_id'}"/> |
2318 | + <filter string="Parent Account" domain="[]" context="{'group_by':'parent_id'}"/> |
2319 | + <filter string="Status" domain="[]" context="{'group_by':'state'}" groups="base.group_no_one"/> |
2320 | + </group> |
2321 | + </search> |
2322 | + </field> |
2323 | + </record> |
2324 | + |
2325 | + <record id="view_account_analytic_account_tree" model="ir.ui.view"> |
2326 | + <field name="name">account.analytic.account.tree</field> |
2327 | + <field name="model">account.analytic.account</field> |
2328 | + <field name="field_parent">child_complete_ids</field> |
2329 | + <field name="arch" type="xml"> |
2330 | + <tree colors="blue:state=='pending';grey:state in ('close','cancelled');blue:type=='view'" string="Analytic account" toolbar="1"> |
2331 | + <field name="name" invisible="1"/> |
2332 | + <field name="complete_name"/> |
2333 | + <field name="code"/> |
2334 | + <field name="debit"/> |
2335 | + <field name="credit"/> |
2336 | + <field name="balance"/> |
2337 | + <field name="state" invisible="1"/> |
2338 | + <field name="currency_id" groups="base.group_multi_currency"/> |
2339 | + <field name="date" invisible="1"/> |
2340 | + <field name="user_id" invisible="1"/> |
2341 | + <field name="partner_id" invisible="1"/> |
2342 | + <field name="parent_id" invisible="1"/> |
2343 | + <field name="type"/> |
2344 | + <field name="company_id" groups="base.group_multi_company"/> |
2345 | + <field name="template_id" invisible="1"/> |
2346 | + </tree> |
2347 | + </field> |
2348 | + </record> |
2349 | + |
2350 | + |
2351 | + <record id="action_account_analytic_account_form" model="ir.actions.act_window"> |
2352 | + <field name="name">Analytic Accounts</field> |
2353 | + <field name="type">ir.actions.act_window</field> |
2354 | + <field name="res_model">account.analytic.account</field> |
2355 | + <field name="context">{}</field> <!-- repair invalid context by setting empty one --> |
2356 | + <field name="view_type">form</field> |
2357 | + <field name="view_mode">tree,form</field> |
2358 | + <field name="view_id" ref="view_account_analytic_account_tree"/> |
2359 | + <field name="search_view_id" ref="analytic.view_account_analytic_account_search"/> |
2360 | + </record> |
2361 | + |
2362 | + <record id="act_account_renew_view" model="ir.actions.act_window"> |
2363 | + <field name="name">Accounts to Renew</field> |
2364 | + <field name="type">ir.actions.act_window</field> |
2365 | + <field name="res_model">account.analytic.account</field> |
2366 | + <field name="view_type">form</field> |
2367 | + <field name="view_mode">tree,form</field> |
2368 | + <field name="domain">[('date','<',time.strftime('%Y-%m-%d %H:%M:%S'))]</field> |
2369 | + <field name="filter" eval="True"/> |
2370 | + </record> |
2371 | + |
2372 | + <record id="action_account_analytic_account_tree2" model="ir.actions.act_window"> |
2373 | + <field name="name">Chart of Analytic Accounts</field> |
2374 | + <field name="res_model">account.analytic.account</field> |
2375 | + <field name="view_type">tree</field> |
2376 | + <field name="view_id" ref="view_account_analytic_account_tree"/> |
2377 | + <field name="domain">[('parent_id','=',False)]</field> |
2378 | + <field name="help" type="html"> |
2379 | + <p> |
2380 | + Click to add a new analytic account. |
2381 | + </p><p> |
2382 | + The normal chart of accounts has a structure defined by the |
2383 | + legal requirement of the country. The analytic chart of |
2384 | + accounts structure should reflect your own business needs in |
2385 | + term of costs/revenues reporting. |
2386 | + </p><p> |
2387 | + They are usually structured by contracts, projects, products or |
2388 | + departements. Most of the OpenERP operations (invoices, |
2389 | + timesheets, expenses, etc) generate analytic entries on the |
2390 | + related account. |
2391 | + </p> |
2392 | + </field> |
2393 | + </record> |
2394 | + |
2395 | + |
2396 | + <record id="view_account_analytic_line_form" model="ir.ui.view"> |
2397 | + <field name="name">account.analytic.line.form</field> |
2398 | + <field name="model">account.analytic.line</field> |
2399 | + <field name="priority">1</field> |
2400 | + <field name="arch" type="xml"> |
2401 | + <form string="Analytic Entry" version="7.0"> |
2402 | + <group> |
2403 | + <group> |
2404 | + <field name="name"/> |
2405 | + <field name="account_id"/> |
2406 | + <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}"/> |
2407 | + </group> |
2408 | + <group> |
2409 | + <field name="date"/> |
2410 | + <field name="company_id" groups="base.group_multi_company"/> |
2411 | + </group> |
2412 | + <group string="Amount"> |
2413 | + <field name="amount"/> |
2414 | + </group> |
2415 | + <group string="Product Information"> |
2416 | + <label for="unit_amount"/> |
2417 | + <div> |
2418 | + <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/> |
2419 | + </div> |
2420 | + </group> |
2421 | + </group> |
2422 | + </form> |
2423 | + </field> |
2424 | + </record> |
2425 | + <record id="view_account_analytic_line_tree" model="ir.ui.view"> |
2426 | + <field name="name">account.analytic.line.tree</field> |
2427 | + <field name="model">account.analytic.line</field> |
2428 | + <field name="arch" type="xml"> |
2429 | + <tree string="Analytic Entries"> |
2430 | + <field name="date"/> |
2431 | + <field name="name"/> |
2432 | + <field name="user_id"/> |
2433 | + <field name="amount" sum="Total" invisible="context.get('to_invoice', False)"/> |
2434 | + <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity"/> |
2435 | + <field domain="[('type','=','normal')]" name="account_id"/> |
2436 | + <field name="company_id" groups="base.group_multi_company"/> |
2437 | + </tree> |
2438 | + </field> |
2439 | + </record> |
2440 | + <record id="view_account_analytic_line_filter" model="ir.ui.view"> |
2441 | + <field name="name">account.analytic.line.select</field> |
2442 | + <field name="model">account.analytic.line</field> |
2443 | + <field name="arch" type="xml"> |
2444 | + <search string="Search Analytic Lines"> |
2445 | + <field name="name" string="Description"/> |
2446 | + <field name="date"/> |
2447 | + <separator/> |
2448 | + <filter string="My Entries" domain="[('user_id','=',uid)]"/> |
2449 | + <field name="account_id" filter_domain="[('account_id','child_of',self)]"/> |
2450 | + <field name="user_id"/> |
2451 | + <group string="Group By..." expand="0"> |
2452 | + <filter string="Analytic Account" context="{'group_by':'account_id'}"/> |
2453 | + <separator/> |
2454 | + <filter string="User" context="{'group_by':'user_id'}"/> |
2455 | + <separator/> |
2456 | + <filter string="Tasks Month" context="{'group_by':'date'}" name="group_date" help="Invoice Tasks by Month"/> |
2457 | + |
2458 | + </group> |
2459 | + </search> |
2460 | + </field> |
2461 | + </record> |
2462 | + <record id="action_account_analytic_line_form" model="ir.actions.act_window"> |
2463 | + <field name="name">Analytic Entries</field> |
2464 | + <field name="type">ir.actions.act_window</field> |
2465 | + <field name="res_model">account.analytic.line</field> |
2466 | + <field name="view_type">form</field> |
2467 | + <field name="context">{"search_default_user_id":uid}</field> |
2468 | + <field name="view_id" ref="view_account_analytic_line_tree"/> |
2469 | + </record> |
2470 | + |
2471 | + <!-- Entries by Line --> |
2472 | + |
2473 | + <record id="action_account_tree1" model="ir.actions.act_window"> |
2474 | + <field name="name">Analytic Items</field> |
2475 | + <field name="res_model">account.analytic.line</field> |
2476 | + <field name="view_type">form</field> |
2477 | + <field name="view_mode">tree,form</field> |
2478 | + <field name="domain">[('account_id','child_of',[active_id])]</field> |
2479 | + <field name="context">{'account_id':active_id}</field> |
2480 | + <field name="search_view_id" ref="view_account_analytic_line_filter"/> |
2481 | + </record> |
2482 | + <record id="ir_open_account_analytic_account" model="ir.values"> |
2483 | + <field eval="'tree_but_open'" name="key2"/> |
2484 | + <field eval="'account.analytic.account'" name="model"/> |
2485 | + <field name="name">Open Account Tree</field> |
2486 | + <field eval="'ir.actions.act_window,%d'%action_account_tree1" name="value"/> |
2487 | + </record> |
2488 | + |
2489 | + <record id="account_analytic_line_extended_form" model="ir.ui.view"> |
2490 | + <field name="name">account.analytic.line.extended_form</field> |
2491 | + <field name="model">account.analytic.line</field> |
2492 | + <field name="arch" type="xml"> |
2493 | + <form string="Project line" version="7.0"> |
2494 | + <group> |
2495 | + <group> |
2496 | + <field name="name"/> |
2497 | + <field name="account_id"/> |
2498 | + </group> |
2499 | + <group> |
2500 | + <field name="date" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/> |
2501 | + <field name="company_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/> |
2502 | + </group> |
2503 | + <group string="Amount"> |
2504 | + <field name="amount"/> |
2505 | + </group> |
2506 | + <group string="Product Information"> |
2507 | + <label for="unit_amount"/> |
2508 | + <div> |
2509 | + <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/> |
2510 | + </div> |
2511 | + </group> |
2512 | + </group> |
2513 | + </form> |
2514 | + </field> |
2515 | + </record> |
2516 | + <record id="action_account_analytic_account_line_extended_form" model="ir.actions.act_window"> |
2517 | + <field name="name">account.analytic.line.extended</field> |
2518 | + <field name="type">ir.actions.act_window</field> |
2519 | + <field name="res_model">account.analytic.line</field> |
2520 | + <field name="view_type">form</field> |
2521 | + <field name="view_id" ref="view_account_analytic_line_form"/> |
2522 | + </record> |
2523 | + |
2524 | + # |
2525 | + # Analytic Journal |
2526 | + # |
2527 | + |
2528 | + <record id="view_account_analytic_journal_tree" model="ir.ui.view"> |
2529 | + <field name="name">account.analytic.journal.tree</field> |
2530 | + <field name="model">account.analytic.journal</field> |
2531 | + <field name="arch" type="xml"> |
2532 | + <tree string="Analytic Journal"> |
2533 | + <field name="code"/> |
2534 | + <field name="name"/> |
2535 | + <field name="type"/> |
2536 | + </tree> |
2537 | + </field> |
2538 | + </record> |
2539 | + |
2540 | + <record id="view_analytic_journal_search" model="ir.ui.view"> |
2541 | + <field name="name">account.analytic.journal.search</field> |
2542 | + <field name="model">account.analytic.journal</field> |
2543 | + <field name="arch" type="xml"> |
2544 | + <search string="Analytic Journals"> |
2545 | + <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Analytic Journal"/> |
2546 | + <field name="type"/> |
2547 | + <group expand="0" string="Group By..."> |
2548 | + <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/> |
2549 | + </group> |
2550 | + </search> |
2551 | + </field> |
2552 | + </record> |
2553 | + |
2554 | + <record id="view_account_analytic_journal_form" model="ir.ui.view"> |
2555 | + <field name="name">account.analytic.journal.form</field> |
2556 | + <field name="model">account.analytic.journal</field> |
2557 | + <field name="arch" type="xml"> |
2558 | + <form string="Analytic Journal" version="7.0"> |
2559 | + <group col="4"> |
2560 | + <field name="name"/> |
2561 | + <field name="code"/> |
2562 | + <field name="type"/> |
2563 | + <field name="active"/> |
2564 | + <field name="company_id" groups="base.group_multi_company"/> |
2565 | + </group> |
2566 | + </form> |
2567 | + </field> |
2568 | + </record> |
2569 | + <record id="action_account_analytic_journal_form" model="ir.actions.act_window"> |
2570 | + <field name="name">Analytic Journals</field> |
2571 | + <field name="res_model">account.analytic.journal</field> |
2572 | + <field name="view_type">form</field> |
2573 | + <field name="view_mode">tree,form</field> |
2574 | + <field name="search_view_id" ref="view_analytic_journal_search" /> |
2575 | + </record> |
2576 | + |
2577 | + # |
2578 | + # Open journal entries |
2579 | + # |
2580 | + |
2581 | + <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window"> |
2582 | + <field name="name">Analytic Journal Items</field> |
2583 | + <field name="res_model">account.analytic.line</field> |
2584 | + <field name="view_type">form</field> |
2585 | + <field name="view_mode">tree,form</field> |
2586 | + </record> |
2587 | + |
2588 | + # |
2589 | + # Reporting |
2590 | + # |
2591 | + |
2592 | + |
2593 | </data> |
2594 | </openerp> |
2595 | |
2596 | === renamed directory 'account/project/wizard' => 'analytic/wizard' |
2597 | === modified file 'analytic/wizard/account_analytic_chart.py' |
2598 | --- account/project/wizard/account_analytic_chart.py 2013-10-27 12:31:04 +0000 |
2599 | +++ analytic/wizard/account_analytic_chart.py 2014-04-29 11:49:43 +0000 |
2600 | @@ -35,7 +35,7 @@ |
2601 | result_context = {} |
2602 | if context is None: |
2603 | context = {} |
2604 | - result = mod_obj.get_object_reference(cr, uid, 'account', 'action_account_analytic_account_tree2') |
2605 | + result = mod_obj.get_object_reference(cr, uid, 'analytic', 'action_account_analytic_account_tree2') |
2606 | id = result and result[1] or False |
2607 | result = act_obj.read(cr, uid, [id], context=context)[0] |
2608 | data = self.read(cr, uid, ids, [])[0] |
2609 | |
2610 | === modified file 'analytic/wizard/account_analytic_chart_view.xml' |
2611 | --- account/project/wizard/account_analytic_chart_view.xml 2014-02-10 05:26:55 +0000 |
2612 | +++ analytic/wizard/account_analytic_chart_view.xml 2014-04-29 11:49:43 +0000 |
2613 | @@ -31,13 +31,5 @@ |
2614 | <field name="target">new</field> |
2615 | </record> |
2616 | |
2617 | - <menuitem |
2618 | - name="Chart of Analytic Accounts" |
2619 | - parent="account.menu_finance_charts" |
2620 | - action="action_account_analytic_chart" |
2621 | - id="menu_action_analytic_account_tree2" |
2622 | - icon="STOCK_INDENT" |
2623 | - groups="analytic.group_analytic_accounting"/> |
2624 | - |
2625 | </data> |
2626 | </openerp> |
2627 | |
2628 | === modified file 'analytic/wizard/account_analytic_journal_report_view.xml' |
2629 | --- account/project/wizard/account_analytic_journal_report_view.xml 2012-11-29 22:26:45 +0000 |
2630 | +++ analytic/wizard/account_analytic_journal_report_view.xml 2014-04-29 11:49:43 +0000 |
2631 | @@ -32,20 +32,13 @@ |
2632 | </record> |
2633 | |
2634 | <record model="ir.values" id="account_analytic_journal_values"> |
2635 | - <field name="model_id" ref="account.model_account_analytic_journal" /> |
2636 | + <field name="model_id" ref="analytic.model_account_analytic_journal" /> |
2637 | <field name="name">Account Analytic Journal</field> |
2638 | <field name="key2">client_print_multi</field> |
2639 | <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_journal'))" /> |
2640 | <field name="key">action</field> |
2641 | <field name="model">account.analytic.journal</field> |
2642 | </record> |
2643 | - |
2644 | - <menuitem groups="analytic.group_analytic_accounting" id="next_id_40" |
2645 | - name="Analytic" parent="account.menu_finance_generic_reporting" |
2646 | - sequence="4"/> |
2647 | - <menuitem groups="analytic.group_analytic_accounting" |
2648 | - action="account.action_account_analytic_journal" |
2649 | - id="account_analytic_journal_print" parent="account.next_id_40"/> |
2650 | |
2651 | </data> |
2652 | </openerp> |
2653 | |
2654 | === modified file 'hr_expense/hr_expense.py' |
2655 | --- hr_expense/hr_expense.py 2014-03-10 14:36:00 +0000 |
2656 | +++ hr_expense/hr_expense.py 2014-04-29 11:49:43 +0000 |
2657 | @@ -141,6 +141,8 @@ |
2658 | |
2659 | def expense_confirm(self, cr, uid, ids, context=None): |
2660 | for expense in self.browse(cr, uid, ids): |
2661 | + if not expense.line_ids: |
2662 | + raise osv.except_osv(_('Error!'),_('You cannot submit an expense that has no expense line to the manager.')) |
2663 | if expense.employee_id and expense.employee_id.parent_id.user_id: |
2664 | self.message_subscribe_users(cr, uid, [expense.id], user_ids=[expense.employee_id.parent_id.user_id.id]) |
2665 | return self.write(cr, uid, ids, {'state': 'confirm', 'date_confirm': time.strftime('%Y-%m-%d')}, context=context) |
2666 | |
2667 | === modified file 'hr_expense/hr_expense_demo.xml' |
2668 | --- hr_expense/hr_expense_demo.xml 2014-01-09 15:45:50 +0000 |
2669 | +++ hr_expense/hr_expense_demo.xml 2014-04-29 11:49:43 +0000 |
2670 | @@ -45,7 +45,7 @@ |
2671 | <record id="expenses_line0" model="hr.expense.line"> |
2672 | <field name="name">Travel Expenses</field> |
2673 | <field name="date_value" eval="time.strftime('%Y-08-10')"/> |
2674 | - <field name="analytic_account" ref="account.analytic_consultancy"/> |
2675 | + <field name="analytic_account" ref="analytic.analytic_consultancy"/> |
2676 | <field name="expense_id" ref="expenses0"/> |
2677 | <field eval="200.0" name="unit_amount"/> |
2678 | <field name="uom_id" ref="product.product_uom_unit"/> |
2679 | @@ -61,7 +61,7 @@ |
2680 | <record id="travel_by_air_sep" model="hr.expense.line"> |
2681 | <field name="name">Travel by Air</field> |
2682 | <field name="date_value" eval="time.strftime('%Y-09-03')"/> |
2683 | - <field name="analytic_account" ref="account.analytic_consultancy"/> |
2684 | + <field name="analytic_account" ref="analytic.analytic_consultancy"/> |
2685 | <field name="product_id" ref="air_ticket"/> |
2686 | <field name="expense_id" ref="sep_expenses"/> |
2687 | <field eval="700.0" name="unit_amount"/> |
2688 | @@ -72,7 +72,7 @@ |
2689 | <record id="hotel_bill_sep" model="hr.expense.line"> |
2690 | <field name="name">Hotel Expenses - Thymbra</field> |
2691 | <field name="date_value" eval="time.strftime('%Y-09-20')"/> |
2692 | - <field name="analytic_account" ref="account.analytic_nebula"/> |
2693 | + <field name="analytic_account" ref="analytic.analytic_nebula"/> |
2694 | <field name="product_id" ref="hotel_rent"/> |
2695 | <field name="expense_id" ref="sep_expenses"/> |
2696 | <field eval="400.0" name="unit_amount"/> |
2697 | @@ -83,7 +83,7 @@ |
2698 | <record id="car_travel_sep" model="hr.expense.line"> |
2699 | <field name="name">Bruxelles - Paris</field> |
2700 | <field name="date_value" eval="time.strftime('%Y-09-15')"/> |
2701 | - <field name="analytic_account" ref="account.analytic_nebula"/> |
2702 | + <field name="analytic_account" ref="analytic.analytic_nebula"/> |
2703 | <field name="product_id" ref="car_travel"/> |
2704 | <field name="expense_id" ref="sep_expenses"/> |
2705 | <field eval="0.30" name="unit_amount"/> |
2706 | |
2707 | === modified file 'hr_expense/hr_expense_view.xml' |
2708 | --- hr_expense/hr_expense_view.xml 2014-04-11 13:18:42 +0000 |
2709 | +++ hr_expense/hr_expense_view.xml 2014-04-29 11:49:43 +0000 |
2710 | @@ -66,8 +66,8 @@ |
2711 | <button name="validate" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/> |
2712 | <button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" /> |
2713 | <button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" groups="base.group_hr_user" /> |
2714 | - <button name="done" states="accepted" string="Generate Accounting Entries" type="workflow" groups="account.group_account_invoice" class="oe_highlight"/> |
2715 | - <button name="action_view_move" states="done" string="Open Accounting Entries" type="object" groups="account.group_account_invoice"/> |
2716 | + <button name="done" states="accepted" string="Generate Accounting Entries" type="workflow" groups="account.group_account_invoice,account.group_account_user" class="oe_highlight"/> |
2717 | + <button name="action_view_move" states="done" string="Open Accounting Entries" type="object" groups="account.group_account_invoice,account.group_account_user"/> |
2718 | <field name="state" widget="statusbar" statusbar_visible="draft,confirm,accepted,done,paid" statusbar_colors='{"confirm":"blue","cancelled":"red"}'/> |
2719 | </header> |
2720 | <sheet> |
2721 | |
2722 | === modified file 'hr_expense/hr_expense_workflow.xml' |
2723 | --- hr_expense/hr_expense_workflow.xml 2013-10-27 12:31:04 +0000 |
2724 | +++ hr_expense/hr_expense_workflow.xml 2014-04-29 11:49:43 +0000 |
2725 | @@ -84,7 +84,6 @@ |
2726 | <field name="act_from" ref="act_accepted"/> |
2727 | <field name="act_to" ref="act_done"/> |
2728 | <field name="signal">done</field> |
2729 | - <field name="group_id" ref="base.group_hr_user"/> |
2730 | </record> |
2731 | |
2732 | <record id="t10" model="workflow.transition"> |
2733 | |
2734 | === modified file 'hr_timesheet/hr_timesheet_demo.xml' |
2735 | --- hr_timesheet/hr_timesheet_demo.xml 2013-10-27 12:31:04 +0000 |
2736 | +++ hr_timesheet/hr_timesheet_demo.xml 2014-04-29 11:49:43 +0000 |
2737 | @@ -12,16 +12,16 @@ |
2738 | <field name="product_id" ref="product.product_product_consultant"/> |
2739 | <field name="journal_id" ref="analytic_journal"/> |
2740 | </record> |
2741 | - <record id="account.analytic_administratif" model="account.analytic.account"> |
2742 | - <field name="use_timesheets">True</field> |
2743 | - </record> |
2744 | - <record id="account.analytic_partners" model="account.analytic.account"> |
2745 | - <field name="use_timesheets">True</field> |
2746 | - </record> |
2747 | - <record id="account.analytic_consultancy" model="account.analytic.account"> |
2748 | - <field name="use_timesheets">True</field> |
2749 | - </record> |
2750 | - <record id="account.analytic_super_product_trainings" model="account.analytic.account"> |
2751 | + <record id="analytic.analytic_administratif" model="account.analytic.account"> |
2752 | + <field name="use_timesheets">True</field> |
2753 | + </record> |
2754 | + <record id="analytic.analytic_partners" model="account.analytic.account"> |
2755 | + <field name="use_timesheets">True</field> |
2756 | + </record> |
2757 | + <record id="analytic.analytic_consultancy" model="account.analytic.account"> |
2758 | + <field name="use_timesheets">True</field> |
2759 | + </record> |
2760 | + <record id="analytic.analytic_super_product_trainings" model="account.analytic.account"> |
2761 | <field name="use_timesheets">True</field> |
2762 | </record> |
2763 | |
2764 | @@ -32,7 +32,7 @@ |
2765 | <field eval="2.00" name="unit_amount"/> |
2766 | <field name="product_id" ref="product.product_product_consultant"/> |
2767 | <field name="product_uom_id" ref="product.product_uom_hour"/> |
2768 | - <field name="account_id" ref="account.analytic_administratif"></field> |
2769 | + <field name="account_id" ref="analytic.analytic_administratif"></field> |
2770 | <field eval="-60.00" name="amount"/> |
2771 | <field name="general_account_id" ref="account.a_expense"/> |
2772 | <field name="journal_id" ref="analytic_journal"/> |
2773 | @@ -45,7 +45,7 @@ |
2774 | <field eval="1.00" name="unit_amount"/> |
2775 | <field name="product_id" ref="product.product_product_consultant"/> |
2776 | <field name="product_uom_id" ref="product.product_uom_hour"/> |
2777 | - <field name="account_id" ref="account.analytic_administratif"></field> |
2778 | + <field name="account_id" ref="analytic.analytic_administratif"></field> |
2779 | <field eval="-30.00" name="amount"/> |
2780 | <field name="general_account_id" ref="account.a_expense"/> |
2781 | <field name="journal_id" ref="analytic_journal"/> |
2782 | @@ -58,7 +58,7 @@ |
2783 | <field eval="03.00" name="unit_amount"/> |
2784 | <field name="product_id" ref="product.product_product_consultant"/> |
2785 | <field name="product_uom_id" ref="product.product_uom_hour"/> |
2786 | - <field name="account_id" ref="account.analytic_administratif"></field> |
2787 | + <field name="account_id" ref="analytic.analytic_administratif"></field> |
2788 | <field eval="-90.00" name="amount"/> |
2789 | <field name="general_account_id" ref="account.a_expense"/> |
2790 | <field name="journal_id" ref="analytic_journal"/> |
2791 | @@ -71,7 +71,7 @@ |
2792 | <field eval="01.00" name="unit_amount"/> |
2793 | <field name="product_id" ref="product.product_product_consultant"/> |
2794 | <field name="product_uom_id" ref="product.product_uom_hour"/> |
2795 | - <field name="account_id" ref="account.analytic_administratif"></field> |
2796 | + <field name="account_id" ref="analytic.analytic_administratif"></field> |
2797 | <field eval="-30.00" name="amount"/> |
2798 | <field name="general_account_id" ref="account.a_expense"/> |
2799 | <field name="journal_id" ref="analytic_journal"/> |
2800 | @@ -84,7 +84,7 @@ |
2801 | <field eval="01.00" name="unit_amount"/> |
2802 | <field name="product_id" ref="product.product_product_consultant"/> |
2803 | <field name="product_uom_id" ref="product.product_uom_hour"/> |
2804 | - <field name="account_id" ref="account.analytic_administratif"></field> |
2805 | + <field name="account_id" ref="analytic.analytic_administratif"></field> |
2806 | <field eval="-30.00" name="amount"/> |
2807 | <field name="general_account_id" ref="account.a_expense"/> |
2808 | <field name="journal_id" ref="analytic_journal"/> |
2809 | |
2810 | === modified file 'hr_timesheet/test/hr_timesheet_demo.yml' |
2811 | --- hr_timesheet/test/hr_timesheet_demo.yml 2013-10-27 12:31:04 +0000 |
2812 | +++ hr_timesheet/test/hr_timesheet_demo.yml 2014-04-29 11:49:43 +0000 |
2813 | @@ -7,5 +7,5 @@ |
2814 | !record {model: hr.analytic.timesheet, id: working_hours_coding, view: False}: |
2815 | user_id: base.user_demo |
2816 | date: !eval time.strftime('%Y-%m-%d') |
2817 | - account_id: account.analytic_administratif |
2818 | + account_id: analytic.analytic_administratif |
2819 | unit_amount: 1.0 |
2820 | |
2821 | === modified file 'hr_timesheet/test/test_hr_timesheet.yml' |
2822 | --- hr_timesheet/test/test_hr_timesheet.yml 2013-10-27 12:31:04 +0000 |
2823 | +++ hr_timesheet/test/test_hr_timesheet.yml 2014-04-29 11:49:43 +0000 |
2824 | @@ -42,7 +42,7 @@ |
2825 | import time |
2826 | from datetime import datetime, date, timedelta |
2827 | uid = ref('base.user_demo') |
2828 | - new_id = self.create(cr, uid, {'account_id': ref('account.analytic_nebula'),'analytic_amount': 7.0, |
2829 | + new_id = self.create(cr, uid, {'account_id': ref('analytic.analytic_nebula'),'analytic_amount': 7.0, |
2830 | 'date': (datetime.now()+timedelta(1)).strftime('%Y-%m-%d %H:%M:%S') , |
2831 | 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module', |
2832 | 'name': 'Gilles Gravie', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'present'}) |
2833 | @@ -55,7 +55,7 @@ |
2834 | import time |
2835 | from datetime import datetime, date, timedelta |
2836 | uid = ref('base.user_demo') |
2837 | - new_id = self.create(cr, uid, {'account_id': ref('account.analytic_spark'), 'analytic_amount': 7.0, |
2838 | + new_id = self.create(cr, uid, {'account_id': ref('analytic.analytic_spark'), 'analytic_amount': 7.0, |
2839 | 'date': (datetime.now()+timedelta(2)).strftime('%Y-%m-%d %H:%M:%S'), |
2840 | 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'), 'info': 'Create Yaml for hr module', |
2841 | 'name': 'Gilles Gravie', 'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'absent'}) |
2842 | |
2843 | === modified file 'hr_timesheet_invoice/hr_timesheet_invoice_demo.xml' |
2844 | --- hr_timesheet_invoice/hr_timesheet_invoice_demo.xml 2012-12-08 13:21:56 +0000 |
2845 | +++ hr_timesheet_invoice/hr_timesheet_invoice_demo.xml 2014-04-29 11:49:43 +0000 |
2846 | @@ -11,13 +11,13 @@ |
2847 | <field name="customer_name">Offered developments</field> |
2848 | <field name="factor">100.0</field> |
2849 | </record> |
2850 | - <record id="account.analytic_spark" model="account.analytic.account"> |
2851 | - <field name="to_invoice" ref="timesheet_invoice_factor1"/> |
2852 | - </record> |
2853 | - <record id="account.analytic_nebula" model="account.analytic.account"> |
2854 | - <field name="to_invoice" ref="timesheet_invoice_factor1"/> |
2855 | - </record> |
2856 | - <record id="account.analytic_partners_camp_to_camp" model="account.analytic.account"> |
2857 | + <record id="analytic.analytic_spark" model="account.analytic.account"> |
2858 | + <field name="to_invoice" ref="timesheet_invoice_factor1"/> |
2859 | + </record> |
2860 | + <record id="analytic.analytic_nebula" model="account.analytic.account"> |
2861 | + <field name="to_invoice" ref="timesheet_invoice_factor1"/> |
2862 | + </record> |
2863 | + <record id="analytic.analytic_partners_camp_to_camp" model="account.analytic.account"> |
2864 | <field name="to_invoice" ref="timesheet_invoice_factor1"/> |
2865 | </record> |
2866 | </data> |
2867 | |
2868 | === modified file 'hr_timesheet_invoice/hr_timesheet_invoice_view.xml' |
2869 | --- hr_timesheet_invoice/hr_timesheet_invoice_view.xml 2014-02-05 16:03:47 +0000 |
2870 | +++ hr_timesheet_invoice/hr_timesheet_invoice_view.xml 2014-04-29 11:49:43 +0000 |
2871 | @@ -80,9 +80,9 @@ |
2872 | <record id="view_account_analytic_line_search_inherit" model="ir.ui.view"> |
2873 | <field name="name">account.analytic.line.search.to_invoice</field> |
2874 | <field name="model">account.analytic.line</field> |
2875 | - <field name="inherit_id" ref="account.view_account_analytic_line_filter"/> |
2876 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_filter"/> |
2877 | <field name="arch" type="xml"> |
2878 | - <xpath expr="//filter[@name='others']" position="after"> |
2879 | + <xpath expr="//field[@name='date']" position="after"> |
2880 | <separator/> |
2881 | <filter name="to_invoice" string="To Invoice" context="{'to_invoice': 1}" domain="[('invoice_id','=',False), ('to_invoice','<>',False)]" icon="terp-dolar"/> |
2882 | <filter name="invoiced" string="Invoiced" domain="[('invoice_id','!=',False), ('to_invoice','<>',False)]" icon="terp-dolar"/> |
2883 | @@ -107,7 +107,7 @@ |
2884 | <record id="view_account_analytic_line_tree_inherit" model="ir.ui.view"> |
2885 | <field name="name">account.analytic.line.tree.to_invoice</field> |
2886 | <field name="model">account.analytic.line</field> |
2887 | - <field name="inherit_id" ref="account.view_account_analytic_line_tree"/> |
2888 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_tree"/> |
2889 | <field name="arch" type="xml"> |
2890 | <field name="account_id" position="after"> |
2891 | <field name="to_invoice"/> |
2892 | @@ -117,7 +117,7 @@ |
2893 | <record id="view_account_analytic_line_form_inherit" model="ir.ui.view"> |
2894 | <field name="name">account.analytic.line.form.to_invoice</field> |
2895 | <field name="model">account.analytic.line</field> |
2896 | - <field name="inherit_id" ref="account.view_account_analytic_line_form"/> |
2897 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_form"/> |
2898 | <field name="arch" type="xml"> |
2899 | <field name="amount" position="before"> |
2900 | <field name="to_invoice"/> |
2901 | |
2902 | === modified file 'hr_timesheet_invoice/report/hr_timesheet_invoice_report.py' |
2903 | --- hr_timesheet_invoice/report/hr_timesheet_invoice_report.py 2013-10-27 12:31:04 +0000 |
2904 | +++ hr_timesheet_invoice/report/hr_timesheet_invoice_report.py 2014-04-29 11:49:43 +0000 |
2905 | @@ -35,7 +35,7 @@ |
2906 | 'cost': fields.float('Cost', readonly=True), |
2907 | 'product_id': fields.many2one('product.product', 'Product',readonly=True), |
2908 | 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True), |
2909 | - 'general_account_id': fields.many2one('account.account', 'General Account', readonly=True), |
2910 | + 'general_account_id': fields.many2one('account.account', 'Financial Account', readonly=True), |
2911 | 'invoice_id': fields.many2one('account.invoice', 'Invoiced', readonly=True), |
2912 | 'month': fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), |
2913 | ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True), |
2914 | |
2915 | === modified file 'hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml' |
2916 | --- hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml 2013-10-27 12:31:04 +0000 |
2917 | +++ hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml 2014-04-29 11:49:43 +0000 |
2918 | @@ -4,7 +4,7 @@ |
2919 | I create an account analytic line. |
2920 | - |
2921 | !record {model: account.analytic.line, id: account_analytic_line_developyamlforhrmodule0 }: |
2922 | - account_id: account.analytic_agrolait |
2923 | + account_id: analytic.analytic_agrolait |
2924 | amount: -1.0 |
2925 | general_account_id: account.a_expense |
2926 | journal_id: hr_timesheet.analytic_journal |
2927 | @@ -16,20 +16,20 @@ |
2928 | - |
2929 | Assign partner name and price list in analytic account. |
2930 | - |
2931 | - !record {model: account.analytic.account, id: account.analytic_agrolait}: |
2932 | + !record {model: account.analytic.account, id: analytic.analytic_agrolait}: |
2933 | partner_id: base.res_partner_2 |
2934 | pricelist_id: product.list0 |
2935 | - |
2936 | I open this account and make the state as pending. |
2937 | - |
2938 | !python {model: account.analytic.account}: | |
2939 | - self.set_open(cr, uid, [ref('account.analytic_agrolait')], None) |
2940 | - self.set_pending(cr, uid, [ref('account.analytic_agrolait')], None) |
2941 | + self.set_open(cr, uid, [ref('analytic.analytic_agrolait')], None) |
2942 | + self.set_pending(cr, uid, [ref('analytic.analytic_agrolait')], None) |
2943 | - |
2944 | I assign account on analytic account line. |
2945 | - |
2946 | !python {model: hr.analytic.timesheet}: | |
2947 | - self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule0')], ref('account.analytic_agrolait')) |
2948 | + self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule0')], ref('analytic.analytic_agrolait')) |
2949 | |
2950 | - |
2951 | I create a Tax Codes |
2952 | |
2953 | === modified file 'hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml' |
2954 | --- hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml 2013-10-27 12:31:04 +0000 |
2955 | +++ hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml 2014-04-29 11:49:43 +0000 |
2956 | @@ -4,7 +4,7 @@ |
2957 | I create an account analytic line. |
2958 | - |
2959 | !record {model: account.analytic.line, id: account_analytic_line_developyamlforhrmodule1 }: |
2960 | - account_id: account.analytic_agrolait |
2961 | + account_id: analytic.analytic_agrolait |
2962 | amount: -1.0 |
2963 | general_account_id: account.a_expense |
2964 | journal_id: hr_timesheet.analytic_journal |
2965 | @@ -16,20 +16,20 @@ |
2966 | - |
2967 | Assign partner name and price list in analytic account. |
2968 | - |
2969 | - !record {model: account.analytic.account, id: account.analytic_agrolait}: |
2970 | + !record {model: account.analytic.account, id: analytic.analytic_agrolait}: |
2971 | partner_id: base.res_partner_2 |
2972 | pricelist_id: product.list0 |
2973 | - |
2974 | I open this account and make the state as pending. |
2975 | - |
2976 | !python {model: account.analytic.account}: | |
2977 | - self.set_open(cr, uid, [ref('account.analytic_agrolait')], None) |
2978 | - self.set_pending(cr, uid, [ref('account.analytic_agrolait')], None) |
2979 | + self.set_open(cr, uid, [ref('analytic.analytic_agrolait')], None) |
2980 | + self.set_pending(cr, uid, [ref('analytic.analytic_agrolait')], None) |
2981 | - |
2982 | I assign account on analytic account line. |
2983 | - |
2984 | !python {model: hr.analytic.timesheet}: | |
2985 | - self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule1')], ref('account.analytic_agrolait')) |
2986 | + self.on_change_account_id(cr, uid, [ref('account_analytic_line_developyamlforhrmodule1')], ref('analytic.analytic_agrolait')) |
2987 | - |
2988 | I create a Tax Code |
2989 | - |
2990 | |
2991 | === modified file 'hr_timesheet_sheet/report/hr_timesheet_report.py' |
2992 | --- hr_timesheet_sheet/report/hr_timesheet_report.py 2014-01-27 13:03:51 +0000 |
2993 | +++ hr_timesheet_sheet/report/hr_timesheet_report.py 2014-04-29 11:49:43 +0000 |
2994 | @@ -33,7 +33,7 @@ |
2995 | 'name': fields.char('Description', size=64,readonly=True), |
2996 | 'product_id' : fields.many2one('product.product', 'Product',readonly=True), |
2997 | 'journal_id' : fields.many2one('account.analytic.journal', 'Journal',readonly=True), |
2998 | - 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True), |
2999 | + 'general_account_id' : fields.many2one('account.account', 'Financial Account', readonly=True), |
3000 | 'user_id': fields.many2one('res.users', 'User',readonly=True), |
3001 | 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True), |
3002 | 'company_id': fields.many2one('res.company', 'Company',readonly=True), |
3003 | |
3004 | === modified file 'hr_timesheet_sheet/report/hr_timesheet_report_view.xml' |
3005 | --- hr_timesheet_sheet/report/hr_timesheet_report_view.xml 2014-01-30 13:17:37 +0000 |
3006 | +++ hr_timesheet_sheet/report/hr_timesheet_report_view.xml 2014-04-29 11:49:43 +0000 |
3007 | @@ -32,7 +32,7 @@ |
3008 | <filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/> |
3009 | <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/> |
3010 | <filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/> |
3011 | - <filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
3012 | + <filter string="Financial Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
3013 | <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/> |
3014 | <filter string="Date (day)" context="{'group_by':'date:day'}" help="Group by day of date"/> |
3015 | <filter string="Date (month)" context="{'group_by':'date:month'}" help="Group by month of date"/> |
3016 | |
3017 | === modified file 'hr_timesheet_sheet/report/timesheet_report.py' |
3018 | --- hr_timesheet_sheet/report/timesheet_report.py 2013-11-27 15:32:57 +0000 |
3019 | +++ hr_timesheet_sheet/report/timesheet_report.py 2014-04-29 11:49:43 +0000 |
3020 | @@ -35,7 +35,7 @@ |
3021 | 'date': fields.date('Date', readonly=True), |
3022 | 'name': fields.char('Description', size=64,readonly=True), |
3023 | 'product_id' : fields.many2one('product.product', 'Product'), |
3024 | - 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True), |
3025 | + 'general_account_id' : fields.many2one('account.account', 'Financial Account', readonly=True), |
3026 | 'user_id': fields.many2one('res.users', 'User',readonly=True), |
3027 | 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing',readonly=True), |
3028 | 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True), |
3029 | |
3030 | === modified file 'hr_timesheet_sheet/report/timesheet_report_view.xml' |
3031 | --- hr_timesheet_sheet/report/timesheet_report_view.xml 2014-01-30 13:20:07 +0000 |
3032 | +++ hr_timesheet_sheet/report/timesheet_report_view.xml 2014-04-29 11:49:43 +0000 |
3033 | @@ -41,7 +41,7 @@ |
3034 | <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/> |
3035 | <filter string="Type of Invoicing" icon="terp-stock_symbol-selection" context="{'group_by':'to_invoice'}"/> |
3036 | <filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/> |
3037 | - <filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
3038 | + <filter string="Financial Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
3039 | <filter string="Status" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/> |
3040 | <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/> |
3041 | <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by day of date"/> |
3042 | |
3043 | === modified file 'hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml' |
3044 | --- hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml 2013-10-27 12:31:04 +0000 |
3045 | +++ hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml 2014-04-29 11:49:43 +0000 |
3046 | @@ -45,7 +45,7 @@ |
3047 | - |
3048 | !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: |
3049 | timesheet_ids: |
3050 | - - account_id: account.analytic_agrolait |
3051 | + - account_id: analytic.analytic_agrolait |
3052 | date: !eval time.strftime('%Y-%m-%d') |
3053 | name: 'Develop yaml for hr module' |
3054 | user_id: base.user_demo |
3055 | @@ -74,7 +74,7 @@ |
3056 | - |
3057 | !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: |
3058 | timesheet_ids: |
3059 | - - account_id: account.analytic_agrolait |
3060 | + - account_id: analytic.analytic_agrolait |
3061 | date: !eval time.strftime('%Y-%m-%d') |
3062 | name: 'Develop yaml for hr module' |
3063 | unit_amount: 2.00 |
3064 | |
3065 | === modified file 'multi_company/multi_company_demo.xml' |
3066 | --- multi_company/multi_company_demo.xml 2014-01-09 15:26:21 +0000 |
3067 | +++ multi_company/multi_company_demo.xml 2014-04-29 11:49:43 +0000 |
3068 | @@ -144,7 +144,7 @@ |
3069 | <field name="sequence_id" ref="account.sequence_sale_journal"/> |
3070 | <field name="default_credit_account_id" ref="account.a_sale"/> |
3071 | <field name="default_debit_account_id" ref="account.a_sale"/> |
3072 | - <field name="analytic_journal_id" ref="account.cose_journal_sale"/> |
3073 | + <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/> |
3074 | <field name="user_id" ref="base.user_root"/> |
3075 | <field name="company_id" ref="res_company_oerp_in"/> |
3076 | </record> |
3077 | @@ -156,7 +156,7 @@ |
3078 | <field name="sequence_id" ref="account.sequence_refund_sales_journal"/> |
3079 | <field name="default_credit_account_id" ref="account.a_sale"/> |
3080 | <field name="default_debit_account_id" ref="account.a_sale"/> |
3081 | - <field name="analytic_journal_id" ref="account.cose_journal_sale"/> |
3082 | + <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/> |
3083 | <field name="user_id" ref="base.user_root"/> |
3084 | <field name="company_id" ref="res_company_oerp_in"/> |
3085 | </record> |
3086 | @@ -192,7 +192,7 @@ |
3087 | <field name="sequence_id" ref="account.sequence_bank_journal"/> |
3088 | <field name="default_debit_account_id" ref="account.cash"/> |
3089 | <field name="default_credit_account_id" ref="account.cash"/> |
3090 | - <field name="analytic_journal_id" ref="account.sit"/> |
3091 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3092 | <field name="user_id" ref="base.user_root"/> |
3093 | <field name="company_id" ref="res_company_oerp_in"/> |
3094 | </record> |
3095 | @@ -204,7 +204,7 @@ |
3096 | <field name="sequence_id" ref="account.sequence_check_journal"/> |
3097 | <field name="default_debit_account_id" ref="account.cash"/> |
3098 | <field name="default_credit_account_id" ref="account.cash"/> |
3099 | - <field name="analytic_journal_id" ref="account.sit"/> |
3100 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3101 | <field name="user_id" ref="base.user_root"/> |
3102 | <field name="company_id" ref="res_company_oerp_in"/> |
3103 | </record> |
3104 | @@ -216,7 +216,7 @@ |
3105 | <field name="sequence_id" ref="account.sequence_cash_journal"/> |
3106 | <field name="default_debit_account_id" ref="account.cash"/> |
3107 | <field name="default_credit_account_id" ref="account.cash"/> |
3108 | - <field name="analytic_journal_id" ref="account.sit"/> |
3109 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3110 | <field name="user_id" ref="base.user_root"/> |
3111 | <field name="company_id" ref="res_company_oerp_in"/> |
3112 | </record> |
3113 | @@ -229,7 +229,7 @@ |
3114 | <field name="sequence_id" ref="account.sequence_sale_journal"/> |
3115 | <field name="default_credit_account_id" ref="account.a_sale"/> |
3116 | <field name="default_debit_account_id" ref="account.a_sale"/> |
3117 | - <field name="analytic_journal_id" ref="account.cose_journal_sale"/> |
3118 | + <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/> |
3119 | <field name="user_id" ref="base.user_root"/> |
3120 | <field name="company_id" ref="res_company_oerp_us"/> |
3121 | </record> |
3122 | @@ -241,7 +241,7 @@ |
3123 | <field name="sequence_id" ref="account.sequence_refund_sales_journal"/> |
3124 | <field name="default_credit_account_id" ref="account.a_sale"/> |
3125 | <field name="default_debit_account_id" ref="account.a_sale"/> |
3126 | - <field name="analytic_journal_id" ref="account.cose_journal_sale"/> |
3127 | + <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/> |
3128 | <field name="user_id" ref="base.user_root"/> |
3129 | <field name="company_id" ref="res_company_oerp_us"/> |
3130 | </record> |
3131 | @@ -277,7 +277,7 @@ |
3132 | <field name="sequence_id" ref="account.sequence_bank_journal"/> |
3133 | <field name="default_debit_account_id" ref="account.cash"/> |
3134 | <field name="default_credit_account_id" ref="account.cash"/> |
3135 | - <field name="analytic_journal_id" ref="account.sit"/> |
3136 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3137 | <field name="user_id" ref="base.user_root"/> |
3138 | <field name="company_id" ref="res_company_oerp_us"/> |
3139 | </record> |
3140 | @@ -289,7 +289,7 @@ |
3141 | <field name="sequence_id" ref="account.sequence_check_journal"/> |
3142 | <field name="default_debit_account_id" ref="account.cash"/> |
3143 | <field name="default_credit_account_id" ref="account.cash"/> |
3144 | - <field name="analytic_journal_id" ref="account.sit"/> |
3145 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3146 | <field name="user_id" ref="base.user_root"/> |
3147 | <field name="company_id" ref="res_company_oerp_us"/> |
3148 | </record> |
3149 | @@ -301,7 +301,7 @@ |
3150 | <field name="sequence_id" ref="account.sequence_cash_journal"/> |
3151 | <field name="default_debit_account_id" ref="account.cash"/> |
3152 | <field name="default_credit_account_id" ref="account.cash"/> |
3153 | - <field name="analytic_journal_id" ref="account.sit"/> |
3154 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3155 | <field name="user_id" ref="base.user_root"/> |
3156 | <field name="company_id" ref="res_company_oerp_us"/> |
3157 | </record> |
3158 | @@ -315,7 +315,7 @@ |
3159 | <field name="sequence_id" ref="account.sequence_sale_journal"/> |
3160 | <field name="default_credit_account_id" ref="account.a_sale"/> |
3161 | <field name="default_debit_account_id" ref="account.a_sale"/> |
3162 | - <field name="analytic_journal_id" ref="account.cose_journal_sale"/> |
3163 | + <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/> |
3164 | <field name="user_id" ref="base.user_root"/> |
3165 | <field name="company_id" ref="res_company_oerp_be"/> |
3166 | </record> |
3167 | @@ -327,7 +327,7 @@ |
3168 | <field name="sequence_id" ref="account.sequence_refund_sales_journal"/> |
3169 | <field name="default_credit_account_id" ref="account.a_sale"/> |
3170 | <field name="default_debit_account_id" ref="account.a_sale"/> |
3171 | - <field name="analytic_journal_id" ref="account.cose_journal_sale"/> |
3172 | + <field name="analytic_journal_id" ref="analytic.cose_journal_sale"/> |
3173 | <field name="user_id" ref="base.user_root"/> |
3174 | <field name="company_id" ref="res_company_oerp_be"/> |
3175 | </record> |
3176 | @@ -363,7 +363,7 @@ |
3177 | <field name="sequence_id" ref="account.sequence_bank_journal"/> |
3178 | <field name="default_debit_account_id" ref="account.cash"/> |
3179 | <field name="default_credit_account_id" ref="account.cash"/> |
3180 | - <field name="analytic_journal_id" ref="account.sit"/> |
3181 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3182 | <field name="user_id" ref="base.user_root"/> |
3183 | <field name="company_id" ref="res_company_oerp_be"/> |
3184 | </record> |
3185 | @@ -375,7 +375,7 @@ |
3186 | <field name="sequence_id" ref="account.sequence_check_journal"/> |
3187 | <field name="default_debit_account_id" ref="account.cash"/> |
3188 | <field name="default_credit_account_id" ref="account.cash"/> |
3189 | - <field name="analytic_journal_id" ref="account.sit"/> |
3190 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3191 | <field name="user_id" ref="base.user_root"/> |
3192 | <field name="company_id" ref="res_company_oerp_be"/> |
3193 | </record> |
3194 | @@ -387,7 +387,7 @@ |
3195 | <field name="sequence_id" ref="account.sequence_cash_journal"/> |
3196 | <field name="default_debit_account_id" ref="account.cash"/> |
3197 | <field name="default_credit_account_id" ref="account.cash"/> |
3198 | - <field name="analytic_journal_id" ref="account.sit"/> |
3199 | + <field name="analytic_journal_id" ref="analytic.sit"/> |
3200 | <field name="user_id" ref="base.user_root"/> |
3201 | <field name="company_id" ref="res_company_oerp_be"/> |
3202 | </record> |
3203 | |
3204 | === modified file 'project/project.py' |
3205 | --- project/project.py 2014-04-07 16:33:18 +0000 |
3206 | +++ project/project.py 2014-04-29 11:49:43 +0000 |
3207 | @@ -166,6 +166,7 @@ |
3208 | def unlink(self, cr, uid, ids, context=None): |
3209 | alias_ids = [] |
3210 | mail_alias = self.pool.get('mail.alias') |
3211 | + analytic_account_obj = self.pool.get('account.analytic.account') |
3212 | for proj in self.browse(cr, uid, ids, context=context): |
3213 | if proj.tasks: |
3214 | raise osv.except_osv(_('Invalid Action!'), |
3215 | @@ -174,6 +175,9 @@ |
3216 | alias_ids.append(proj.alias_id.id) |
3217 | res = super(project, self).unlink(cr, uid, ids, context=context) |
3218 | mail_alias.unlink(cr, uid, alias_ids, context=context) |
3219 | + analytic_account = proj.analytic_account_id |
3220 | + if not analytic_account.line_ids: |
3221 | + analytic_account_obj.unlink(cr, uid, [analytic_account.id], context=context) |
3222 | return res |
3223 | |
3224 | def _get_attached_docs(self, cr, uid, ids, field_name, arg, context): |
3225 | @@ -1257,9 +1261,13 @@ |
3226 | |
3227 | def unlink(self, cr, uid, ids, *args, **kwargs): |
3228 | project_obj = self.pool.get('project.project') |
3229 | - analytic_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)]) |
3230 | - if analytic_ids: |
3231 | - raise osv.except_osv(_('Warning!'), _('Please delete the project linked with this account first.')) |
3232 | + proj_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)]) |
3233 | + if proj_ids: |
3234 | + project = project_obj.browse(cr, uid, proj_ids, context=None)[0] |
3235 | + if not project.task_ids: |
3236 | + project_obj.unlink(cr, uid, proj_ids, context=None) |
3237 | + else: |
3238 | + raise osv.except_osv(_('Warning!'), _('Please delete the project linked with this account first.')) |
3239 | return super(account_analytic_account, self).unlink(cr, uid, ids, *args, **kwargs) |
3240 | |
3241 | def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): |
3242 | |
3243 | === modified file 'project_issue/project_issue.py' |
3244 | --- project_issue/project_issue.py 2014-04-07 16:33:18 +0000 |
3245 | +++ project_issue/project_issue.py 2014-04-29 11:49:43 +0000 |
3246 | @@ -543,6 +543,16 @@ |
3247 | res = super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context) |
3248 | return res or (vals.get('use_issues') and not 'project_creation_in_progress' in context) |
3249 | |
3250 | +def unlink(self, cr, uid, ids, *args, **kwargs): |
3251 | + project_obj = self.pool.get('project.project') |
3252 | + proj_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)]) |
3253 | + if proj_ids: |
3254 | + project = project_obj.browse(cr, uid, proj_ids, context=None)[0] |
3255 | + if not project.task_ids and not project.issue_ids: |
3256 | + project_obj.unlink(cr, uid, proj_ids, context=None) |
3257 | + else: |
3258 | + raise osv.except_osv(_('Warning!'), _('Please delete the project linked with this account first.')) |
3259 | + return super(account_analytic_account, self).unlink(cr, uid, ids, *args, **kwargs) |
3260 | |
3261 | class project_project(osv.Model): |
3262 | _inherit = 'project.project' |
3263 | |
3264 | === modified file 'project_timesheet/project_timesheet_view.xml' |
3265 | --- project_timesheet/project_timesheet_view.xml 2013-10-27 12:31:04 +0000 |
3266 | +++ project_timesheet/project_timesheet_view.xml 2014-04-29 11:49:43 +0000 |
3267 | @@ -48,7 +48,7 @@ |
3268 | <record id="view_account_analytic_line_search_account_inherit" model="ir.ui.view"> |
3269 | <field name="name">account.analytic.line.search.account_id</field> |
3270 | <field name="model">account.analytic.line</field> |
3271 | - <field name="inherit_id" ref="account.view_account_analytic_line_filter"/> |
3272 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_filter"/> |
3273 | <field name="arch" type="xml"> |
3274 | <field name="account_id" position="replace"> |
3275 | <field name="account_id" string="Analytic account/project"/> |
3276 | @@ -58,7 +58,7 @@ |
3277 | <record id="view_account_analytic_line_form_inherit_account_id" model="ir.ui.view"> |
3278 | <field name="name">account.analytic.line.form.account_id</field> |
3279 | <field name="model">account.analytic.line</field> |
3280 | - <field name="inherit_id" ref="account.view_account_analytic_line_form"/> |
3281 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_form"/> |
3282 | <field name="arch" type="xml"> |
3283 | <field name="account_id" position="replace"> |
3284 | <field name="account_id" string="Analytic Account/Project" on_change="on_change_account_id(account_id)"/> |
3285 | @@ -68,7 +68,7 @@ |
3286 | <record id="view_account_analytic_line_tree_inherit_account_id" model="ir.ui.view"> |
3287 | <field name="name">account.analytic.line.tree.account_id</field> |
3288 | <field name="model">account.analytic.line</field> |
3289 | - <field name="inherit_id" ref="account.view_account_analytic_line_tree"/> |
3290 | + <field name="inherit_id" ref="analytic.view_account_analytic_line_tree"/> |
3291 | <field name="arch" type="xml"> |
3292 | <field name="account_id" position="replace"> |
3293 | <field name="account_id" string="Analytic account/project" on_change="on_change_account_id(account_id)"/> |