diff --git a/addons/account/account.py b/addons/account/account.py index 907e6207380..31fe7dbfb12 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -746,9 +746,11 @@ class account_journal(osv.osv): 'profit_account_id' : fields.many2one('account.account', 'Profit Account'), 'loss_account_id' : fields.many2one('account.account', 'Loss Account'), 'internal_account_id' : fields.many2one('account.account', 'Internal Transfers Account', select=1), + 'cash_control' : fields.boolean('Cash Control', help='If you want the journal should be control at opening/closing, check this option'), } _defaults = { + 'cash_control' : False, 'with_last_closing_balance' : False, '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, diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index 9af0dcf60f4..17fa05d5f24 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -194,12 +194,27 @@ class account_cash_statement(osv.osv): journal = self.pool.get('account.journal').browse(cr, uid, vals['journal_id'], context=context) if journal and (journal.type == 'cash') and not vals.get('details_ids'): vals['details_ids'] = [] + + last_pieces = None + + if journal.with_last_closing_balance == True: + domain = [('journal_id', '=', journal.id), + ('state', '=', 'confirm')] + last_bank_statement_ids = self.search(cr, uid, domain, limit=1, order='create_date desc', context=context) + if last_bank_statement_ids: + last_bank_statement = self.browse(cr, uid, last_bank_statement_ids[0], context=context) + + last_pieces = dict( + (line.pieces, line.number_closing) for line in last_bank_statement.details_ids + ) + for value in journal.cashbox_line_ids: nested_values = { 'number_closing' : 0, - 'number_opening' : 0, + 'number_opening' : last_pieces.get(value.pieces, 0) if isinstance(last_pieces, dict) else 0, 'pieces' : value.pieces } + vals['details_ids'].append([0, False, nested_values]) res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 5bf45aab487..81e683e1cfd 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -515,7 +515,7 @@ - + @@ -524,10 +524,11 @@ + - - + + diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index baa94450f02..b7bc34a3e35 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -381,6 +381,11 @@ Cash Journal - (test) TCSH cash + + + + + diff --git a/addons/account_accountant/account_accountant_data.xml b/addons/account_accountant/account_accountant_data.xml index 7a666c8d344..5b563017c62 100644 --- a/addons/account_accountant/account_accountant_data.xml +++ b/addons/account_accountant/account_accountant_data.xml @@ -21,13 +21,14 @@ - - - - With OpenERP's accounting, you can get an instant access to all your financial data, setup your analytic accounting, forecast your taxes, control your budgets, easily create and send invoices, record bank statements, etc. + + mail.group + + notification + Accounting and Finance application installed! + With OpenERP's accounting, you get instant access to your financial data, and can setup analytic accounting, forecast taxes, control budgets, easily create and send invoices, record bank statements, etc. -The accounting features are fully integrated with others OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc. - Module Accounting and Finance has been installed. - +The accounting features are fully integrated with other OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc. + diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index 63a8e6c7add..8f051b33bf9 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -23,6 +23,7 @@ + diff --git a/addons/analytic_contract_expense_project/__openerp__.py b/addons/analytic_contract_expense_project/__openerp__.py deleted file mode 100644 index 8996e9f7565..00000000000 --- a/addons/analytic_contract_expense_project/__openerp__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -{ - 'name': 'Projects Management: hr_expense link', - 'version': '1.1', - 'category': 'Hidden', - 'description': """ -This module is for modifying project view to show some data related to the hr_expense module. -============================================================================================= -""", - 'author': 'OpenERP S.A.', - 'website': 'http://www.openerp.com/', - 'depends': ['analytic_contract_hr_expense','project'], - 'data': ['analytic_contract_expense_project_view.xml'], - 'demo': [], - 'css' : [], - 'installable': True, - 'auto_install': True, -} - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/analytic_contract_expense_project/analytic_contract_expense_project.py b/addons/analytic_contract_expense_project/analytic_contract_expense_project.py deleted file mode 100644 index efbb8b75a9e..00000000000 --- a/addons/analytic_contract_expense_project/analytic_contract_expense_project.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from osv import osv - -class project_project(osv.osv): - _inherit = "project.project" - - def open_hr_expense(self, cr, uid, ids, context=None): - account_ids = [x.analytic_account_id.id for x in self.browse(cr, uid, ids, context=context)] - return self.pool.get('account.analytic.account').open_hr_expense(cr, uid, account_ids, context=context) - - def hr_to_invoice_expense(self, cr, uid, ids, context=None): - account_ids = [x.analytic_account_id.id for x in self.browse(cr, uid, ids, context=context)] - return self.pool.get('account.analytic.account').hr_to_invoice_expense(cr, uid, account_ids, context=context) - -project_project() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/analytic_contract_expense_project/analytic_contract_expense_project_view.xml b/addons/analytic_contract_expense_project/analytic_contract_expense_project_view.xml deleted file mode 100644 index f461ed224b8..00000000000 --- a/addons/analytic_contract_expense_project/analytic_contract_expense_project_view.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - project.project.form.expense.inherit - project.project - - - - - - -