Merge lp:~vauxoo/addons-vauxoo/7.0-purchase_order_department-dev-1625-kty into lp:~vauxoo/addons-vauxoo/addons-vauxoo-cicsa

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 1058
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-purchase_order_department-dev-1625-kty
Merge into: lp:~vauxoo/addons-vauxoo/addons-vauxoo-cicsa
Diff against target: 334 lines (+276/-0)
7 files modified
purchase_order_department/__init__.py (+27/-0)
purchase_order_department/__openerp__.py (+59/-0)
purchase_order_department/i18n/purchase_order_department.pot (+38/-0)
purchase_order_department/model/__init__.py (+26/-0)
purchase_order_department/model/purchase_order.py (+53/-0)
purchase_order_department/view/purchase_order_view.xml (+48/-0)
purchase_order_department/wizard/__init__.py (+25/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-purchase_order_department-dev-1625-kty
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) Approve
Review via email: mp+223652@code.launchpad.net

Description of the change

[MERGE] add new module purchase_order_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 is green.
I will proceed 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_order_department'
=== added file 'purchase_order_department/__init__.py'
--- purchase_order_department/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_order_department/__init__.py 2014-06-18 21:55:16 +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_order_department/__openerp__.py'
--- purchase_order_department/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_order_department/__openerp__.py 2014-06-18 21:55:16 +0000
@@ -0,0 +1,59 @@
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 Order Department',
28 'version': '1.0',
29 'author': 'Vauxoo',
30 'website': 'http://www.vauxoo.com/',
31 'category': 'purchase',
32 'description': '''
33Purchase Order Department
34=========================
35
36Add a department field to the purchase order model. This check the purchase
37order requisitor (user) and fill the department field with the requisitor
38employee info. Also add a search filter by text to search the department name
39and a gruop by filter by department.
40
41Note: this module do not work propertly for users with multiple employees.
42''',
43
44 'depends': [
45 'purchase',
46 'hr',
47 'purchase_order_requisitor',
48 ],
49 'data': [
50 'view/purchase_order_view.xml',
51 ],
52 'demo': [],
53 'test': [],
54 'qweb': [],
55 'js': [],
56 'css': [],
57 'active': False,
58 'installable': True,
59}
060
=== added directory 'purchase_order_department/data'
=== added directory 'purchase_order_department/demo'
=== added directory 'purchase_order_department/doc'
=== added directory 'purchase_order_department/doc/images'
=== added directory 'purchase_order_department/i18n'
=== added file 'purchase_order_department/i18n/purchase_order_department.pot'
--- purchase_order_department/i18n/purchase_order_department.pot 1970-01-01 00:00:00 +0000
+++ purchase_order_department/i18n/purchase_order_department.pot 2014-06-18 21:55:16 +0000
@@ -0,0 +1,38 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_order_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-18 21:28+0000\n"
10"PO-Revision-Date: 2014-06-18 21:28+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_order_department
19#: view:purchase.order:0
20#: field:purchase.order,department_id:0
21msgid "Department"
22msgstr ""
23
24#. module: purchase_order_department
25#: view:purchase.order:0
26msgid "onchange_user_id(rfq_user_id)"
27msgstr ""
28
29#. module: purchase_order_department
30#: help:purchase.order,department_id:0
31msgid "The department where this purchase order belongs"
32msgstr ""
33
34#. module: purchase_order_department
35#: model:ir.model,name:purchase_order_department.model_purchase_order
36msgid "Purchase Order"
37msgstr ""
38
039
=== added directory 'purchase_order_department/model'
=== added file 'purchase_order_department/model/__init__.py'
--- purchase_order_department/model/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_order_department/model/__init__.py 2014-06-18 21:55:16 +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_order
027
=== added file 'purchase_order_department/model/purchase_order.py'
--- purchase_order_department/model/purchase_order.py 1970-01-01 00:00:00 +0000
+++ purchase_order_department/model/purchase_order.py 2014-06-18 21:55:16 +0000
@@ -0,0 +1,53 @@
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_order(osv.Model):
31
32 _inherit = 'purchase.order'
33 _columns = {
34 'department_id': fields.many2one(
35 'hr.department',
36 string='Department',
37 help='The department where this purchase order belongs'),
38 }
39
40 def onchange_user_id(self, cr, uid, ids, user_id, context=None):
41 """ Return the department depending of the user.
42 @param user_id: user id
43 """
44 context = context or {}
45 res = {}
46 ru_obj = self.pool.get('res.users')
47 if user_id:
48 ru_brw = ru_obj.browse(cr, uid, user_id, context=context)
49 department_id = (ru_brw.employee_ids
50 and ru_brw.employee_ids[0].department_id
51 and ru_brw.employee_ids[0].department_id.id or False)
52 res.update({'value': {'department_id': department_id}})
53 return res
054
=== added directory 'purchase_order_department/report'
=== added directory 'purchase_order_department/security'
=== added directory 'purchase_order_department/static'
=== added directory 'purchase_order_department/static/description'
=== added file 'purchase_order_department/static/description/index.html'
=== added directory 'purchase_order_department/static/src'
=== added directory 'purchase_order_department/static/src/css'
=== added directory 'purchase_order_department/static/src/img'
=== added file 'purchase_order_department/static/src/img/icon.png'
1Binary files purchase_order_department/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and purchase_order_department/static/src/img/icon.png 2014-06-18 21:55:16 +0000 differ55Binary files purchase_order_department/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and purchase_order_department/static/src/img/icon.png 2014-06-18 21:55:16 +0000 differ
=== added directory 'purchase_order_department/static/src/js'
=== added directory 'purchase_order_department/static/src/xml'
=== added directory 'purchase_order_department/test'
=== added directory 'purchase_order_department/view'
=== added file 'purchase_order_department/view/purchase_order_view.xml'
--- purchase_order_department/view/purchase_order_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_order_department/view/purchase_order_view.xml 2014-06-18 21:55:16 +0000
@@ -0,0 +1,48 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4
5 <record id="purchase_order_department_form" model="ir.ui.view">
6 <field name="name">purchase.order.department.form</field>
7 <field name="model">purchase.order</field>
8 <field name="inherit_id" ref="purchase_order_requisitor.inherit_purchase_order_view2"/>
9 <field name="arch" type="xml">
10 <xpath expr="//field[@name='rfq_user_id']" position="after">
11 <field name="department_id"/>
12 </xpath>
13 <xpath expr="//field[@name='rfq_user_id']" position="attributes">
14 <attribute name="on_change">onchange_user_id(rfq_user_id)</attribute>
15 </xpath>
16 </field>
17 </record>
18
19 <record id="purchase_order_department_tree" model="ir.ui.view">
20 <field name="name">purchase.order.department.tree</field>
21 <field name="model">purchase.order</field>
22 <field name="inherit_id" ref="purchase.purchase_order_tree"/>
23 <field name="arch" type="xml">
24 <xpath expr="//field[@name='date_order']" position="after">
25 <field name="department_id"/>
26 </xpath>
27 </field>
28 </record>
29
30 <record id="purchase_order_department_search" model="ir.ui.view">
31 <field name="name">purchase.order.department.search</field>
32 <field name="model">purchase.order</field>
33 <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
34 <field name="arch" type="xml">
35
36 <xpath expr="//field[@name='product_id']" position="after">
37 <field name="department_id"/>
38 </xpath>
39
40 <xpath expr="//group" position="inside">
41 <filter string="Department" icon="terp-personal" context="{'group_by':'department_id'}"/>
42 </xpath>
43
44 </field>
45 </record>
46
47 </data>
48</openerp>
049
=== added directory 'purchase_order_department/wizard'
=== added file 'purchase_order_department/wizard/__init__.py'
--- purchase_order_department/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_order_department/wizard/__init__.py 2014-06-18 21:55:16 +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_order_department/workflow'

Subscribers

People subscribed via source and target branches

to all changes: