[FIX]: fix a domian for the supplier vouchers
authorMantavya Gajjar <mga@tinyerp.com>
Thu, 23 Sep 2010 07:35:58 +0000 (13:05 +0530)
committerMantavya Gajjar <mga@tinyerp.com>
Thu, 23 Sep 2010 07:35:58 +0000 (13:05 +0530)
bzr revid: mga@tinyerp.com-20100923073558-zkm9kx91pxfdpdfd

addons/account_voucher/voucher.py
addons/account_voucher/voucher_payment_receipt_view.xml
addons/account_voucher/voucher_sales_purchase_view.xml

index 4b84571..1b36fbe 100644 (file)
@@ -63,6 +63,8 @@ class account_voucher(osv.osv):
             return context.get('search_default_journal_id')
         
         ttype = context.get('type', 'bank')
+        if ttype in ('payment', 'receipt'):
+            ttype = 'bank'
         res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
         return res and res[0] or False
 
index 5fc9b51..2d4d7d7 100644 (file)
             <field name="arch" type="xml">
                 <form string="Bill Payment">
                     <group col="6" colspan="4">
-                        <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" context="{'invoice_currency':currency_id}" string="Vendor"/>
+                        <field name="partner_id" domain="[('supplier','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" context="{'invoice_currency':currency_id}" string="Vendor"/>
                         <field name="journal_id"
                             domain="[('type','in',['bank', 'cash'])]"
                             widget="selection" select="1"
index b72faa4..9ccebbd 100644 (file)
             <field name="arch" type="xml">
                 <form string="Vendor Bills">
                     <group col="6" colspan="4">
-                        <field name="partner_id" required="1" string="Vendor" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
+                        <field name="partner_id" domain="[('supplier','=',True)]" required="1" string="Vendor" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
                         <field name="journal_id" domain="[('type','in',['purchase','purchase_refund'])]" widget="selection" select="1" on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id)"/>
                         <field name="number"/>
                         <field name="name" colspan="4"/>