[MERGE]: Merged lp:~openerp-dev/openobject-addons/trunk-configuration_wizard_improvement-atp-account-improvements-bde

bzr revid: atp@tinyerp.com-20120611111224-ynhcd6f642sz9aqj
This commit is contained in:
Atul Patel (OpenERP) 2012-06-11 16:42:24 +05:30
commit 6b61fd522f
6 changed files with 103 additions and 92 deletions

View File

@ -111,8 +111,8 @@ class account_config_settings(osv.osv_memory):
'group_proforma_invoices': fields.boolean('Allow Pro-forma Invoices',
implied_group='account.group_proforma_invoices',
help="Allows you to put invoices in pro-forma state."),
'default_sale_tax': fields.many2one('account.tax', 'Default Sale Tax'),
'default_purchase_tax': fields.many2one('account.tax', 'Default Purchase Tax'),
'default_sale_tax': fields.many2one('account.tax', 'Default Sale Tax', help="Selected tax will be applied by default to Product's Sale Tax, while creating a new product."),
'default_purchase_tax': fields.many2one('account.tax', 'Default Purchase Tax', help="Selected tax will be applied by default to Product's Purchase Tax, while creating a new product."),
'decimal_precision': fields.integer('Decimal Precision on Journal Entries',
help="""As an example, a decimal precision of 2 will allow journal entries like: 9.99 EUR, whereas a decimal precision of 4 will allow journal entries like: 0.0231 EUR."""),
}

View File

