Commits

Carlos Perelló Marín  committed 4cb83ac Merge

Merge from trunk

  • Participants
  • Parent commits c4332fd, 9f25573

Comments (0)

Files changed (9)

 Installing trytond_party_bank
-========================================
+=============================
 
 Prerequisites
 -------------
 
  * Python 2.4 or later (http://www.python.org/)
  * trytond 0.0.x (http://www.tryton.org/)
- * trytond_product (http://www.tryton.org/)
+ * trytond_party (http://www.tryton.org/)
+ * trytond_currency (http://www.tryton.org/)
 
 Installation
 ------------
 
-Once you've downloaded and unpacked a trytond_party source release, enter the
+Once you've downloaded and unpacked a trytond_party_bank source release, enter the
 directory where the archive was unpacked, and run:
 
     python setup.py install
   http://docs.python.org/inst/inst.html
 
 To use without installation, extract the archive into ``trytond/modules`` with
-the directory name party.
+the directory name party_bank.
 trytond_party_bank
 =============================
 
-A german account chart module for the Tryton application platform.
+Module for adding banks to parties for the Tryton application platform.
 See __tryton__.py
 
 Installing
 For more information about Tryton please visit the Tryton web site:
 
   http://www.tryton.org/
+
+For more information about this module please contact virtual things:
+
+  http://virtual-things.biz/
 #this repository contains the full copyright notices and license terms.
 
 from bank import *
+from party import *

File __tryton__.py

     'name': 'Party Bank',
     'name_de_DE': 'Partei Bankverbindungen',
     'name_es_ES': 'Banco de terceros',
-    'version': '0.0.1',
+    'version': '0.0.2',
     'author': 'virtual things',
     'email': 'info@virtual-things.biz',
     'website': 'http://www.virtual-things.biz/',
     ],
     'xml': [
         'bank.xml',
+        'party.xml'
     ],
     'translation': [
         'de_DE.csv',
     'Bank Account'
     _name = 'bank.account'
     _description = __doc__
-    _rec_name = 'full_name'
 
-    full_name = fields.Function('get_full_name', type='char', string='Name')
     code = fields.Char('Account Number', help='National Standard Code')
     iban = fields.Char('IBAN')
     bank = fields.Many2One('bank.bank', 'Bank', required=True,
                             ondelete='CASCADE', required=True)
     owner = fields.Char('Differing Owner')
 
-    def get_full_name(self, cursor, user, ids, name, arg, context=None):
+    def get_rec_name(self, cursor, user, ids, name, arg, context=None):
         res = {}
         for account in self.browse(cursor, user, ids, context=context):
             res[account.id] = ", ".join(x for x in [account.bank.name,
     def on_change_bank(self, cursor, user, ids, vals, context=None):
         bank_obj = self.pool.get('bank.bank')
         res = {}
-        bank = bank_obj.browse(cursor, user, vals.get('bank'),
+        if vals.get('bank'):
+            bank = bank_obj.browse(cursor, user, vals.get('bank'),
                                 context=context)
-        if bank:
-            res['bank_code'] = bank.bank_code
-            res['bic'] = bank.bic
+            if bank:
+                res['bank_code'] = bank.bank_code
+                res['bic'] = bank.bic
         return res
 
 BankAccount()
-
-
-class Party(ModelSQL, ModelView):
-    'Party'
-    _name = 'party.party'
-    _description = __doc__
-
-    bank_accounts = fields.One2Many('bank.account', 'party', 'Bank Accounts')
-
-Party()
         <record model="ir.ui.view" id="bank_view_tree">
             <field name="model">bank.bank</field>
             <field name="type">tree</field>
-            <field name="priority">10</field>
             <field name="arch" type="xml">
                 <![CDATA[
                     <tree string="Banks">
             <field name="view" ref="bank_view_tree"/>
             <field name="act_window" ref="act_bank_view2"/>
         </record>
-        <menuitem parent="menu_bank_view" sequence="50"
+        <menuitem parent="menu_bank_view"
                     action="act_bank_view2" id="menu_bank_view2"/>
-        <record model="ir.ui.view" id="party_bank_view_form">
-            <field name="model">party.party</field>
-            <field name="type">form</field>
-            <field name="inherit" ref="party.party_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/notebook/page[@id=&quot;accounting&quot;]"
-                        position="after">
-                        <page string="Bank Accounts" col="1" id="bank_accounts">
-                            <field name="bank_accounts"/>
-                        </page>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
-        </record>
         <record model="ir.ui.view" id="bank_account_view_form">
             <field name="model">bank.account</field>
             <field name="type">form</field>
+#This file is part of Tryton. The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+from trytond.model import ModelView, ModelSQL, fields
+
+class Party(ModelSQL, ModelView):
+    'Party'
+    _name = 'party.party'
+    _description = __doc__
+
+    bank_accounts = fields.One2Many('bank.account', 'party', 'Bank Accounts')
+
+Party()
+<?xml version="1.0"?>
+<!-- This file is part of Tryton. The COPYRIGHT file at the top level of this
+  repository contains the full copyright notices and license terms. -->
+<tryton>
+    <data>
+        <record model="ir.ui.view" id="party_bank_view_form">
+            <field name="model">party.party</field>
+            <field name="type">form</field>
+            <field name="inherit" ref="party.party_view_form"/>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <data>
+                    <xpath
+                        expr="/form/notebook/page[@id=&quot;accounting&quot;]"
+                        position="after">
+                        <page string="Bank Accounts" col="1" id="bank_accounts">
+                            <field name="bank_accounts"/>
+                        </page>
+                    </xpath>
+                </data>
+                ]]>
+            </field>
+        </record>
+    </data>
+</tryton>
     author=info.get('author', ''),
     author_email=info.get('email', ''),
     url=info.get('website', ''),
+    download_url="http://downloads.tryton.org/" + \
+            info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
     package_dir={'trytond.modules.party_bank': '.'},
     packages=[
         'trytond.modules.party_bank',
     ],
     license='GPL-3',
     install_requires=requires,
+    zip_safe=False,
+    entry_points="""
+    [trytond.modules]
+    party_bank = trytond.modules.party_bank
+    """,
 )