Pedro Manuel Baeza has proposed merging lp:~pedro.baeza/account-analytic/7.0-hr_expense_analytic_plans into lp:account-analytic.
Requested reviews: Account Core Editors (account-core-editors) For more details, see: https://code.launchpad.net/~pedro.baeza/account-analytic/7.0-hr_expense_analytic_plans/+merge/216469 [ADD] hr_expense_analytic_plans: With this module, you will be able to link analytic distributions to expenses. -- https://code.launchpad.net/~pedro.baeza/account-analytic/7.0-hr_expense_analytic_plans/+merge/216469 Your team Account Core Editors is requested to review the proposed merge of lp:~pedro.baeza/account-analytic/7.0-hr_expense_analytic_plans into lp:account-analytic.
=== 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:50:31 +0000 @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +from . import model === 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:50:31 +0000 @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro Manuel Baeza <pedro.ba...@serviciosbaeza.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +{ + 'name': 'HR expenses analytic distribution', + 'version': '1.0', + 'category': 'Human Resources', + 'description': """ +The base module to manage analytic distribution on HR expenses +============================================================== + +Using this module, you will be able to link analytic distributions to expenses. + """, + 'author': 'Serv. Tecnolog. Avanzados - Pedro M. Baeza', + 'website' : 'http://www.serviciosbaeza.com', + 'depends': [ + 'hr_expense', + 'account_analytic_plans', + ], + 'data': [ + 'view/hr_expense_analytic_plans_view.xml' + ], + 'installable': True, +} === 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:50:31 +0000 @@ -0,0 +1,36 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * hr_expense_analytic_plans +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-04-04 18:17+0000\n" +"PO-Revision-Date: 2014-04-04 20:18+0100\n" +"Last-Translator: Pedro Manuel Baeza <pedro.ba...@serviciosbaeza.com>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" + +#. module: hr_expense_analytic_plans +#: field:hr.expense.line,analytics_id:0 +msgid "Analytic distribution" +msgstr "Distribución analítica" + +#. module: hr_expense_analytic_plans +#: code:_description:0 +#: model:ir.model,name:hr_expense_analytic_plans.model_hr_expense_expense +#, python-format +msgid "Expense" +msgstr "Gasto" + +#. module: hr_expense_analytic_plans +#: code:_description:0 +#: model:ir.model,name:hr_expense_analytic_plans.model_hr_expense_line +#, python-format +msgid "Expense Line" +msgstr "Línea de gasto" + === 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:50:31 +0000 @@ -0,0 +1,36 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * hr_expense_analytic_plans +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-04-04 18:17+0000\n" +"PO-Revision-Date: 2014-04-04 20:17+0100\n" +"Last-Translator: Pedro Manuel Baeza <pedro.ba...@serviciosbaeza.com>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" + +#. module: hr_expense_analytic_plans +#: field:hr.expense.line,analytics_id:0 +msgid "Analytic distribution" +msgstr "" + +#. module: hr_expense_analytic_plans +#: code:_description:0 +#: model:ir.model,name:hr_expense_analytic_plans.model_hr_expense_expense +#, python-format +msgid "Expense" +msgstr "" + +#. module: hr_expense_analytic_plans +#: code:_description:0 +#: model:ir.model,name:hr_expense_analytic_plans.model_hr_expense_line +#, python-format +msgid "Expense Line" +msgstr "" + === 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:50:31 +0000 @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro Manuel Baeza <pedro.ba...@serviciosbaeza.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +from . import hr_expense_analytic_plans === 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:50:31 +0000 @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro Manuel Baeza <pedro.ba...@serviciosbaeza.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +from openerp.osv import fields, orm + +class HrExpenseExpense(orm.Model): + _inherit = 'hr.expense.expense' + + def line_get_convert(self, cr, uid, x, part, date, context=None): + res = super(HrExpenseExpense, self).line_get_convert(cr, uid, x, part, + date, + context=context) + res['analytics_id'] = x.get('analytics_id', False) + return res + + def move_line_get_item(self, cr, uid, line, context=None): + res = super(HrExpenseExpense, self).move_line_get_item(cr, uid, line, + context=context) + if line.analytics_id: + res['analytics_id'] = line.analytics_id.id + return res + + +class HrExpenseLine(orm.Model): + _inherit = 'hr.expense.line' + _columns = { + 'analytics_id': fields.many2one('account.analytic.plan.instance', + 'Analytic distribution'), + } + === 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:50:31 +0000 @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<openerp> + <data> + + <record model="ir.ui.view" id="view_expenses_line_tree_plans"> + <field name="name">hr.expense.line.tree.plans</field> + <field name="model">hr.expense.line</field> + <field name="inherit_id" ref="hr_expense.view_expenses_line_tree"/> + <field name="arch" type="xml"> + <field name="analytic_account" position="replace"> + <field name="analytics_id" domain="[('plan_id', '<>', False)]" groups="analytic.group_analytic_accounting"/> + </field> + </field> + </record> + + <record model="ir.ui.view" id="view_expenses_form_plans"> + <field name="name">hr.expense.form.plans</field> + <field name="model">hr.expense.expense</field> + <field name="inherit_id" ref="hr_expense.view_expenses_form"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='line_ids']/form//field[@name='analytic_account']" position="replace"> + <field name="analytics_id" domain="[('plan_id', '<>', False)]" groups="analytic.group_analytic_accounting"/> + </xpath> + <xpath expr="//field[@name='line_ids']/tree//field[@name='analytic_account']" position="replace"> + <field name="analytics_id" domain="[('plan_id', '<>', False)]" groups="analytic.group_analytic_accounting"/> + </xpath> + </field> + </record> + + </data> +</openerp>
-- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp