Browse Source

FIX NEW Smarticon referentes en movimientos bancarios en clientes

Sebas 6 năm trước cách đây
commit
8710ab4ed2
8 tập tin đã thay đổi với 161 bổ sung0 xóa
  1. 22 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 40 0
      __openerp__.py
  4. 18 0
      res_bank_view.xml
  5. 27 0
      res_partner.py
  6. BIN
      res_partner.pyc
  7. 54 0
      res_partner_view.xml
  8. 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/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+
+###################################################################################
+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/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+###################################################################################
+{
+    'name': 'Smarticon para Operaciones Bancarias',
+    'version': '0.1',
+    'category': 'Bank',
+    'description': """
+Smarticon para Operaciones Bancarias
+========================================
+
+Smarticon para Operaciones Bancarias
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': '',
+	'depends': ['report','eiru_bank_payments_references','base'],
+    'data': [
+		'res_partner_view.xml',
+        'res_bank_view.xml',
+    ],
+    'installable': True,
+}

+ 18 - 0
res_bank_view.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_bank_statementfilter_search1" model="ir.ui.view">
+            <field name="name">account.bank.filter.search1</field>
+            <field name="model">res.bank.payments</field>
+            <field name="inherit_id" ref="eiru_bank_payments_references.eiru_bank_payments_references_res_bank_line_search"/>
+            <field name="arch" type="xml">
+              <search>
+                  <field name="partner_id" operator="child_of"/>
+               </search>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>

+ 27 - 0
res_partner.py

@@ -0,0 +1,27 @@
+
+# -*- coding: utf-8 -*-
+##############################################################################
+
+from openerp.osv import fields,osv
+
+class res_partner(osv.osv):
+    _inherit = 'res.partner'
+
+    def _bank_payment_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):
+                operator = '='
+                bank_payment_ids = self.pool['res.bank.payments'].search(cr, uid, [('partner_id', operator, partner.id)], context=context)
+                res[partner.id] =  len(partner.bank_payment_ids)
+        except:
+            pass
+        return res
+
+    _columns = {
+        'bank_payment_count': fields.function(_bank_payment_count, string='# Oper. Bancarias', type='integer'),
+        'bank_payment_ids': fields.one2many('res.bank.payments', 'partner_id', 'Oper. Bancarias')
+    }
+
+# 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_bank_statement" model="ir.actions.act_window">
+            <field name="name">Operaciones Bancarias</field>
+            <field name="res_model">res.bank.payments</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="eiru_bank_payments_references.eiru_bank_payments_references_res_bank_line_search"/>
+        </record>
+
+        <!-- Partner kanban view inherte -->
+         <record model="ir.ui.view" id="bank_statement_partner_kanban_view">
+             <field name="name">bank.statement.kanban.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="bank_payment_count"/>
+                   </field>
+                   <xpath expr="//div[@class='oe_kanban_partner_links']" position="inside">
+                       <a name="%(act_res_partner_2_bank_statement)d" type="action" t-if="record.bank_payment_count.value>0">
+                           <t t-esc="record.bank_payment_count.value"/> Operaciones
+                       </a>
+                   </xpath>
+               </field>
+         </record>
+
+        <!--  Partners inherited form -->
+        <record model="ir.ui.view" id="view_bank_partner_info_form">
+            <field name="name">res.partner.bank.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="%(act_res_partner_2_bank_statement)d"
+                        attrs="{'invisible': [('customer', '=', False)]}"
+                        icon="fa-strikethrough"
+                        context="{'search_default_partner_id': active_id}">
+                        <field string="Oper. Bancarias" name="bank_payment_count" widget="statinfo"/>
+                    </button>
+                </xpath>
+            </field>
+       </record>
+
+    </data>
+</openerp>

BIN
static/description/icon.png