← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~akretion-team/sale-reports/7.0-add-sale_group into lp:sale-reports

 

Raphaël Valyi - http://www.akretion.com has proposed merging lp:~akretion-team/sale-reports/7.0-add-sale_group into lp:sale-reports.

Requested reviews:
  Sale Core Editors (sale-core-editors)

For more details, see:
https://code.launchpad.net/~akretion-team/sale-reports/7.0-add-sale_group/+merge/200881

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.
-- 
https://code.launchpad.net/~akretion-team/sale-reports/7.0-add-sale_group/+merge/200881
Your team Sale Core Editors is requested to review the proposed merge of lp:~akretion-team/sale-reports/7.0-add-sale_group into lp:sale-reports.
=== added directory 'sale_group'
=== added file 'sale_group/__init__.py'
--- sale_group/__init__.py	1970-01-01 00:00:00 +0000
+++ sale_group/__init__.py	2014-01-08 18:36:14 +0000
@@ -0,0 +1,1 @@
+import sale

=== added file 'sale_group/__openerp__.py'
--- sale_group/__openerp__.py	1970-01-01 00:00:00 +0000
+++ sale_group/__openerp__.py	2014-01-08 18:36:14 +0000
@@ -0,0 +1,17 @@
+{
+    "name": "Sale Order Line Group",
+    "version": "1.0",
+    "author": "Akretion",
+    "website": "http://www.openerp.com";,
+    "category": "",
+    "depends": ["project","sale","base_project_costing"],
+    "description": "",
+    "init_xml": [],
+    "demo_xml": [],
+    "test": [],
+    "update_xml": ["sale_view.xml",],
+    'images': [],
+    'installable': True,
+    'active': False,
+    'certificate': None,
+}

=== added directory 'sale_group/i18n'
=== added file 'sale_group/i18n/pt_BR.po'
--- sale_group/i18n/pt_BR.po	1970-01-01 00:00:00 +0000
+++ sale_group/i18n/pt_BR.po	2014-01-08 18:36:14 +0000
@@ -0,0 +1,42 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* sale_group
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-06-10 18:21+0000\n"
+"PO-Revision-Date: 2013-06-10 18:21+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: sale_group
+#: field:sale.order.line.group,project_id:0
+msgid "Project name"
+msgstr "Nome do Projeto"
+
+#. module: sale_group
+#: field:sale.order.line.group,name:0
+msgid "Group Name"
+msgstr "Nome du Grupo"
+
+#. module: sale_group
+#: model:ir.model,name:sale_group.model_sale_order_line_group
+msgid "sale.order.line.group"
+msgstr "sale.order.line.group"
+
+#. module: sale_group
+#: field:sale.order.line,group_id:0
+msgid "Group"
+msgstr "Grupo"
+
+#. module: sale_group
+#: model:ir.model,name:sale_group.model_sale_order_line
+msgid "Sales Order Line"
+msgstr "Linha de Pedido de Vendas"
+

=== added file 'sale_group/sale.py'
--- sale_group/sale.py	1970-01-01 00:00:00 +0000
+++ sale_group/sale.py	2014-01-08 18:36:14 +0000
@@ -0,0 +1,25 @@
+import netsvc
+from osv import osv, fields
+
+class sale_order_line(osv.osv):
+    _inherit = "sale.order.line"
+
+    _columns = {
+        'group_id': fields.many2one('sale.order.line.group', 'Group'),
+    }
+
+    _order = 'sequence, group_id, id'
+
+
+class sale_order_line_group(osv.osv):
+    _name = "sale.order.line.group"
+
+    _columns = {
+        'name': fields.char("Group Name", size=64, required=True),
+        'project_id': fields.many2one('project.project','Project name', required=True,),
+    }
+
+    _defaults = {
+        'project_id': lambda self, cr, uid, c: c.get('project_id')
+    }
+

=== added file 'sale_group/sale_view.xml'
--- sale_group/sale_view.xml	1970-01-01 00:00:00 +0000
+++ sale_group/sale_view.xml	2014-01-08 18:36:14 +0000
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="view_sale_order_line_form">
+
+            <field name="name">sale.order.line.form</field>
+            <field name="model">sale.order</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="sale.view_order_form"/>
+            <field name="arch" type="xml">
+            <xpath expr="/form/notebook/page/field/tree/field[@name='name']" position="before">
+                <field name="group_id"/>
+            </xpath>
+            <xpath expr="/form/notebook/page/field[@name='order_line']/form/notebook/page/group/field[@name='name']" position="after">
+                <field name="group_id" context="{'project_id': parent.true_project_id}" domain="[('project_id', '=', parent.true_project_id)]"/>
+            </xpath>
+            </field>
+    </record>
+
+    </data>
+</openerp>


Follow ups