@ -21,101 +21,101 @@
<button string="Cancel" special="cancel"/>
</header>
<sheet layout="auto">
<field name="has_default_company" invisible="1" />
<field name="has_chart_of_accounts" invisible="1"/>
<field name="company_id" widget="selection" on_change="onchange_company_id(company_id)"
attrs="{'invisible': [('has_default_company', '=', True)]}"/>
<field name="expects_chart_of_accounts"/>
<group string="No Chart of Accounts exists for this Company" colspan="4" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}">
<label string="Please select a chart template to install a chart of accounts." colspan="4"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>
<button string="Install More Chart Templates" icon="gtk-go-forward"
name="%(open_account_charts_modules)d" type="action"/>
<newline/>
<field name ="code_digits" groups="account.group_account_user"/>
<field name ="seq_journal"/>
<newline/>
<field name ="complete_tax_set" invisible="1"/>
<field name="sale_tax" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',False)]}"
domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
<field name="purchase_tax" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',False)]}"
domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
<field name ="sale_tax_rate" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}" on_change="onchange_tax_rate(sale_tax_rate)"/>
<field name ="purchase_tax_rate" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}"/>
</group>
<field name="has_fiscal_year" invisible="1"/>
<group string="No Fiscal Year exists for this Company" colspan="4" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_fiscal_year','=',True)]}">
<field name="date_start" on_change="onchange_start_date(date_start)"/>
<field name="date_stop"/>
<field name="period" colspan="4"/>
</group>
<group colspan="4">
<separator string="Accounting Configuration" colspan="4"/>
<field name ="complete_tax_set" invisible="1"/>
<newline/>
<group colspan="" col="2">
<field name="default_sale_tax" domain="[('type_tax_use','=','sale'), ('company_id','=',company_id)]" attrs="{'invisible': [('has_chart_of_accounts','=',False)]}"/>
<field name="module_account_accountant"/>
<field name="module_account_asset"/>
<group>
<separator string="Accounting Details of Company" colspan="4"/>
<field name="has_default_company" invisible="1"/>
<field name="has_chart_of_accounts" invisible="1"/>
<field name="company_id" groups="base.group_multi_company" widget="selection" on_change="onchange_company_id(company_id)"
attrs="{'invisible': [('has_default_company', '=', True)]}"/>
<field name="expects_chart_of_accounts"/>
<group string="No Chart of Accounts exists for this Company" colspan="4" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}">
<label string="Please select a chart template to install a chart of accounts." colspan="4"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>
<button string="Install More Chart Templates" icon="gtk-go-forward"
name="%(open_account_charts_modules)d" type="action"/>
<newline/>
<field name ="code_digits" groups="account.group_account_user"/>
<field name ="seq_journal"/>
<newline/>
<field name ="complete_tax_set" invisible="1"/>
<field name="sale_tax" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',False)]}"
domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
<field name="purchase_tax" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',False)]}"
domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
<field name ="sale_tax_rate" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}" on_change="onchange_tax_rate(sale_tax_rate)"/>
<field name ="purchase_tax_rate" attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}"/>
</group>
<field name="has_fiscal_year" invisible="1"/>
<group string="No Fiscal Year exists for this Company" colspan="4" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_fiscal_year','=',True)]}">
<field name="date_start" on_change="onchange_start_date(date_start)"/>
<field name="date_stop"/>
<field name="period" colspan="4"/>
</group>
<group colspan="4">
<separator string="Accounting Configuration" colspan="4"/>
<field name ="complete_tax_set" invisible="1"/>
<newline/>
<group colspan="" col="2">
<field name="default_sale_tax" domain="[('type_tax_use','=','sale'), ('company_id','=',company_id)]" attrs="{'invisible': [('has_chart_of_accounts','=',False)]}"/>
<field name="module_account_accountant"/>
<field name="module_account_asset"/>
</group>
<group colspan="2" col="2">
<field name="default_purchase_tax" domain="[('type_tax_use','=','purchase'), ('company_id','=',company_id)]" attrs="{'invisible': [('has_chart_of_accounts','=',False)]}"/>
<field name="currency_id" widget="selection"/>
<field name="module_account_budget"/>
<field name="decimal_precision"/>
</group>
</group>
<group colspan="2" col="2">
<field name="default_purchase_tax" domain="[('type_tax_use','=','purchase'), ('company_id','=',company_id)]" attrs="{'invisible': [('has_chart_of_accounts','=',False)]}"/>
<field name="currency_id" widget="selection"/>
<field name="module_account_budget"/>
<field name="decimal_precision"/>
<separator string="Customer Invoices" colspan="2"/>
<field name="sale_journal_id" invisible="1"/>
<label string="Next Invoice Number" for="sale_sequence_prefix" help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
<group colspan="1" col="2">
<field name="sale_sequence_prefix" nolabel="1"/>
<field name="sale_sequence_next" nolabel="1" attrs="{'readonly': [('sale_journal_id','=',False)]}"/>
</group>
<field name="sale_refund_journal_id" invisible="1"/>
<label string="Next Credit Note Number" for="sale_refund_sequence_prefix" help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
<group colspan="1" col="2">
<field name="sale_refund_sequence_prefix" nolabel="1"/>
<field name="sale_refund_sequence_next" nolabel="1" attrs="{'readonly': [('sale_refund_journal_id','=',False)]}"/>
</group>
<field name="module_account_invoice_layout"/>
<field name="module_account_voucher"/>
<field name="module_account_followup"/>
<field name="group_proforma_invoices"/>
</group>
</group>
<group colspan="2" col="2">
<separator string="Customer Invoices" colspan="2"/>
<field name="sale_journal_id" invisible="1"/>
<label string="Next Invoice Number" for="sale_sequence_prefix" help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
<group colspan="1" col="2">
<field name="sale_sequence_prefix" nolabel="1"/>
<field name="sale_sequence_next" nolabel="1" attrs="{'readonly': [('sale_journal_id','=',False)]}"/>
<group colspan="2" col="2">
<separator string="Supplier Invoices" colspan="2"/>
<field name="purchase_journal_id" invisible="1"/>
<label string="Next Supplier Invoice Number" for="purchase_sequence_prefix" help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
<group colspan="1" col="2">
<field name="purchase_sequence_prefix" nolabel="1"/>
<field name="purchase_sequence_next" nolabel="1" attrs="{'readonly': [('purchase_journal_id','=',False)]}"/>
</group>
<field name="purchase_refund_journal_id" invisible="1"/>
<label string="Next Supplier Credit Note Number" for="purchase_refund_sequence_prefix" help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
<group colspan="1" col="2">
<field name="purchase_refund_sequence_prefix" nolabel="1"/>
<field name="purchase_refund_sequence_next" nolabel="1" attrs="{'readonly': [('purchase_refund_journal_id','=',False)]}"/>
</group>
<field name="module_account_payment"/>
</group>
<field name="sale_refund_journal_id" invisible="1"/>
<label string="Next Credit Note Number" for="sale_refund_sequence_prefix" help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
<group colspan="1" col="2">
<field name="sale_refund_sequence_prefix" nolabel="1"/>
<field name="sale_refund_sequence_next" nolabel="1" attrs="{'readonly': [('sale_refund_journal_id','=',False)]}"/>
<group colspan="2" col="2">
<separator string="Electronic Payments" colspan="2"/>
<field name="paypal_account"/>
</group>
<field name="module_account_invoice_layout"/>
<field name="module_account_voucher"/>
<field name="module_account_followup"/>
<field name="group_proforma_invoices"/>
</group>
<group colspan="2" col="2">
<separator string="Supplier Invoices" colspan="2"/>
<field name="purchase_journal_id" invisible="1"/>
<label string="Next Supplier Invoice Number" for="purchase_sequence_prefix" help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
<group colspan="1" col="2">
<field name="purchase_sequence_prefix" nolabel="1"/>
<field name="purchase_sequence_next" nolabel="1" attrs="{'readonly': [('purchase_journal_id','=',False)]}"/>
<group colspan="2" col="2">
<separator string="Bank &amp; Cash" colspan="2"/>
<b><label string="Configure Bank Accounts :"/></b>
<button name="%(action_bank_tree)d" string="Configure Bank Accounts" icon="gtk-go-forward" type="action"/>
<field name="company_footer"/>
<field name="module_account_check_writing"/>
</group>
<field name="purchase_refund_journal_id" invisible="1"/>
<label string="Next Supplier Credit Note Number" for="purchase_refund_sequence_prefix" help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
<group colspan="1" col="2">
<field name="purchase_refund_sequence_prefix" nolabel="1"/>
<field name="purchase_refund_sequence_next" nolabel="1" attrs="{'readonly': [('purchase_refund_journal_id','=',False)]}"/>
<group name="analytic_accounting" colspan="4" invisible="1">
<separator string="Analytic Accounting" colspan="4"/>
</group>
<field name="module_account_payment"/>
</group>
<group colspan="2" col="2">
<separator string="Electronic Payments" colspan="2"/>
<field name="paypal_account"/>
</group>
<group colspan="2" col="2">
<separator string="Bank &amp; Cash" colspan="2"/>
<b><label string="Configure Bank Accounts :"/></b>
<button name="%(action_bank_tree)d" string="Configure Bank Accounts" icon="gtk-go-forward" type="action"/>
<field name="company_footer"/>
<field name="module_account_check_writing"/>
</group>
<group name="analytic_accounting" colspan="4" invisible="1">
<separator string="Analytic Accounting" colspan="4"/>
</group>
</sheet>
</form>

