[VIEW] ~account_analytic field is mandatory and filter in expense form
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Wed, 27 May 2015 08:45:51 +0000 (10:45 +0200)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Wed, 27 May 2015 08:46:33 +0000 (10:46 +0200)
view

__init__.py [new file with mode: 0644]
__openerp__.py [new file with mode: 0644]
view/hr_expense.xml [new file with mode: 0644]

diff --git a/__init__.py b/__init__.py
new file mode 100644 (file)
index 0000000..f39b3f0
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Account analytic improved module for OpenERP, Improve some account
+#    analytic module problem Copyright (C) 2015 L'Heureux Cyclage
+#    (<http://www.heureux-cyclage.org>) Ludovic CHEVALIER
+#
+#    This file is a part of Account analytic improved
+#
+#    Account analytic improved is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    Account analytic improved 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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/__openerp__.py b/__openerp__.py
new file mode 100644 (file)
index 0000000..d21497c
--- /dev/null
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Account analytic improved module for OpenERP, Improve some account
+#    analytic module problem Copyright (C) 2015 L'Heureux Cyclage
+#    (<http://www.heureux-cyclage.org>) Ludovic CHEVALIER
+#
+#    This file is a part of Account analytic improved
+#
+#    Account analytic improved is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    Account analytic improved 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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+    'name': 'Account analytic module improvement',
+    'author': 'L\'Heureux Cyclage',
+    'version': '0.1',
+    'category': 'Accounting & Finance',
+    'description': """
+Account analytic module improvement
+===================================
+
+It installs the profile for bike co-ops to manage some features like:
+    * ...
+    """,
+    'website': 'http://www.heureux-cyclage.org',
+    'images': [],
+    'depends': [
+        'account',
+        'hr_expense',
+    ],
+    'init_xml': [
+    ],
+    'update_xml': [
+        'view/hr_expense.xml',
+    ],
+    'installable': True,
+    'auto_install': False,
+}
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/view/hr_expense.xml b/view/hr_expense.xml
new file mode 100644 (file)
index 0000000..ab62a26
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="view_expenses_form" model="ir.ui.view">
+            <field name="name">hr.expense.expense.form</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="/form/sheet/notebook/page/field/form/group/group/field[@name='analytic_account']" position="replace">
+                    <field name="analytic_account" domain="['&amp;', ('type','=', 'normal'), ('code', '!=', False), ('state', '=', 'open')]" required="1"/><field name="analytic_account" domain="['&amp;', ('type','=', 'normal'), ('code', '!=', False), ('state', '=', 'open')]" required="1"/>
+                </xpath>
+                <xpath expr="/form/sheet/notebook/page/field/tree/field[@name='analytic_account']" position="replace">
+                    <field name="analytic_account" domain="['&amp;', ('type','=', 'normal'), ('code', '!=', False), ('state', '=', 'open')]" required="1"/>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>