Merge lp:~pedro.baeza/account-analytic/7.0-hr_expense_analytic_plans into lp:~account-core-editors/account-analytic/7.0

Proposed by Pedro Manuel Baeza
Status: Merged
Merged at revision: 19
Proposed branch: lp:~pedro.baeza/account-analytic/7.0-hr_expense_analytic_plans
Merge into: lp:~account-core-editors/account-analytic/7.0
Diff against target: 277 lines (+239/-0)
7 files modified
hr_expense_analytic_plans/__init__.py (+21/-0)
hr_expense_analytic_plans/__openerp__.py (+43/-0)
hr_expense_analytic_plans/i18n/es.po (+36/-0)
hr_expense_analytic_plans/i18n/hr_expense_analytic_plans.pot (+36/-0)
hr_expense_analytic_plans/model/__init__.py (+23/-0)
hr_expense_analytic_plans/model/hr_expense_analytic_plans.py (+49/-0)
hr_expense_analytic_plans/view/hr_expense_analytic_plans_view.xml (+31/-0)
To merge this branch: bzr merge lp:~pedro.baeza/account-analytic/7.0-hr_expense_analytic_plans
Reviewer Review Type Date Requested Status
Omar (Pexego) code review Approve
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Review via email: mp+216469@code.launchpad.net

Description of the change

[ADD] hr_expense_analytic_plans: With this module, you will be able to link analytic distributions to expenses.

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

LGTM, thanks !

review: Approve (code review, no tests)
Revision history for this message
Omar (Pexego) (omar7r) wrote :