View File

@ -83,5 +83,11 @@ class account_config_settings(osv.osv_memory):
implied_group='purchase.group_analytic_accounting',
help="Allows you to specify an analytic account on purchase orders."),
}
def onchange_purchase_analytic_plans(self, cr, uid, ids, module_purchase_analytic_plans, context=None):
if not module_purchase_analytic_plans:
return {'value':{'group_analytic_account_for_purchases': False} }
return {'value': {'group_analytic_account_for_purchases': True}}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -52,7 +52,7 @@
</group>
<group name="analytic_accounting" position="inside">
<field name="group_analytic_account_for_purchases"/>
<field name="module_purchase_analytic_plans"/>
<field name="module_purchase_analytic_plans" on_change="onchange_purchase_analytic_plans(module_purchase_analytic_plans)"/>
</group>
</field>
</record>

View File

@ -199,5 +199,10 @@ class account_config_settings(osv.osv_memory):
implied_group='sale.group_analytic_accounting',
help="Allows you to specify an analytic account on sale orders."),
}
def onchange_sale_analytic_plans(self, cr, uid, ids, module_sale_analytic_plans, context=None):
if not module_sale_analytic_plans:
return {'value': {'group_analytic_account_for_sales': False}}
return {'value': {'group_analytic_account_for_sales': True}}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -58,7 +58,7 @@
</group>
<group name="analytic_accounting" position="inside">
<field name="group_analytic_account_for_sales"/>
<field name="module_sale_analytic_plans"/>
<field name="module_sale_analytic_plans" on_change="onchange_sale_analytic_plans(module_sale_analytic_plans)"/>
</group>
</field>
</record>