bugfix_domain_account
authorFabien Pinckaers <fp@tinyerp.com>
Sun, 18 Jan 2009 22:54:41 +0000 (23:54 +0100)
committerFabien Pinckaers <fp@tinyerp.com>
Sun, 18 Jan 2009 22:54:41 +0000 (23:54 +0100)
bzr revid: fp@tinyerp.com-20090118225441-hpgtxa6l9r9rq2re

addons/account/account.py
addons/account/account_view.xml

index 28d0d17..8191c4b 100644 (file)
@@ -1231,7 +1231,8 @@ class account_tax(osv.osv):
         'amount': fields.float('Amount', required=True, digits=(14,4)),
         'active': fields.boolean('Active'),
         'type': fields.selection( [('percent','Percent'), ('fixed','Fixed'), ('none','None'), ('code','Python Code')], 'Tax Type', required=True),
-        'applicable_type': fields.selection( [('true','True'), ('code','Python Code')], 'Applicable Type', required=True),
+        'applicable_type': fields.selection( [('true','True'), ('code','Python Code')], 'Applicable Type', required=True,
+            help="If not applicable (computed through a Python code), the tax do not appears on the invoice."),
         'domain':fields.char('Domain', size=32, help="This field is only used if you develop your own module allowing developpers to create specific taxes in a custom domain."),
         'account_collected_id':fields.many2one('account.account', 'Invoice Tax Account'),
         'account_paid_id':fields.many2one('account.account', 'Refund Tax Account'),
index 42fa70c..b787b46 100644 (file)
                         <page string="General Information">
                             <field name="view_id"/>
                             <field name="sequence_id"/>
-                            <field name="default_debit_account_id" attrs="{'required':[('type','=','cash')]}"/>
-                            <field name="default_credit_account_id" attrs="{'required':[('type','=','cash')]}"/>
+                            <field name="default_debit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
+                            <field name="default_credit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
                             <field name="currency"/>
                             <field name="user_id" groups="base.group_extended"/>
                             <newline/>
                     <field colspan="4" domain="[('partner_id','=',context.get('partner_id', False)),('state','=','valid'),('account_id','=',context.get('account_id', False)),('reconcile_id', '=', False)]" name="line_ids" nolabel="1" view_mode="tree"/>
                     <field colspan="4" name="line_new_ids" nolabel="1">
                         <tree editable="bottom" string="Write-Off">
-                            <field name="account_id"/>
+                            <field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
                             <field name="amount"/>
                             <field name="name"/>
                         </tree>
                     <field name="invoice"/>
                     <field name="name"/>
                     <field name="partner_id"/>
-                    <field name="account_id"/>
+                    <field name="account_id" domain="[('journal_id','=',journal_id)]"/>
                     <field name="journal_id"/>
                     <field name="debit" sum="Total debit"/>
                     <field name="credit" sum="Total credit"/>
                             <field name="date" select="1"/>
                             <field name="ref" select="2"/>
                             <field name="invoice" select="2"/>
-                            <field name="account_id" select="1"/>
+                            <field name="account_id" select="1" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
                             <field name="partner_id" select="1" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
 
                             <field name="debit" select="2"/>
                             <field name="date" select="2"/>
                             <field name="journal_id" readonly="False" select="1"/>
                             <field name="period_id" readonly="False" select="2"/>
-                            <field name="account_id" select="1"/>
+                            <field name="account_id" select="1" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
                             <field name="partner_id" select="2" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
                             <newline/>
                             <field name="debit" select="2"/>
                         <form string="Account Entry Line">
                             <separator colspan="4" string="General Information"/>
                             <field name="name" select="1"/>
-                            <field name="account_id"/>
+                            <field name="account_id" domain="[('journal_id','=',parent.journal_id)]"/>
                             <field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,parent.date,parent.journal_id)"/>
 
                             <field name="debit" select="1"/>
                             <field name="invoice"/>
                             <field name="name"/>
                             <field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,parent.date,parent.journal_id)"/>
-                            <field name="account_id"/>
+                            <field name="account_id" domain="[('journal_id','=',parent.journal_id)]"/>
                             <field name="date_maturity"/>
                             <field name="debit" sum="Total Debit"/>
                             <field name="credit" sum="Total Credit"/>
                     <field colspan="4" name="name" select="1"/>
                     <field name="sequence"/>
                     <field name="ref" select="1"/>
-                    <field name="account_id"/>
+                    <field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
                     <field name="partner_id"/>
                     <field name="debit" select="1"/>
                     <field name="credit" select="1"/>