Ver Fonte

commit inicial

Rodney Enciso Arias há 8 anos atrás
commit
574a4b43fd

+ 20 - 0
README.rst

@@ -0,0 +1,20 @@
+====================
+Sale order line view
+====================
+
+
+This module creates a new menu option for viewing sales order lines and adds a
+shortcut from Customers to sale order lines.
+
+
+Credits
+=======
+
+
+Contributors
+------------
+* Mikel Arregi <mikelarregi@avanzosc.es>
+* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
+* Esther Martín <esthermartin@avanzosc.es>
+* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
+* Ana Juaristi <anajuaristi@avanzosc.es>

+ 19 - 0
__init__.py

@@ -0,0 +1,19 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from . import models

BIN
__init__.pyc


+ 43 - 0
__openerp__.py

@@ -0,0 +1,43 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+{
+    "name": "Sale order lines view",
+    "version": " 8.0.1.1.0",
+    "author": "OdooMRP team,"
+              "AvanzOSC,"
+              "Serv. Tecnol. Avanzados - Pedro M. Baeza",
+    "website": "http://www.odoomrp.com",
+    "contributors": [
+        "Mikel Arregi <mikelarregi@avanzosc.es>"
+        "Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>",
+        "Esther Martín <esthermartin@avanzosc.es>",
+        "Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
+        "Ana Juaristi <anajuaristi@avanzosc.es>",
+    ],
+    "depends": [
+        "sale",
+    ],
+    "category": "Sales Management",
+    "license": "AGPL-3",
+    "data": [
+        "views/sale_order_line_ext_view.xml",
+        "views/res_partner.xml"
+    ],
+    "installable": True,
+}

+ 46 - 0
i18n/es.po

@@ -0,0 +1,46 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_line_view
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: odoomrp-wip (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-11-20 18:11+0000\n"
+"PO-Revision-Date: 2015-11-04 13:15+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n"
+"Language-Team: Spanish (http://www.transifex.com/oca/odoomrp-wip-8-0/language/es/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: sale_order_line_view
+#: view:sale.order.line:sale_order_line_view.view_sale_order_line_search_view
+msgid "Customer"
+msgstr "Cliente"
+
+#. module: sale_order_line_view
+#: model:ir.model,name:sale_order_line_view.model_res_partner
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: sale_order_line_view
+#: model:ir.actions.act_window,name:sale_order_line_view.action_sale_order_line_newmenu
+#: model:ir.ui.menu,name:sale_order_line_view.sale_order_line_newmenu_menu_view
+msgid "Sale Order Lines"
+msgstr "Líneas de pedido de venta"
+
+#. module: sale_order_line_view
+#: model:ir.actions.act_window,name:sale_order_line_view.action_sale_order_line_tree
+#: view:res.partner:sale_order_line_view.res_partner_order_line_button_form
+#: field:res.partner,order_lines:0
+msgid "Sale order lines"
+msgstr "Líneas de venta"
+
+#. module: sale_order_line_view
+#: view:sale.order.line:sale_order_line_view.view_sale_order_line_search_view
+msgid "Status"
+msgstr "Estado"

+ 48 - 0
i18n/pt_BR.po

@@ -0,0 +1,48 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_line_view
+# 
+# Translators:
+# danimaribeiro <danimaribeiro@gmail.com>, 2015
+# danimaribeiro <danimaribeiro@gmail.com>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: odoomrp-wip (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-11-20 18:11+0000\n"
+"PO-Revision-Date: 2015-11-04 13:15+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n"
+"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/odoomrp-wip-8-0/language/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: sale_order_line_view
+#: view:sale.order.line:sale_order_line_view.view_sale_order_line_search_view
+msgid "Customer"
+msgstr "Cliente"
+
+#. module: sale_order_line_view
+#: model:ir.model,name:sale_order_line_view.model_res_partner
+msgid "Partner"
+msgstr "Parceiro"
+
+#. module: sale_order_line_view
+#: model:ir.actions.act_window,name:sale_order_line_view.action_sale_order_line_newmenu
+#: model:ir.ui.menu,name:sale_order_line_view.sale_order_line_newmenu_menu_view
+msgid "Sale Order Lines"
+msgstr "Linhas do pedido de venda"
+
+#. module: sale_order_line_view
+#: model:ir.actions.act_window,name:sale_order_line_view.action_sale_order_line_tree
+#: view:res.partner:sale_order_line_view.res_partner_order_line_button_form
+#: field:res.partner,order_lines:0
+msgid "Sale order lines"
+msgstr ""
+
+#. module: sale_order_line_view
+#: view:sale.order.line:sale_order_line_view.view_sale_order_line_search_view
+msgid "Status"
+msgstr ""

+ 58 - 0
i18n/sale_order_line_view.pot

@@ -0,0 +1,58 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+#	* sale_order_line_view
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0rc1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-07-28 08:55+0000\n"
+"PO-Revision-Date: 2014-07-28 08:55+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_order_line_view
+#: view:sale.order.line:0
+msgid "Group By..."
+msgstr ""
+
+#. module: sale_order_line_view
+#: view:sale.order.line:0
+msgid "Order"
+msgstr ""
+
+#. module: sale_order_line_view
+#: view:sale.order.line:0
+msgid "Product"
+msgstr ""
+
+#. module: sale_order_line_view
+#: model:ir.actions.act_window,name:sale_order_line_view.action_sale_order_line_newmenu
+#: model:ir.ui.menu,name:sale_order_line_view.sale_order_line_newmenu_menu_view
+msgid "Sale Order Lines"
+msgstr ""
+
+#. module: sale_order_line_view
+#: view:sale.order.line:0
+msgid "Salesman"
+msgstr ""
+
+#. module: sale_order_line_view
+#: view:sale.order.line:0
+msgid "Search Sales Order"
+msgstr ""
+
+#. module: sale_order_line_view
+#: view:sale.order.line:0
+msgid "State"
+msgstr ""
+
+#. module: sale_order_line_view
+#: view:sale.order.line:0
+msgid "To Invoice"
+msgstr ""
+

+ 47 - 0
i18n/sl.po

@@ -0,0 +1,47 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_line_view
+# 
+# Translators:
+# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: odoomrp-wip (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-11-20 18:11+0000\n"
+"PO-Revision-Date: 2015-11-05 06:09+0000\n"
+"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
+"Language-Team: Slovenian (http://www.transifex.com/oca/odoomrp-wip-8-0/language/sl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: sl\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
+
+#. module: sale_order_line_view
+#: view:sale.order.line:sale_order_line_view.view_sale_order_line_search_view
+msgid "Customer"
+msgstr "Kupec"
+
+#. module: sale_order_line_view
+#: model:ir.model,name:sale_order_line_view.model_res_partner
+msgid "Partner"
+msgstr "Partner"
+
+#. module: sale_order_line_view
+#: model:ir.actions.act_window,name:sale_order_line_view.action_sale_order_line_newmenu
+#: model:ir.ui.menu,name:sale_order_line_view.sale_order_line_newmenu_menu_view
+msgid "Sale Order Lines"
+msgstr "Postavke prodajnega naloga"
+
+#. module: sale_order_line_view
+#: model:ir.actions.act_window,name:sale_order_line_view.action_sale_order_line_tree
+#: view:res.partner:sale_order_line_view.res_partner_order_line_button_form
+#: field:res.partner,order_lines:0
+msgid "Sale order lines"
+msgstr "Postavke prodajnega naloga"
+
+#. module: sale_order_line_view
+#: view:sale.order.line:sale_order_line_view.view_sale_order_line_search_view
+msgid "Status"
+msgstr "Status"

+ 5 - 0
models/__init__.py

@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# (c) 2015 Esther Martín <esthermartin@avanzosc.es> - Avanzosc S.L.
+# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
+
+from . import res_partner

BIN
models/__init__.pyc


+ 19 - 0
models/res_partner.py

@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# (c) 2015 Esther Martín <esthermartin@avanzosc.es> - Avanzosc S.L.
+# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
+
+from openerp import models, fields, api
+
+
+class ResPartner(models.Model):
+    _inherit = 'res.partner'
+
+    @api.multi
+    def _sale_order_line_count(self):
+        for partner in self:
+            partner.lines_count = len(partner.order_lines)
+
+    order_lines = fields.One2many('sale.order.line', 'order_partner_id',
+                                  'Sale order lines')
+    lines_count = fields.Integer('Sale order lines',
+                                 compute='_sale_order_line_count')

BIN
models/res_partner.pyc


+ 30 - 0
views/res_partner.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+       <record id="action_sale_order_line_tree" model="ir.actions.act_window">
+            <field name="name">Sale order lines</field>
+            <field name="res_model">sale.order.line</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="domain">[('order_partner_id', '=', active_id)]</field>
+            <field name="context">{'search_default_partner_id': active_id}</field>
+        </record>
+
+        <record id="res_partner_order_line_button_form" model="ir.ui.view">
+            <field name="name">res.partner.order.line.button.form</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_partner_form" />
+            <field name="arch" type="xml">
+                <xpath expr="//div[@name='buttons']" position="inside">
+                    <button class="oe_inline oe_stat_button" type="action"
+                        icon="fa-align-justify"
+                        attrs="{'invisible': [('customer', '=', False)]}"
+                        name="%(sale_order_line_view.action_sale_order_line_tree)d">
+                        <field string="Sale order lines" name="lines_count" widget="statinfo"/>
+                    </button>
+                 </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>
+

+ 29 - 0
views/sale_order_line_ext_view.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="view_sale_order_line_search_view" model="ir.ui.view">
+            <field name="name">sale.order.line.search</field>
+            <field name="model">sale.order.line</field>
+            <field name="inherit_id" ref="sale.view_sales_order_line_filter" />
+            <field name="arch" type="xml">
+                <field name="salesman_id">
+                    <field name="order_partner_id"/>
+                </field>
+                <filter string="Status" position="after">
+                    <filter string="Customer" domain="[]" context="{'group_by':'order_partner_id'}"/>
+                </filter>
+            </field>
+        </record>
+        <record model="ir.actions.act_window" id="action_sale_order_line_newmenu">
+            <field name="name">Sale Order Lines</field>
+            <field name="res_model">sale.order.line</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="search_view_id" ref="sale.view_sales_order_line_filter" />
+        </record>
+
+        <menuitem id="sale_order_line_newmenu_menu_view" name="Sale Order Lines"
+            parent="base.menu_sales" action="action_sale_order_line_newmenu" />
+
+    </data>
+</openerp>