Merge lp:~vauxoo/addons-vauxoo/7.0-purchase_requisition_department-dev-1551-kty into lp:addons-vauxoo/7.0

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 1044
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-purchase_requisition_department-dev-1551-kty
Merge into: lp:addons-vauxoo/7.0
Diff against target: 354 lines (+296/-0)
7 files modified
purchase_requisition_department/__init__.py (+27/-0)
purchase_requisition_department/__openerp__.py (+54/-0)
purchase_requisition_department/i18n/purchase_requisition_department.pot (+33/-0)
purchase_requisition_department/model/__init__.py (+26/-0)
purchase_requisition_department/model/purchase_requisition.py (+86/-0)
purchase_requisition_department/view/purchase_requisition_view.xml (+45/-0)
purchase_requisition_department/wizard/__init__.py (+25/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-purchase_requisition_department-dev-1551-kty
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) Approve
Review via email: mp+222406@code.launchpad.net

Description of the change

[MERGE] add new module name purchase_requisition_department.

To post a comment you must log in.
Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) wrote :

waiting for runbot

Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) wrote :

runbot green. I will procedure with the merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'purchase_requisition_department'
=== added file 'purchase_requisition_department/__init__.py'
--- purchase_requisition_department/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_department/__init__.py 2014-06-06 21:05:57 +0000
@@ -0,0 +1,27 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3###############################################################################
4# Module Writen to OpenERP, Open Source Management Solution
5# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
6# All Rights Reserved
7############# Credits #########################################################
8# Coded by: Katherine Zaoral <kathy@vauxoo.com>
9# Planified by: Humberto Arocha <hbto@vauxoo.com>
10# Audited by: Humberto Arocha <hbto@vauxoo.com>
11###############################################################################
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as published
14# by the Free Software Foundation, either version 3 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24###############################################################################
25
26import model
27import wizard
028
=== added file 'purchase_requisition_department/__openerp__.py'
--- purchase_requisition_department/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_department/__openerp__.py 2014-06-06 21:05:57 +0000
@@ -0,0 +1,54 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3###############################################################################
4# Module Writen to OpenERP, Open Source Management Solution
5# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
6# All Rights Reserved
7############# Credits #########################################################
8# Coded by: Katherine Zaoral <kathy@vauxoo.com>
9# Planified by: Humberto Arocha <hbto@vauxoo.com>
10# Audited by: Humberto Arocha <hbto@vauxoo.com>
11###############################################################################
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as published
14# by the Free Software Foundation, either version 3 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24###############################################################################
25
26{
27 'name': 'Purchase Requisition Department',
28 'version': '1.0',
29 'author': 'Vauxoo',
30 'website': 'http://www.vauxoo.com/',
31 'category': 'purchase',
32 'description': '''
33Purchase Requisition Department
34===============================
35
36Add the department field relational field to deparment_id extract for the
37current purchase requisition responsible. Also add the filter ins the purchase
38requisition list view to discriminate the purchase requisition by department.
39''',
40 'depends': [
41 'purchase_requisition',
42 'hr',
43 ],
44 'data': [
45 'view/purchase_requisition_view.xml',
46 ],
47 'demo': [],
48 'test': [],
49 'qweb': [],
50 'js': [],
51 'css': [],
52 'active': False,
53 'installable': True,
54}
055
=== added directory 'purchase_requisition_department/data'
=== added directory 'purchase_requisition_department/demo'
=== added directory 'purchase_requisition_department/doc'
=== added directory 'purchase_requisition_department/doc/images'
=== added directory 'purchase_requisition_department/i18n'
=== added file 'purchase_requisition_department/i18n/purchase_requisition_department.pot'
--- purchase_requisition_department/i18n/purchase_requisition_department.pot 1970-01-01 00:00:00 +0000
+++ purchase_requisition_department/i18n/purchase_requisition_department.pot 2014-06-06 21:05:57 +0000
@@ -0,0 +1,33 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_requisition_department
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-06-06 20:44+0000\n"
10"PO-Revision-Date: 2014-06-06 20:44+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: purchase_requisition_department
19#: view:purchase.requisition:0
20#: field:purchase.requisition,department_id:0
21msgid "Department"
22msgstr ""
23
24#. module: purchase_requisition_department
25#: model:ir.model,name:purchase_requisition_department.model_purchase_requisition
26msgid "Purchase Requisition"
27msgstr ""
28
29#. module: purchase_requisition_department
30#: help:purchase.requisition,department_id:0
31msgid "The department where this purchase requisition belongs"
32msgstr ""
33
034
=== added directory 'purchase_requisition_department/model'
=== added file 'purchase_requisition_department/model/__init__.py'
--- purchase_requisition_department/model/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_department/model/__init__.py 2014-06-06 21:05:57 +0000
@@ -0,0 +1,26 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3###############################################################################
4# Module Writen to OpenERP, Open Source Management Solution
5# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
6# All Rights Reserved
7############# Credits #########################################################
8# Coded by: Katherine Zaoral <kathy@vauxoo.com>
9# Planified by: Humberto Arocha <hbto@vauxoo.com>
10# Audited by: Humberto Arocha <hbto@vauxoo.com>
11###############################################################################
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as published
14# by the Free Software Foundation, either version 3 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24###############################################################################
25
26import purchase_requisition
027
=== added file 'purchase_requisition_department/model/purchase_requisition.py'
--- purchase_requisition_department/model/purchase_requisition.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_department/model/purchase_requisition.py 2014-06-06 21:05:57 +0000
@@ -0,0 +1,86 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3###############################################################################
4# Module Writen to OpenERP, Open Source Management Solution
5# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
6# All Rights Reserved
7############# Credits #########################################################
8# Coded by: Katherine Zaoral <kathy@vauxoo.com>
9# Planified by: Humberto Arocha <hbto@vauxoo.com>
10# Audited by: Humberto Arocha <hbto@vauxoo.com>
11###############################################################################
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as published
14# by the Free Software Foundation, either version 3 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24###############################################################################
25
26from openerp.osv import fields, osv, orm
27from openerp.tools.translate import _
28from openerp import tools
29
30class purchase_requisition(osv.Model):
31
32 _inherit = 'purchase.requisition'
33 _columns = {
34 'department_id': fields.many2one(
35 'hr.department',
36 string='Department',
37 help='The department where this purchase requisition belongs'),
38 }
39
40 _defaults = {
41 'department_id': lambda self, cur, uid, cxt: self.pool.get('res.users').browse(cur, uid, uid, cxt).employee_ids[0].department_id.id,
42 }
43
44 #def fields_view_get(self, cr, uid, view_id=None, view_type='form',
45 # context=None, toolbar=False, submenu=False):
46 # """
47 # Filter the department by the ones the current user belongs.
48 # """
49 # context = context or {}
50 # res = super(purchase_requisition,self).fields_view_get(
51 # cr, uid, view_id=view_id, view_type=view_type, context=context,
52 # toolbar=toolbar, submenu=submenu)
53
54 # user_obj = self.pool.get('res.users')
55 # user_brw = user_obj.browse(cr, uid, uid, context=context)
56 # if 'department_id' in res['fields'].keys():
57 # dep_ids = [emp_brw.department_id.id for emp_brw in user_brw.employee_ids]
58 # res['fields']['department_id']['domain'] = [('id', 'in', dep_ids)]
59 # return res
60
61 # TODO: This filter method is not working.
62 #def fields_view_get(self, cr, uid, view_id=None, view_type='form',
63 # context=None, toolbar=False, submenu=False):
64 # """
65 # Filter the department by the ones the user_id.employee_ids belongs.
66 # """
67 # context = context or {}
68 # res = super(purchase_requisition,self).fields_view_get(
69 # cr, uid, view_id=view_id, view_type=view_type, context=context,
70 # toolbar=toolbar, submenu=submenu)
71
72 # user_id = res['fields']['user_id'].get('selection', False) or uid
73 # user_obj = self.pool.get('res.users')
74 # emp_obj = self.pool.get('hr.employee')
75 # dep_obj = self.pool.get('hr.department')
76 # user_brw = user_obj.browse(cr, uid, user_id, context=context)
77 # if 'department_id' in res['fields'].keys():
78 # emp_ids = [emp_brw.id for emp_brw in user_brw.employee_ids]
79 # dep_ids = [emp_brw.department_id.id for emp_brw in user_brw.employee_ids]
80 # dep_selected = dep_obj._name_search(cr, uid, '', [('member_ids', 'in',
81 # emp_ids)], context=context, limit=None, name_get_uid=1)
82 # res['fields']['department_id']['selection'] = dep_selected
83 # res['fields']['department_id']['domain'] = [('id', 'in', dep_ids)]
84
85 # return res
86
087
=== added directory 'purchase_requisition_department/report'
=== added directory 'purchase_requisition_department/security'
=== added directory 'purchase_requisition_department/static'
=== added directory 'purchase_requisition_department/static/description'
=== added file 'purchase_requisition_department/static/description/index.html'
=== added directory 'purchase_requisition_department/static/src'
=== added directory 'purchase_requisition_department/static/src/css'
=== added directory 'purchase_requisition_department/static/src/img'
=== added file 'purchase_requisition_department/static/src/img/icon.png'
1Binary files purchase_requisition_department/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and purchase_requisition_department/static/src/img/icon.png 2014-06-06 21:05:57 +0000 differ88Binary files purchase_requisition_department/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and purchase_requisition_department/static/src/img/icon.png 2014-06-06 21:05:57 +0000 differ
=== added directory 'purchase_requisition_department/static/src/js'
=== added directory 'purchase_requisition_department/static/src/xml'
=== added directory 'purchase_requisition_department/test'
=== added directory 'purchase_requisition_department/view'
=== added file 'purchase_requisition_department/view/purchase_requisition_view.xml'
--- purchase_requisition_department/view/purchase_requisition_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_requisition_department/view/purchase_requisition_view.xml 2014-06-06 21:05:57 +0000
@@ -0,0 +1,45 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4
5 <record id="purchase_requisition_department_form" model="ir.ui.view">
6 <field name="name">purchase.requisition.department.form</field>
7 <field name="model">purchase.requisition</field>
8 <field name="inherit_id" ref="purchase_requisition.view_purchase_requisition_form"/>
9 <field name="arch" type="xml">
10 <xpath expr="//field[@name='user_id']" position="after">
11 <field name="department_id"/>
12 </xpath>
13 </field>
14 </record>
15
16 <record id="purchase_requisition_department_tree" model="ir.ui.view">
17 <field name="name">purchase.requisition.department.tree</field>
18 <field name="model">purchase.requisition</field>
19 <field name="inherit_id" ref="purchase_requisition.view_purchase_requisition_tree"/>
20 <field name="arch" type="xml">
21 <xpath expr="//field[@name='user_id']" position="before">
22 <field name="department_id" invisible="1"/>
23 </xpath>
24 </field>
25 </record>
26
27 <record id="purchase_requisition_department_search" model="ir.ui.view">
28 <field name="name">purchase.requisition.department.search</field>
29 <field name="model">purchase.requisition</field>
30 <field name="inherit_id" ref="purchase_requisition.view_purchase_requisition_filter"/>
31 <field name="arch" type="xml">
32
33 <xpath expr="//field[@name='exclusive']" position="after">
34 <field name="department_id"/>
35 </xpath>
36
37 <xpath expr="//group" position="inside">
38 <filter string="Department" icon="terp-personal" context="{'group_by':'department_id'}"/>
39 </xpath>
40
41 </field>
42 </record>
43
44 </data>
45</openerp>
046
=== added directory 'purchase_requisition_department/wizard'
=== added file 'purchase_requisition_department/wizard/__init__.py'
--- purchase_requisition_department/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_department/wizard/__init__.py 2014-06-06 21:05:57 +0000
@@ -0,0 +1,25 @@
1#!/usr/bin/python
2# -*- encoding: utf-8 -*-
3###############################################################################
4# Module Writen to OpenERP, Open Source Management Solution
5# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
6# All Rights Reserved
7############# Credits #########################################################
8# Coded by: Katherine Zaoral <kathy@vauxoo.com>
9# Planified by: Humberto Arocha <hbto@vauxoo.com>
10# Audited by: Humberto Arocha <hbto@vauxoo.com>
11###############################################################################
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as published
14# by the Free Software Foundation, either version 3 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24###############################################################################
25
026
=== added directory 'purchase_requisition_department/workflow'