[IMP] account config: code cleanup, and improve English

bzr revid: rco@openerp.com-20120509124139-ydvkr23liydelasl
This commit is contained in:
Raphael Collet 2012-05-09 14:41:39 +02:00
parent b66ba6f11c
commit 633b27261d
4 changed files with 46 additions and 39 deletions

View File

@ -36,12 +36,11 @@ class account_config_settings(osv.osv_memory):
_columns = {
'company_id': fields.many2one('res.company', 'Company', required=True),
'has_default_company': fields.boolean('Has default company', readonly=True),
'decimal_precision_account': fields.integer('Decimal Precision on Account'),
'expects_chart_of_accounts': fields.related('company_id', 'expects_chart_of_accounts', type='boolean',
string='Chart of Accounts for this Company',
help=""" Check this box if this company is a legal entity."""),
string='Chart of Accounts for this Company',
help="""Check this box if this company is a legal entity."""),
'currency_id': fields.related('company_id', 'currency_id', type='many2one', relation='res.currency', required=True,
string='Default Company Currency', help="Default Company Currency of the company."),
string='Default Company Currency', help="Main currency of the company."),
'paypal_account': fields.related('company_id', 'paypal_account', type='char', size=128,
string='Paypal account', help="Paypal account (email) for receiving online payments (credit card, etc.)"),
'company_footer': fields.related('company_id', 'rml_footer2', type='char', size=250, readonly=True,
@ -79,18 +78,18 @@ class account_config_settings(osv.osv_memory):
help="""This allows you to check writing and printing.
This installs the module account_check_writing."""),
'module_account_accountant': fields.boolean('Accountant Features',
help="""If you do not check this box, you will be able to do Invoicing & Payments, but not accounting (Journal Items, Chart of Accounts, ...)."""),
help="""If you do not check this box, you will be able to do Invoicing & Payments, but not accounting (Journal Items, Chart of Accounts, ...)."""),
'module_account_asset': fields.boolean('Assets Management',
help="""This allows you to manage the assets owned by a company or a person.
It keeps track of the depreciation occurred on those assets, and creates account move for those depreciation lines.
This installs the module account_asset. If you do not check this box, you will be able to do Invoicing & Payments,
This installs the module account_asset. If you do not check this box, you will be able to do invoicing & payments,
but not accounting (Journal Items, Chart of Accounts, ...) """),
'module_account_budget': fields.boolean('Budget Management',
help="""This allows accountants to manage analytic and crossovered budgets.
Once the master budgets and the budgets are defined,
the project managers can set the planned amount on each analytic account.
This installs the module account_budget."""),
'module_account_payment': fields.boolean('Manage Payments Order',
'module_account_payment': fields.boolean('Manage Payment Orders',
help="""This allows you to create and manage your payment orders, with purposes to
* serve as base for an easy plug-in of various automated payment mechanisms, and
* provide a more efficient way to manage invoice payments.
@ -101,7 +100,7 @@ class account_config_settings(osv.osv_memory):
'module_account_followup': fields.boolean('Manage Customer Payment Follow-Ups',
help="""This allows to automate letters for unpaid invoices, with multi-level recalls.
This installs the module account_followup."""),
'module_account_invoice_layout': fields.boolean('Allow notes and subtotals',
'module_account_invoice_layout': fields.boolean('Allow Notes and Subtotals',
help="""This provides some features to improve the layout of invoices.
It gives you the possibility to:
* order all the lines of an invoice
@ -114,6 +113,8 @@ class account_config_settings(osv.osv_memory):
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'),
'decimal_precision': fields.integer('Decimal Precision',
help="""Set the decimal precision for rounding results in accounting."""),
}
def _default_company(self, cr, uid, context=None):
@ -133,21 +134,6 @@ class account_config_settings(osv.osv_memory):
'period': 'month',
}
def get_default_dp(self, cr, uid, fields, context=None):
acc_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product','decimal_account')[1]
dec_id =self.pool.get('decimal.precision').browse(cr, uid, acc_id,context=context)
return {
'decimal_precision_account': dec_id.digits,
}
def set_default_dp(self, cr, uid, ids, context=None):
config = self.browse(cr, uid, ids[0], context)
acc_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'decimal_account')[1]
dec_id =self.pool.get('decimal.precision').browse(cr, uid, acc_id,context=context)
dec_id.write({
'digits': config.decimal_precision_account,
})
def create(self, cr, uid, values, context=None):
id = super(account_config_settings, self).create(cr, uid, values, context)
# Hack: to avoid some nasty bug, related fields are not written upon record creation.
@ -287,4 +273,13 @@ class account_config_settings(osv.osv_memory):
elif config.period == '3months':
fiscalyear.create_period3(cr, uid, [fiscalyear_id])
def get_default_dp(self, cr, uid, fields, context=None):
dp = self.pool.get('ir.model.data').get_object(cr, uid, 'product','decimal_account')
return {'decimal_precision': dp.digits}
def set_default_dp(self, cr, uid, ids, context=None):
config = self.browse(cr, uid, ids[0], context)
dp = self.pool.get('ir.model.data').get_object(cr, uid, 'product','decimal_account')
dp.write({'digits': config.decimal_precision})
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -57,25 +57,31 @@
<field name ="complete_tax_set" invisible="1"/>
<newline/>
<group colspan="2" col="2">
<field name="default_sale_tax" domain="[('type_tax_use','=','sale'), ('company_id','=',company_id)]" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',True), ('has_fiscal_year','=',False)]}"/>
<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': ['|', ('expects_chart_of_accounts','=',True), ('has_fiscal_year','=',False)]}"/>
<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_account"/>
<field name="decimal_precision"/>
</group>
</group>
<group colspan="2" col="2">
<separator string="Customer Invoices" colspan="2"/>
<field name="sale_journal_id" invisible="1"/>
<field name="sale_sequence_prefix"/>
<field name="sale_sequence_next" attrs="{'readonly': [('sale_journal_id','=',False)]}"/>
<label string="Invoice Sequence" colspan="1"/>
<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"/>
<field name="sale_refund_sequence_prefix"/>
<field name="sale_refund_sequence_next" attrs="{'readonly': [('sale_refund_journal_id','=',False)]}"/>
<label string="Refund Sequence" colspan="1"/>
<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"/>
@ -84,11 +90,17 @@
<group colspan="2" col="2">
<separator string="Supplier Invoices" colspan="2"/>
<field name="purchase_journal_id" invisible="1"/>
<field name="purchase_sequence_prefix"/>
<field name="purchase_sequence_next" attrs="{'readonly': [('purchase_journal_id','=',False)]}"/>
<label string="Supplier Invoice Sequence" colspan="1"/>
<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"/>
<field name="purchase_refund_sequence_prefix"/>
<field name="purchase_refund_sequence_next" attrs="{'readonly': [('purchase_refund_journal_id','=',False)]}"/>
<label string="Supplier Refund Sequence" colspan="1"/>
<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>
<group colspan="2" col="2">

