diff --git a/addons/account/__init__.py b/addons/account/__init__.py index 8aed675b197..66e7c401581 100644 --- a/addons/account/__init__.py +++ b/addons/account/__init__.py @@ -1,30 +1,22 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved. +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ # -# $Id$ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# 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 General Public License for more details. # -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # ############################################################################## diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index e8f25d84ad4..40a4b2d1d5d 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -1,31 +1,24 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved. +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ # -# $Id$ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# 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 General Public License for more details. # -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -############################################################################### +############################################################################## { "name" : "Accounting and financial management", "version" : "1.0", @@ -50,9 +43,9 @@ "account_unit_test.xml", ], "update_xml" : [ - "account_menuitem.xml", "security/account_security.xml", "security/ir.model.access.csv", + "account_menuitem.xml", "account_wizard.xml", "account_view.xml", "account_end_fy.xml", diff --git a/addons/account/account.py b/addons/account/account.py index 3f436373ef1..90d7e2c0d95 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1,30 +1,22 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved. +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ # -# $Id$ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# 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 General Public License for more details. # -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # ############################################################################## import time @@ -42,7 +34,7 @@ class account_payment_term(osv.osv): _name = "account.payment.term" _description = "Payment Term" _columns = { - 'name': fields.char('Payment Term', size=32, translate=True), + 'name': fields.char('Payment Term', size=32, translate=True, required=True), 'active': fields.boolean('Active'), 'note': fields.text('Description', translate=True), 'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'), @@ -86,7 +78,7 @@ class account_payment_term_line(osv.osv): 'value': fields.selection([('procent','Percent'),('balance','Balance'),('fixed','Fixed Amount')], 'Value',required=True), 'value_amount': fields.float('Value Amount'), 'days': fields.integer('Number of Days',required=True, help="Number of days to add before computation of the day of month."), - 'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month."), + 'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the end of the month)."), 'payment_id': fields.many2one('account.payment.term','Payment Term', required=True, select=True), } _defaults = { @@ -456,7 +448,9 @@ class account_journal(osv.osv): '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 that new account moves pass through the \'draft\' state and goes direclty 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"), } + _defaults = { 'active': lambda *a: 1, 'user_id': lambda self,cr,uid,context: uid, @@ -665,6 +659,15 @@ class account_move(osv.osv): return periods[0] else: return False + + def _amount_compute(self, cr, uid, ids, name, args, context, where =''): + if not ids: return {} + cr.execute('select move_id,sum(debit) from account_move_line where move_id in ('+','.join(map(str,ids))+') group by move_id') + result = dict(cr.fetchall()) + for id in ids: + result.setdefault(id, 0.0) + return result + _columns = { 'name': fields.char('Entry Name', size=64, required=True), 'ref': fields.char('Ref', size=64), @@ -673,6 +676,8 @@ class account_move(osv.osv): 'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'Status', required=True, readonly=True), '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", store=True), + 'amount': fields.function(_amount_compute, method=True, string='Amount', digits=(16,2), store=True), } _defaults = { 'state': lambda *a: 'draft', @@ -1565,7 +1570,6 @@ class account_config_wizard(osv.osv_memory): 'date1': lambda *a: time.strftime('%Y-01-01'), 'date2': lambda *a: time.strftime('%Y-12-31'), 'period':lambda *a:'month', - 'charts': lambda *a: -1, } def action_cancel(self,cr,uid,ids,conect=None): return { @@ -1861,8 +1865,14 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'code_digits':fields.integer('# of Digits',required=True,help="No. of Digits to use for account code"), } + def _get_chart(self, cr, uid, context={}): + ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context) + if ids: + return ids[0] + return False _defaults = { 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr,uid,[uid],c)[0].company_id.id, + 'chart_template_id': _get_chart, 'code_digits': lambda *a:6, } @@ -1939,6 +1949,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): self.pool._init = True children_acc_template = obj_acc_template.search(cr, uid, [('parent_id','child_of',[obj_acc_root.id])]) + children_acc_template.sort() for account_template in obj_acc_template.browse(cr, uid, children_acc_template): tax_ids = [] for tax in account_template.tax_ids: diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index c55d49a418f..a0ac15301d8 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -1,31 +1,22 @@ # -*- encoding: utf-8 -*- - ############################################################################## # -# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved. +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ # -# $Id$ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# 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 General Public License for more details. # -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # ############################################################################## diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 56f4af1401d..e28edc87f4a 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -1,30 +1,22 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved. +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ # -# $Id$ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# 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 General Public License for more details. # -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # ############################################################################## import time diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 1c4ef5546c7..02325bada84 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -150,7 +150,7 @@ - + @@ -239,6 +239,9 @@ + + + @@ -465,6 +466,8 @@ + + @@ -714,9 +717,9 @@ - + - + @@ -756,7 +759,7 @@ - + @@ -807,11 +810,15 @@
+ - - + + + + + @@ -871,7 +878,7 @@ - + Entries Encoding by Move account.move form @@ -969,13 +976,31 @@ form,tree - + + + - + - + @@ -1261,7 +1286,7 @@ - Entries + account.move.line form tree,form @@ -1347,13 +1372,13 @@ - - - + + +