LGTM

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'hr_expense_analytic_plans'
=== added file 'hr_expense_analytic_plans/__init__.py'
--- hr_expense_analytic_plans/__init__.py 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_plans/__init__.py 2014-04-18 16:55:28 +0000
@@ -0,0 +1,21 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as
8# published by the Free Software Foundation, either version 3 of the
9# License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Affero General Public License for more details.
15#
16# You should have received a copy of the GNU Affero General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from . import model
022
=== added file 'hr_expense_analytic_plans/__openerp__.py'
--- hr_expense_analytic_plans/__openerp__.py 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_plans/__openerp__.py 2014-04-18 16:55:28 +0000
@@ -0,0 +1,43 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
6# Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23{
24 'name': 'HR expenses analytic distribution',
25 'version': '1.0',
26 'category': 'Human Resources',
27 'description': """
28The base module to manage analytic distribution on HR expenses
29==============================================================
30
31Using this module, you will be able to link analytic distributions to expenses.
32 """,
33 'author': 'Serv. Tecnolog. Avanzados - Pedro M. Baeza',
34 'website' : 'http://www.serviciosbaeza.com',
35 'depends': [
36 'hr_expense',
37 'account_analytic_plans',
38 ],
39 'data': [
40 'view/hr_expense_analytic_plans_view.xml'
41 ],
42 'installable': True,
43}
044
=== added directory 'hr_expense_analytic_plans/i18n'
=== added file 'hr_expense_analytic_plans/i18n/es.po'
--- hr_expense_analytic_plans/i18n/es.po 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_plans/i18n/es.po 2014-04-18 16:55:28 +0000
@@ -0,0 +1,36 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * hr_expense_analytic_plans
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-04-04 18:17+0000\n"
10"PO-Revision-Date: 2014-04-04 20:18+0100\n"
11"Last-Translator: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: hr_expense_analytic_plans
19#: field:hr.expense.line,analytics_id:0
20msgid "Analytic distribution"
21msgstr "Distribución analítica"
22
23#. module: hr_expense_analytic_plans
24#: code:_description:0
25#: model:ir.model,name:hr_expense_analytic_plans.model_hr_expense_expense
26#, python-format
27msgid "Expense"
28msgstr "Gasto"
29
30#. module: hr_expense_analytic_plans
31#: code:_description:0
32#: model:ir.model,name:hr_expense_analytic_plans.model_hr_expense_line
33#, python-format
34msgid "Expense Line"
35msgstr "Línea de gasto"
36
037
=== added file 'hr_expense_analytic_plans/i18n/hr_expense_analytic_plans.pot'
--- hr_expense_analytic_plans/i18n/hr_expense_analytic_plans.pot 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_plans/i18n/hr_expense_analytic_plans.pot 2014-04-18 16:55:28 +0000
@@ -0,0 +1,36 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * hr_expense_analytic_plans
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-04-04 18:17+0000\n"
10"PO-Revision-Date: 2014-04-04 20:17+0100\n"
11"Last-Translator: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: hr_expense_analytic_plans
19#: field:hr.expense.line,analytics_id:0
20msgid "Analytic distribution"
21msgstr ""
22
23#. module: hr_expense_analytic_plans
24#: code:_description:0
25#: model:ir.model,name:hr_expense_analytic_plans.model_hr_expense_expense
26#, python-format
27msgid "Expense"
28msgstr ""
29
30#. module: hr_expense_analytic_plans
31#: code:_description:0
32#: model:ir.model,name:hr_expense_analytic_plans.model_hr_expense_line
33#, python-format
34msgid "Expense Line"
35msgstr ""
36
037
=== added directory 'hr_expense_analytic_plans/model'
=== added file 'hr_expense_analytic_plans/model/__init__.py'
--- hr_expense_analytic_plans/model/__init__.py 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_plans/model/__init__.py 2014-04-18 16:55:28 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
6# Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from . import hr_expense_analytic_plans
024
=== added file 'hr_expense_analytic_plans/model/hr_expense_analytic_plans.py'
--- hr_expense_analytic_plans/model/hr_expense_analytic_plans.py 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_plans/model/hr_expense_analytic_plans.py 2014-04-18 16:55:28 +0000
@@ -0,0 +1,49 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
6# Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from openerp.osv import fields, orm
24
25class HrExpenseExpense(orm.Model):
26 _inherit = 'hr.expense.expense'
27
28 def line_get_convert(self, cr, uid, x, part, date, context=None):
29 res = super(HrExpenseExpense, self).line_get_convert(cr, uid, x, part,
30 date,
31 context=context)
32 res['analytics_id'] = x.get('analytics_id', False)
33 return res
34
35 def move_line_get_item(self, cr, uid, line, context=None):
36 res = super(HrExpenseExpense, self).move_line_get_item(cr, uid, line,
37 context=context)
38 if line.analytics_id:
39 res['analytics_id'] = line.analytics_id.id
40 return res
41
42
43class HrExpenseLine(orm.Model):
44 _inherit = 'hr.expense.line'
45 _columns = {
46 'analytics_id': fields.many2one('account.analytic.plan.instance',
47 'Analytic distribution'),
48 }
49
050
=== added directory 'hr_expense_analytic_plans/view'
=== added file 'hr_expense_analytic_plans/view/hr_expense_analytic_plans_view.xml'
--- hr_expense_analytic_plans/view/hr_expense_analytic_plans_view.xml 1970-01-01 00:00:00 +0000
+++ hr_expense_analytic_plans/view/hr_expense_analytic_plans_view.xml 2014-04-18 16:55:28 +0000
@@ -0,0 +1,31 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4
5 <record model="ir.ui.view" id="view_expenses_line_tree_plans">
6 <field name="name">hr.expense.line.tree.plans</field>
7 <field name="model">hr.expense.line</field>
8 <field name="inherit_id" ref="hr_expense.view_expenses_line_tree"/>
9 <field name="arch" type="xml">
10 <field name="analytic_account" position="replace">
11 <field name="analytics_id" domain="[('plan_id', '&lt;&gt;', False)]" groups="analytic.group_analytic_accounting"/>
12 </field>
13 </field>
14 </record>
15
16 <record model="ir.ui.view" id="view_expenses_form_plans">
17 <field name="name">hr.expense.form.plans</field>
18 <field name="model">hr.expense.expense</field>
19 <field name="inherit_id" ref="hr_expense.view_expenses_form"/>
20 <field name="arch" type="xml">
21 <xpath expr="//field[@name='line_ids']/form//field[@name='analytic_account']" position="replace">
22 <field name="analytics_id" domain="[('plan_id', '&lt;&gt;', False)]" groups="analytic.group_analytic_accounting"/>
23 </xpath>
24 <xpath expr="//field[@name='line_ids']/tree//field[@name='analytic_account']" position="replace">
25 <field name="analytics_id" domain="[('plan_id', '&lt;&gt;', False)]" groups="analytic.group_analytic_accounting"/>
26 </xpath>
27 </field>
28 </record>
29
30 </data>
31</openerp>

Subscribers

People subscribed via source and target branches

to status/vote changes: