Sebas 6 gadi atpakaļ
revīzija
b9df7324e4
7 mainītis faili ar 141 papildinājumiem un 0 dzēšanām
  1. 22 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 40 0
      __openerp__.py
  4. 25 0
      res_partner.py
  5. BIN
      res_partner.pyc
  6. 54 0
      res_partner_view.xml
  7. BIN
      static/description/icon.png

+ 22 - 0
__init__.py

@@ -0,0 +1,22 @@
+# -*- 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/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product Brand is an Openobject module wich enable Brand management for products #
+###################################################################################
+from . import res_partner

BIN
__init__.pyc


+ 40 - 0
__openerp__.py

@@ -0,0 +1,40 @@
+# -*- 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/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product features is an Openobject module wich enable features management for products #
+###################################################################################
+{
+    'name': 'Smarticon para Point of Sale',
+    'version': '0.1',
+    'category': 'Point of Sale',
+    'description': """
+Smarticon para Point of Sale
+========================================
+
+Smarticon para Point of Sale
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': '',
+	'depends': ['report','point_of_sale','base'],
+    'data': [
+		'res_partner_view.xml',
+    ],
+    'installable': True,
+}

+ 25 - 0
res_partner.py

@@ -0,0 +1,25 @@
+
+# -*- coding: utf-8 -*-
+##############################################################################
+
+from openerp.osv import fields,osv
+
+class res_partner(osv.osv):
+    _inherit = 'res.partner'
+
+    def _pos_order_count(self, cr, uid, ids, field_name, arg, context=None):
+        res = dict(map(lambda x: (x,0), ids))
+
+        try:
+            for partner in self.browse(cr, uid, ids, context):
+                res[partner.id] = len(partner.pos_order_ids)
+        except:
+            pass
+        return res
+
+    _columns = {
+        'pos_order_count': fields.function(_pos_order_count, string='# Pos Order', type='integer'),
+        'pos_order_ids': fields.one2many('pos.order', 'partner_id', 'Pos Order')
+    }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
res_partner.pyc


+ 54 - 0
res_partner_view.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+
+        <record id="act_res_partner_2_pos_order" model="ir.actions.act_window">
+            <field name="name">Pos</field>
+            <field name="res_model">pos.order</field>
+            <field name="view_mode">tree,form</field>
+            <field name="context">{'search_default_partner_id': active_id}</field>
+            <field name="view_id" eval="False"/>
+            <field name="search_view_id" ref="point_of_sale.view_pos_order_filter"/>
+        </record>
+
+        <!-- Partner kanban view inherte -->
+         <record model="ir.ui.view" id="point_sale_partner_kanban_view">
+             <field name="name">point.sale.kanban.saleorder.inherit</field>
+             <field name="model">res.partner</field>
+             <field name="inherit_id" ref="base.res_partner_kanban_view"/>
+             <field name="priority" eval="20"/>
+             <field name="arch" type="xml">
+                   <field name="mobile" position="after">
+                       <field name="pos_order_count"/>
+                   </field>
+                   <xpath expr="//div[@class='oe_kanban_partner_links']" position="inside">
+                       <a name="%(smarticon_pos.act_res_partner_2_pos_order)d" type="action" t-if="record.pos_order_count.value>0">
+                           <t t-esc="record.pos_order_count.value"/> Pos
+                       </a>
+                   </xpath>
+               </field>
+         </record>
+
+        <!--  Partners inherited form -->
+        <record model="ir.ui.view" id="view_pos_partner_info_form">
+            <field name="name">res.partner.pos.buttons</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_partner_form"/>
+            <field name="priority" eval="50"/>
+            <field name="arch" type="xml">
+                <xpath expr="//div[@name='buttons']" position="inside">
+                    <button
+                        class="oe_inline oe_stat_button"
+                        type="action"
+                        name="%(smarticon_pos.act_res_partner_2_pos_order)d"
+                        attrs="{'invisible': [('customer', '=', False)]}"
+                        icon="fa-strikethrough"
+                        context="{'search_default_partner_id': active_id}">
+                        <field string="Pos" name="pos_order_count" widget="statinfo"/>
+                    </button>
+                </xpath>
+            </field>
+       </record>
+
+    </data>
+</openerp>

BIN
static/description/icon.png