diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index 130e094d8be..bb73c2527c0 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -64,7 +64,7 @@ 'project/project_demo.xml', 'project/analytic_account_demo.xml', 'demo/account_minimal.xml', - 'account_unit_test.xml' + 'account_unit_test.xml', ], 'installable': True, 'active': False, diff --git a/addons/account/account.py b/addons/account/account.py index c7cd5b4c294..0229297c2de 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -477,8 +477,9 @@ class account_journal(osv.osv): 'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"), 'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'), 'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'), - 'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new Ledger Postings to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'), - 'company_id': fields.related('default_credit_account_id','company_id',type='many2one', relation="res.company", string="Company"), + 'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'), + #'company_id': fields.related('default_credit_account_id','company_id',type='many2one', relation="res.company", string="Company"), + 'company_id': fields.many2one('res.company', 'Company', required=True,select=1), 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \ help="The sequence used for invoice numbers in this journal."), } @@ -486,6 +487,7 @@ class account_journal(osv.osv): _defaults = { 'active': lambda *a: 1, 'user_id': lambda self,cr,uid,context: uid, + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } def create(self, cr, uid, vals, context={}): journal_id = super(account_journal, self).create(cr, uid, vals, context) @@ -520,15 +522,17 @@ class account_fiscalyear(osv.osv): 'name': fields.char('Fiscal Year', size=64, required=True), 'code': fields.char('Code', size=6, required=True), 'company_id': fields.many2one('res.company', 'Company', - help="Keep empty if the fiscal year belongs to several companies."), + help="Keep empty if the fiscal year belongs to several companies.", required=True), 'date_start': fields.date('Start Date', required=True), 'date_stop': fields.date('End Date', required=True), 'period_ids': fields.one2many('account.period', 'fiscalyear_id', 'Periods'), - 'state': fields.selection([('draft','Draft'), ('done','Done')], 'Status', readonly=True), + 'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True, + help='When fiscal year is created. The state is \'Draft\'. At the end of the year it is in \'Done\' state.'), } _defaults = { 'state': lambda *a: 'draft', + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } _order = "date_start" @@ -587,10 +591,13 @@ class account_period(osv.osv): 'date_start': fields.date('Start of Period', required=True, states={'done':[('readonly',True)]}), 'date_stop': fields.date('End of Period', required=True, states={'done':[('readonly',True)]}), 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True), - 'state': fields.selection([('draft','Draft'), ('done','Done')], 'Status', readonly=True) + 'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True, + help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'), + 'company_id': fields.many2one('res.company', 'Company', required=True) } _defaults = { 'state': lambda *a: 'draft', + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } _order = "date_start" @@ -669,8 +676,10 @@ class account_journal_period(osv.osv): 'period_id': fields.many2one('account.period', 'Period', required=True, ondelete="cascade"), 'icon': fields.function(_icon_get, method=True, string='Icon', type='char', size=32), 'active': fields.boolean('Active', required=True), - 'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'Status', required=True, readonly=True), + 'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'State', required=True, readonly=True, + help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'), 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'), + 'company_id' : fields.many2one('res.company', 'Company') } def _check(self, cr, uid, ids, context={}): @@ -699,6 +708,7 @@ class account_journal_period(osv.osv): _defaults = { 'state': lambda *a: 'draft', 'active': lambda *a: True, + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } _order = "period_id" @@ -754,7 +764,8 @@ class account_move(osv.osv): 'ref': fields.char('Ref', size=64), 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'posted':[('readonly',True)]}), - 'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'Status', required=True, readonly=True), + 'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State', required=True, readonly=True, + help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'), 'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}), 'to_check': fields.boolean('To Be Verified'), 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"), @@ -770,6 +781,7 @@ class account_move(osv.osv): ('journal_pur_voucher','Journal Purchase'), ('journal_voucher','Journal Voucher'), ],'Type', readonly=True, select=True, states={'draft':[('readonly',False)]}), + 'company_id': fields.many2one('res.company', 'Company', required=True), } _defaults = { 'name': lambda *a: '/', @@ -777,6 +789,7 @@ class account_move(osv.osv): 'period_id': _get_period, 'type' : lambda *a : 'journal_voucher', 'date': lambda *a:time.strftime('%Y-%m-%d'), + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } def _check_centralisation(self, cursor, user, ids): @@ -1604,7 +1617,7 @@ class account_subscription(osv.osv): 'period_total': fields.integer('Number of Periods', required=True), 'period_nbr': fields.integer('Period', required=True), 'period_type': fields.selection([('day','days'),('month','month'),('year','year')], 'Period Type', required=True), - 'state': fields.selection([('draft','Draft'),('running','Running'),('done','Done')], 'Status', required=True, readonly=True), + 'state': fields.selection([('draft','Draft'),('running','Running'),('done','Done')], 'State', required=True, readonly=True), 'lines_id': fields.one2many('account.subscription.line', 'subscription_id', 'Subscription Lines') } diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 53168202d2f..7e289f695ea 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -126,7 +126,9 @@ class account_bank_statement(osv.osv): 'Entry lines', states={'confirm':[('readonly',True)]}), 'state': fields.selection([('draft', 'Draft'),('confirm', 'Confirmed')], 'State', required=True, - states={'confirm': [('readonly', True)]}, readonly="1"), + states={'confirm': [('readonly', True)]}, readonly="1", + help='When new statement is created the state will be \'Draft\'. \ + \n* And after getting confirmation from the bank it will be in \'Confirmed\' state.'), 'currency': fields.function(_currency, method=True, string='Currency', type='many2one', relation='res.currency'), } diff --git a/addons/account/account_demo.xml b/addons/account/account_demo.xml index c2bc9bdc1f4..0b4ee8f097d 100644 --- a/addons/account/account_demo.xml +++ b/addons/account/account_demo.xml @@ -11,6 +11,7 @@ + + - + account.fiscal.position.template.form account.fiscal.position.template form diff --git a/addons/account/company_view.xml b/addons/account/company_view.xml index 29eedc72b0c..1d4571e0d4f 100644 --- a/addons/account/company_view.xml +++ b/addons/account/company_view.xml @@ -1,40 +1,40 @@ - - - res.company.form.inherit - - res.company - form - - + + + res.company.form.inherit + + res.company + form + + - - + + - - - - - - wizard.company.setup.form - wizard.company.setup - form - -
- - - - - -