[MERGE] merged the dev3 branch
bzr revid: qdp-launchpad@tinyerp.com-20110120122320-pve8hcz3pvc6ttgw
This commit is contained in:
@@ -2616,7 +2616,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
chart_template_id = ids[0]
|
||||
purchase_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id"
|
||||
, "=", chart_template_id), ('type_tax_use', 'in', ('purchase','all'))], order="sequence")
|
||||
return purchase_tax_ids[0]
|
||||
return purchase_tax_ids and purchase_tax_ids[0] or False
|
||||
return False
|
||||
|
||||
def _get_sale_tax(self, cr, uid, context=None):
|
||||
@@ -2625,7 +2625,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
chart_template_id = ids[0]
|
||||
sale_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id"
|
||||
, "=", chart_template_id), ('type_tax_use', 'in', ('sale','all'))], order="sequence")
|
||||
return sale_tax_ids[0]
|
||||
return sale_tax_ids and sale_tax_ids[0] or False
|
||||
return False
|
||||
|
||||
def _get_chart(self, cr, uid, context=None):
|
||||
|
||||
@@ -190,6 +190,7 @@
|
||||
<field name="tax_line" nolabel="1">
|
||||
<tree editable="bottom" string="Taxes">
|
||||
<field name="name"/>
|
||||
<field name="account_id" groups="account.group_account_invoice"/>
|
||||
<field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
|
||||
<field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
|
||||
|
||||
@@ -284,7 +285,8 @@
|
||||
<field name="tax_line" nolabel="1">
|
||||
<tree editable="bottom" string="Taxes">
|
||||
<field name="name"/>
|
||||
<field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
|
||||
<field name="account_id" groups="account.group_account_invoice"/>
|
||||
<field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
|
||||
<field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
|
||||
<field invisible="True" name="base_amount"/>
|
||||
<field invisible="True" name="tax_amount"/>
|
||||
|
||||
@@ -588,18 +588,10 @@ class account_move_line(osv.osv):
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_partner_id(self, cr, uid, ids, context=None):
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.account_id.type in ('receivable', 'payable') and not l.partner_id:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_no_view, 'You can not create move line on view account.', ['account_id']),
|
||||
(_check_no_closed, 'You can not create move line on closed account.', ['account_id']),
|
||||
(_check_company_id, 'Company must be same for its related account and period.',['company_id'] ),
|
||||
(_check_partner_id, 'You can not create move line on receivable/payable account without partner', ['account_id'] )
|
||||
]
|
||||
|
||||
#TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id
|
||||
|
||||
@@ -421,8 +421,8 @@
|
||||
<group col="2" colspan="2">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Accounts" colspan="4"/>
|
||||
<field name="default_debit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="default_credit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="default_debit_account_id" attrs="{'required':[('type','in', ('cash', 'bank'))]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="default_credit_account_id" attrs="{'required':[('type','in',('cash', 'bank'))]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Journal View" colspan="4"/>
|
||||
@@ -2394,7 +2394,7 @@
|
||||
<field name="sale_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
|
||||
<field name="purchase_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
|
||||
<newline/> <!-- extended view because the web UI is not good for one2many -->
|
||||
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list" groups="base.group_extended">
|
||||
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list" groups="base.group_extended">
|
||||
<form string="Bank Information">
|
||||
<field name="acc_name"/>
|
||||
<field name="account_type"/>
|
||||
|
||||
Reference in New Issue
Block a user