Merge lp:~akretion-team/sale-wkfl/7.0-add-sale_group into lp:~sale-core-editors/sale-wkfl/7.0

Proposed by Raphaël Valyi - http://www.akretion.com
Status: Needs review
Proposed branch: lp:~akretion-team/sale-wkfl/7.0-add-sale_group
Merge into: lp:~sale-core-editors/sale-wkfl/7.0
Diff against target: 205 lines (+174/-0)
6 files modified
sale_group/__init__.py (+1/-0)
sale_group/__openerp__.py (+17/-0)
sale_group/i18n/pt_BR.po (+42/-0)
sale_group/i18n/sale_group.pot (+43/-0)
sale_group/sale.py (+46/-0)
sale_group/sale_view.xml (+25/-0)
To merge this branch: bzr merge lp:~akretion-team/sale-wkfl/7.0-add-sale_group
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza Needs Resubmitting
Leonardo Pistone Needs Fixing
Yannick Vaucher @ Camptocamp Needs Fixing
Review via email: mp+201017@code.launchpad.net

Description of the change

Adds the very simple sale_group module that adds a group_id on sale.order.line
groups belong to an account.analytic.account and hence to a project.

This module could have been added to sale_report project instead, but in fact, I will next push another module (sale_import_lines) that depends on this one and that makes much more sense in this project, so it's better not mixing project dependencies.

To post a comment you must log in.
Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hi Raph,
Can you just update the __openerp__.py file with the OpenERP V7 still (removing xml_demo, xml_update... with data...)

Otherwise it's good for me

Thanks

34. By Raphaël Valyi - http://www.akretion.com

[REF] udate_xml -> data in __openerp__.py

35. By Raphaël Valyi - http://www.akretion.com

[REF] relative import style

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Can you add the .pot alongside the existing .po file please? Apart that, LGTM
Thanks

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

As stated by Guewen, pot file is missing

review: Needs Fixing
36. By Raphaël Valyi - http://www.akretion.com

[FIX] fixed typo in __openerp__.py

37. By Raphaël Valyi - http://www.akretion.com

[ADD] added missing translation .pot

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

.pot added, is that OK for you now?
as a reminder, once we do this merge, we will also be able to proceed with that other one:
https://code.launchpad.net/~akretion-team/sale-wkfl/7.0-add-sale_import_lines/+merge/201021

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Raphaël,

__openerp__.py:

- The description could be expanded a bit, maybe mentioning the reverse dependency on sale_import_lines.
- Description: "groups that belongs". That sentence could be rewritten, in fact :)
- we don't need init_xml, demo_xml.
- category is empty.

Apart from these small things, if eveything passes pep8 (can you check please? ) it LGTM, thanks.

review: Needs Fixing
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

This project is now hosted on https://github.com/OCA/sale-workflow. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting

Unmerged revisions

37. By Raphaël Valyi - http://www.akretion.com

[ADD] added missing translation .pot

36. By Raphaël Valyi - http://www.akretion.com

[FIX] fixed typo in __openerp__.py

35. By Raphaël Valyi - http://www.akretion.com

[REF] relative import style

34. By Raphaël Valyi - http://www.akretion.com

[REF] udate_xml -> data in __openerp__.py

33. By Raphaël Valyi - http://www.akretion.com

[REF] PEP8

32. By Raphaël Valyi - http://www.akretion.com

[REF] sale_group now depends only on sale module (not base_project_costing anymore) and the group os related to the analytic account, not the project

31. By Florian da Costa

[ADD] Brazilian Portuguese translation

30. By Akretion Bot <email address hidden>

[IMP] cosmetic changes

29. By Akretion Bot <email address hidden>

[IMP] proper ordering

28. By Akretion Bot <email address hidden>