View File

@ -32,11 +32,11 @@ class account_invoice_refund(osv.osv_memory):
_name = "account.invoice.refund"
_description = "Invoice Refund"
_columns = {
'date': fields.date('Operation date', help='This date will be used as the invoice date for Credit Note and Period will be chosen accordingly!'),
'date': fields.date('Operation Date', help='This date will be used as the invoice date for credit note and period will be chosen accordingly!'),
'period': fields.many2one('account.period', 'Force period'),
'journal_id': fields.many2one('account.journal', 'Refund Journal', help='You can select here the journal to use for the Credit Note that will be created. If you leave that field empty, it will use the same journal as the current invoice.'),
'journal_id': fields.many2one('account.journal', 'Refund Journal', help='You can select here the journal to use for the credit note that will be created. If you leave that field empty, it will use the same journal as the current invoice.'),
'description': fields.char('Description', size=128, required=True),
'filter_refund': fields.selection([('refund', 'Create a draft Refund'), ('cancel', 'Cancel: Credit Note and reconcile'),('modify', 'Modify: Credit Note, reconcile and create a new draft invoice')], "Refund Method", required=True, help='Credit Note base on this type. You can not Modify and Cancel if the invoice is already reconciled'),
'filter_refund': fields.selection([('refund', 'Create a draft refund'), ('cancel', 'Cancel: create credit note and reconcile'),('modify', 'Modify: create credit note, reconcile and create a new draft invoice')], "Refund Method", required=True, help='Credit note base on this type. You can not Modify and Cancel if the invoice is already reconciled'),
}
def _get_journal(self, cr, uid, context=None):

View File

@ -19,8 +19,8 @@
<separator colspan="4"/>
<group col="4" colspan="4" fill="1">
<label align="0.0" width="550" colspan="4" string="Modify Invoice: Cancels the current invoice and creates a new copy of it ready for editing."/>
<label align="0.0" width="300" string="Credit Note: Creates the Credit Note, ready for editing."/>
<label align="0.0" width="500" colspan="4" string="Cancel Invoice: Creates the Credit Note, validate and reconcile it to cancel the current invoice."/>
<label align="0.0" width="300" string="Credit Note: Creates the credit note, ready for editing."/>
<label align="0.0" width="500" colspan="4" string="Cancel Invoice: Creates the credit note, validate and reconcile it to cancel the current invoice."/>
</group>
<separator colspan="4"/>
<group colspan="4" col="6">