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

Proposed by Raphaël Valyi - http://www.akretion.com
Status: Rejected
Rejected by: Raphaël Valyi - http://www.akretion.com
Proposed branch: lp:~akretion-team/sale-reports/7.0-add-sale_group
Merge into: lp:~sale-core-editors/sale-reports/7.0
Diff against target: 154 lines (+128/-0)
5 files modified
sale_group/__init__.py (+1/-0)
sale_group/__openerp__.py (+17/-0)
sale_group/i18n/pt_BR.po (+42/-0)
sale_group/sale.py (+43/-0)
sale_group/sale_view.xml (+25/-0)
To merge this branch: bzr merge lp:~akretion-team/sale-reports/7.0-add-sale_group
Reviewer Review Type Date Requested Status
Sale Core Editors Pending
Review via email: mp+200881@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.

To post a comment you must log in.
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

as a second though, I think this module and coming sale_import_lines modules are better suited for the sale-wkf project, so the merge moved to there https://code.launchpad.net/~akretion-team/sale-wkfl/7.0-add-sale_group/+merge/201017

Unmerged revisions

31. 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

30. By Florian da Costa

[ADD] Brazilian Portuguese translation

29. By Akretion Bot <email address hidden>

[IMP] cosmetic changes

28. By Akretion Bot <email address hidden>

[IMP] proper ordering

27. By Akretion Bot <email address hidden>

[FIX]

26. By Florent Berteau - http://www.akretion.com

fix domain

25. By Florent Berteau - http://www.akretion.com

initial commit

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-01-08 18:37:10 +0000
5@@ -0,0 +1,1 @@
6+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-01-08 18:37:10 +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 belngs to the order analytic account, that is that indirectly belongs to sale order project.",
20+ "init_xml": [],
21+ "demo_xml": [],
22+ "test": [],
23+ "update_xml": ["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-01-08 18:37:10 +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/sale.py'
79--- sale_group/sale.py 1970-01-01 00:00:00 +0000
80+++ sale_group/sale.py 2014-01-08 18:37:10 +0000
81@@ -0,0 +1,43 @@
82+# -*- encoding: utf-8 -*-
83+###############################################################################
84+# #
85+# Copyright (C) 2013 Raphaël Valyi - Akretion #
86+# #
87+#This program is free software: you can redistribute it and/or modify #
88+#it under the terms of the GNU Affero General Public License as published by #
89+#the Free Software Foundation, either version 3 of the License, or #
90+#(at your option) any later version. #
91+# #
92+#This program is distributed in the hope that it will be useful, #
93+#but WITHOUT ANY WARRANTY; without even the implied warranty of #
94+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
95+#GNU Affero General Public License for more details. #
96+# #
97+#You should have received a copy of the GNU Affero General Public License #
98+#along with this program. If not, see <http://www.gnu.org/licenses/>. #
99+###############################################################################
100+
101+
102+from osv import orm, fields
103+
104+class sale_order_line(orm.Model):
105+ _inherit = "sale.order.line"
106+
107+ _columns = {
108+ 'group_id': fields.many2one('sale.order.line.group', 'Group'),
109+ }
110+
111+ _order = 'sequence, group_id, id'
112+
113+
114+class sale_order_line_group(orm.Model):
115+ _name = "sale.order.line.group"
116+
117+ _columns = {
118+ 'name': fields.char("Group Name", size=64, required=True),
119+ 'analytic_account_id': fields.many2one('account.analytic.account','Analytic Account', required=True,),
120+ }
121+
122+ _defaults = {
123+ 'analytic_account_id': lambda self, cr, uid, c: c.get('analytic_account_id')
124+ }
125
126=== added file 'sale_group/sale_view.xml'
127--- sale_group/sale_view.xml 1970-01-01 00:00:00 +0000
128+++ sale_group/sale_view.xml 2014-01-08 18:37:10 +0000
129@@ -0,0 +1,25 @@
130+<?xml version="1.0" encoding="UTF-8"?>
131+
132+<openerp>
133+ <data>
134+ <record model="ir.ui.view" id="view_sale_order_line_form">
135+ <field name="name">sale.order.line.form</field>
136+ <field name="model">sale.order</field>
137+ <field name="type">form</field>
138+ <field name="inherit_id" ref="sale.view_order_form"/>
139+ <field name="arch" type="xml">
140+ <xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="before">
141+ <field name="group_id" context="{'analytic_account_id': parent.project_id}" domain="[('analytic_account_id', '=', parent.project_id)]" groups="sale.group_analytic_accounting"/>
142+ </xpath>
143+
144+ <xpath expr="//field[@name='order_line']/form/label[@for='name']" position="before">
145+ <group>
146+ <group>
147+ <field name="group_id" context="{'analytic_account_id': parent.project_id}" domain="[('analytic_account_id', '=', parent.project_id)]" groups="sale.group_analytic_accounting"/>
148+ </group>
149+ </group>
150+ </xpath>
151+ </field>
152+ </record>
153+ </data>
154+</openerp>

Subscribers

People subscribed via source and target branches