[FIX]

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'sale_group'
2=== added file 'sale_group/__init__.py'
3--- sale_group/__init__.py 1970-01-01 00:00:00 +0000
4+++ sale_group/__init__.py 2014-05-02 16:03:40 +0000
5@@ -0,0 +1,1 @@
6+from . import sale
7
8=== added file 'sale_group/__openerp__.py'
9--- sale_group/__openerp__.py 1970-01-01 00:00:00 +0000
10+++ sale_group/__openerp__.py 2014-05-02 16:03:40 +0000
11@@ -0,0 +1,17 @@
12+{
13+ "name": "Sale Order Line Group",
14+ "version": "1.0",
15+ "author": "Akretion",
16+ "website": "http://www.openerp.com",
17+ "category": "",
18+ "depends": ["sale"],
19+ "description": "Simple module allowing you to order your sale order lines with groups that belongs to the order analytic account, that is that indirectly belongs to sale order project.",
20+ "init_xml": [],
21+ "demo_xml": [],
22+ "test": [],
23+ "data": ["sale_view.xml",],
24+ 'images': [],
25+ 'installable': True,
26+ 'active': False,
27+ 'certificate': None,
28+}
29
30=== added directory 'sale_group/i18n'
31=== added file 'sale_group/i18n/pt_BR.po'
32--- sale_group/i18n/pt_BR.po 1970-01-01 00:00:00 +0000
33+++ sale_group/i18n/pt_BR.po 2014-05-02 16:03:40 +0000
34@@ -0,0 +1,42 @@
35+# Translation of OpenERP Server.
36+# This file contains the translation of the following modules:
37+# * sale_group
38+#
39+msgid ""
40+msgstr ""
41+"Project-Id-Version: OpenERP Server 6.1\n"
42+"Report-Msgid-Bugs-To: \n"
43+"POT-Creation-Date: 2013-06-10 18:21+0000\n"
44+"PO-Revision-Date: 2013-06-10 18:21+0000\n"
45+"Last-Translator: <>\n"
46+"Language-Team: \n"
47+"MIME-Version: 1.0\n"
48+"Content-Type: text/plain; charset=UTF-8\n"
49+"Content-Transfer-Encoding: \n"
50+"Plural-Forms: \n"
51+
52+#. module: sale_group
53+#: field:sale.order.line.group,project_id:0
54+msgid "Project name"
55+msgstr "Nome do Projeto"
56+
57+#. module: sale_group
58+#: field:sale.order.line.group,name:0
59+msgid "Group Name"
60+msgstr "Nome du Grupo"
61+
62+#. module: sale_group
63+#: model:ir.model,name:sale_group.model_sale_order_line_group
64+msgid "sale.order.line.group"
65+msgstr "sale.order.line.group"
66+
67+#. module: sale_group
68+#: field:sale.order.line,group_id:0
69+msgid "Group"
70+msgstr "Grupo"
71+
72+#. module: sale_group
73+#: model:ir.model,name:sale_group.model_sale_order_line
74+msgid "Sales Order Line"
75+msgstr "Linha de Pedido de Vendas"
76+
77
78=== added file 'sale_group/i18n/sale_group.pot'
79--- sale_group/i18n/sale_group.pot 1970-01-01 00:00:00 +0000
80+++ sale_group/i18n/sale_group.pot 2014-05-02 16:03:40 +0000
81@@ -0,0 +1,43 @@
82+# Translation of OpenERP Server.
83+# This file contains the translation of the following modules:
84+# * sale_group
85+#
86+msgid ""
87+msgstr ""
88+"Project-Id-Version: OpenERP Server 7.0\n"
89+"Report-Msgid-Bugs-To: \n"
90+"POT-Creation-Date: 2014-05-02 15:57+0000\n"
91+"PO-Revision-Date: 2014-05-02 15:57+0000\n"
92+"Last-Translator: <>\n"
93+"Language-Team: \n"
94+"MIME-Version: 1.0\n"
95+"Content-Type: text/plain; charset=UTF-8\n"
96+"Content-Transfer-Encoding: \n"
97+"Plural-Forms: \n"
98+
99+#. module: sale_group
100+#: field:sale.order.line.group,analytic_account_id:0
101+msgid "Analytic Account"
102+msgstr ""
103+
104+#. module: sale_group
105+#: field:sale.order.line.group,name:0
106+msgid "Group Name"
107+msgstr ""
108+
109+#. module: sale_group
110+#: model:ir.model,name:sale_group.model_sale_order_line_group
111+msgid "sale.order.line.group"
112+msgstr ""
113+
114+#. module: sale_group
115+#: field:sale.order.line,group_id:0
116+msgid "Group"
117+msgstr ""
118+
119+#. module: sale_group
120+#: model:ir.model,name:sale_group.model_sale_order_line
121+msgid "Sales Order Line"
122+msgstr ""
123+
124+
125
126=== added file 'sale_group/sale.py'
127--- sale_group/sale.py 1970-01-01 00:00:00 +0000
128+++ sale_group/sale.py 2014-05-02 16:03:40 +0000
129@@ -0,0 +1,46 @@
130+# -*- encoding: utf-8 -*-
131+###############################################################################
132+# #
133+# Copyright (C) 2013 Raphaël Valyi - Akretion #
134+# #
135+#This program is free software: you can redistribute it and/or modify #
136+#it under the terms of the GNU Affero General Public License as published by #
137+#the Free Software Foundation, either version 3 of the License, or #
138+#(at your option) any later version. #
139+# #
140+#This program is distributed in the hope that it will be useful, #
141+#but WITHOUT ANY WARRANTY; without even the implied warranty of #
142+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
143+#GNU Affero General Public License for more details. #
144+# #
145+#You should have received a copy of the GNU Affero General Public License #
146+#along with this program. If not, see <http://www.gnu.org/licenses/>. #
147+###############################################################################
148+
149+
150+from osv import orm, fields
151+
152+class sale_order_line(orm.Model):
153+ _inherit = "sale.order.line"
154+
155+ _columns = {
156+ 'group_id': fields.many2one('sale.order.line.group', 'Group'),
157+ }
158+
159+ _order = 'sequence, group_id, id'
160+
161+
162+class sale_order_line_group(orm.Model):
163+ _name = "sale.order.line.group"
164+
165+ _columns = {
166+ 'name': fields.char("Group Name", size=64, required=True),
167+ 'analytic_account_id': fields.many2one('account.analytic.account',
168+ 'Analytic Account',
169+ required=True),
170+ }
171+
172+ _defaults = {
173+ 'analytic_account_id': lambda self, cr, uid,
174+ c: c.get('analytic_account_id')
175+ }
176
177=== added file 'sale_group/sale_view.xml'
178--- sale_group/sale_view.xml 1970-01-01 00:00:00 +0000
179+++ sale_group/sale_view.xml 2014-05-02 16:03:40 +0000
180@@ -0,0 +1,25 @@
181+<?xml version="1.0" encoding="UTF-8"?>
182+
183+<openerp>
184+ <data>
185+ <record model="ir.ui.view" id="view_sale_order_line_form">
186+ <field name="name">sale.order.line.form</field>
187+ <field name="model">sale.order</field>
188+ <field name="type">form</field>
189+ <field name="inherit_id" ref="sale.view_order_form"/>
190+ <field name="arch" type="xml">
191+ <xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="before">
192+ <field name="group_id" context="{'analytic_account_id': parent.project_id}" domain="[('analytic_account_id', '=', parent.project_id)]" groups="sale.group_analytic_accounting"/>
193+ </xpath>
194+
195+ <xpath expr="//field[@name='order_line']/form/label[@for='name']" position="before">
196+ <group>
197+ <group>
198+ <field name="group_id" context="{'analytic_account_id': parent.project_id}" domain="[('analytic_account_id', '=', parent.project_id)]" groups="sale.group_analytic_accounting"/>
199+ </group>
200+ </group>
201+ </xpath>
202+ </field>
203+ </record>
204+ </data>
205+</openerp>

Subscribers

People subscribed via source and target branches