diff --git a/addons/account/account.py b/addons/account/account.py index b01da6b1425..d145f0308b0 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -836,6 +836,8 @@ class account_journal(osv.osv): @return: Returns a list of tupples containing id, name """ + if not ids: + return [] if isinstance(ids, (int, long)): ids = [ids] result = self.browse(cr, user, ids, context=context) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index bbcb25fefa9..aff38d71cfe 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1103,10 +1103,10 @@ class account_invoice(osv.osv): if not ids: return [] types = { - 'out_invoice': 'CI: ', - 'in_invoice': 'SI: ', - 'out_refund': 'OR: ', - 'in_refund': 'SR: ', + 'out_invoice': 'Invoice ', + 'in_invoice': 'Sup. Invoice ', + 'out_refund': 'Refund ', + 'in_refund': 'Supplier Refund ', } return [(r['id'], (r['number']) or types[r['type']] + (r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')] diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 480d5ec76a6..a2fbf11963b 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -30,7 +30,7 @@ - + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 18ab1a779a3..69b1bef08e6 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -215,8 +215,10 @@ class account_move_line(osv.osv): def _default_get(self, cr, uid, fields, context=None): if context is None: context = {} - if not context.get('journal_id', False) and context.get('search_default_journal_id', False): + if not context.get('journal_id', False): context['journal_id'] = context.get('search_default_journal_id') + if not context.get('period_id', False): + context['period_id'] = context.get('search_default_period_id') account_obj = self.pool.get('account.account') period_obj = self.pool.get('account.period') journal_obj = self.pool.get('account.journal') @@ -226,6 +228,9 @@ class account_move_line(osv.osv): partner_obj = self.pool.get('res.partner') currency_obj = self.pool.get('res.currency') context = self.convert_to_period(cr, uid, context) + #pass the right context when search_defaul_journal_id + if context.get('search_default_journal_id',False): + context['journal_id'] = context.get('search_default_journal_id') # Compute simple values data = super(account_move_line, self).default_get(cr, uid, fields, context=context) # Starts: Manual entry from account.move form @@ -926,6 +931,8 @@ class account_move_line(osv.osv): return res if (not context.get('journal_id', False)) or (not context.get('period_id', False)): return False + if context.get('search_default_journal_id', False): + context['journal_id'] = context.get('search_default_journal_id') cr.execute('SELECT code FROM account_journal WHERE id = %s', (context['journal_id'], )) j = cr.fetchone()[0] or '' cr.execute('SELECT code FROM account_period WHERE id = %s', (context['period_id'], )) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 20aa198c63f..874adb417d3 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -102,6 +102,7 @@ + @@ -1718,8 +1719,10 @@ account.payment.term.line - - + + + + @@ -1767,12 +1770,11 @@ account.payment.term - + - - + diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index d83571b314e..7ac1efd4f9f 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -12,7 +12,7 @@ - + @@ -23,6 +23,7 @@ + @@ -93,8 +94,10 @@ - - + + + + diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index d87e4d04a0c..da6a142972b 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -92,7 +92,7 @@ class account_move_journal(osv.osv_memory): journal = False if journal_id: - journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).name + journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).get('name',False) journal_string = _("Journal: %s") % tools.ustr(journal) else: journal_string = _("Journal: All") diff --git a/addons/account_analytic_analysis/__openerp__.py b/addons/account_analytic_analysis/__openerp__.py index 40b67289fb1..3e8c579b729 100644 --- a/addons/account_analytic_analysis/__openerp__.py +++ b/addons/account_analytic_analysis/__openerp__.py @@ -36,6 +36,7 @@ Adds menu to show relevant information to each manager.You can also view the rep 'depends': ['hr_timesheet_invoice', 'sale'], #although sale is technically not required to install this module, all menuitems are located under 'Sales' application 'data': [ 'security/ir.model.access.csv', + 'security/account_analytic_analysis_security.xml', 'account_analytic_analysis_view.xml', 'account_analytic_analysis_menu.xml', 'account_analytic_analysis_cron.xml', diff --git a/addons/account_analytic_analysis/security/account_analytic_analysis_security.xml b/addons/account_analytic_analysis/security/account_analytic_analysis_security.xml new file mode 100644 index 00000000000..8bcc7f2d7f0 --- /dev/null +++ b/addons/account_analytic_analysis/security/account_analytic_analysis_security.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/addons/account_asset/account_asset_view.xml b/addons/account_asset/account_asset_view.xml index bb0222d5e4f..3fab306863c 100644 --- a/addons/account_asset/account_asset_view.xml +++ b/addons/account_asset/account_asset_view.xml @@ -129,7 +129,7 @@ - + @@ -159,11 +159,6 @@ - - - - - diff --git a/addons/account_budget/account_budget_view.xml b/addons/account_budget/account_budget_view.xml index f6b4842b596..7868755d143 100644 --- a/addons/account_budget/account_budget_view.xml +++ b/addons/account_budget/account_budget_view.xml @@ -62,12 +62,7 @@ - - - - - - + diff --git a/addons/account_budget/security/account_budget_security.xml b/addons/account_budget/security/account_budget_security.xml index 1fbcd82e86c..46a3efebb5c 100644 --- a/addons/account_budget/security/account_budget_security.xml +++ b/addons/account_budget/security/account_budget_security.xml @@ -22,6 +22,10 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + diff --git a/addons/account_coda/account_coda_view.xml b/addons/account_coda/account_coda_view.xml index 23e63b2a4a4..21db77466a0 100644 --- a/addons/account_coda/account_coda_view.xml +++ b/addons/account_coda/account_coda_view.xml @@ -404,9 +404,9 @@ - - - + + + @@ -426,9 +426,9 @@ - - - + + + diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index 07647d02fe3..5e26c366778 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -47,16 +47,18 @@ - + - + + + @@ -69,20 +71,16 @@ - - - - - - - - - - - + + + + - - + + diff --git a/addons/l10n_be/__init__.py b/addons/l10n_be/__init__.py index 1b2677d295e..7bdc1f61b1f 100644 --- a/addons/l10n_be/__init__.py +++ b/addons/l10n_be/__init__.py @@ -19,7 +19,6 @@ # ############################################################################## -import company import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/l10n_be/company.py b/addons/l10n_be/company.py deleted file mode 100644 index 118696ec9f6..00000000000 --- a/addons/l10n_be/company.py +++ /dev/null @@ -1,45 +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 res_company(osv.osv): - _inherit = "res.company" - _description = 'Company' - - def _get_default_ad(self, addresses): - name = email = phone = city = post_code = address = country_code = "" - for ads in addresses: - if ads.type == 'default': - city = ads.city or "" - post_code = ads.zip or "" - if ads.street: - address = ads.street or "" - if ads.street2: - address += " " + ads.street2 - if ads.country_id: - country_code = ads.country_id and ads.country_id.code or "" - name = ads.name or "" - email = ads.email or "" - phone = ads.phone or "" - return name, email, phone, city, post_code, address, country_code -res_company() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py index 5e357facd86..092d907e4ab 100644 --- a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py +++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py @@ -45,8 +45,8 @@ class l10n_be_vat_declaration(osv.osv_memory): 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', domain=[('parent_id', '=', False)], required=True), 'msg': fields.text('File created', size=64, readonly=True), 'file_save': fields.binary('Save File'), - 'ask_restitution': fields.boolean('Ask Restitution',help='It indicates whether a restitution is to made or not?'), - 'ask_payment': fields.boolean('Ask Payment',help='It indicates whether a payment is to made or not?'), + 'ask_restitution': fields.boolean('Ask Restitution',help='It indicates whether a restitution is to make or not?'), + 'ask_payment': fields.boolean('Ask Payment',help='It indicates whether a payment is to make or not?'), 'client_nihil': fields.boolean('Last Declaration, no clients in client listing', help='Tick this case only if it concerns only the last statement on the civil or cessation of activity: ' \ 'no clients to be included in the client listing.'), 'comments': fields.text('Comments'), @@ -70,6 +70,7 @@ class l10n_be_vat_declaration(osv.osv_memory): obj_tax_code = self.pool.get('account.tax.code') obj_acc_period = self.pool.get('account.period') obj_user = self.pool.get('res.users') + obj_partner = self.pool.get('res.partner') mod_obj = self.pool.get('ir.model.data') if context is None: @@ -83,7 +84,7 @@ class l10n_be_vat_declaration(osv.osv_memory): obj_company = obj_user.browse(cr, uid, uid, context=context).company_id vat_no = obj_company.partner_id.vat if not vat_no: - raise osv.except_osv(_('Insufficient Data!'), _('No VAT Number Associated with Main Company.')) + raise osv.except_osv(_('insufficient data!'), _('No VAT number associated with your company.')) vat_no = vat_no.replace(' ','').upper() vat = vat_no[2:] @@ -93,8 +94,9 @@ class l10n_be_vat_declaration(osv.osv_memory): ctx['period_id'] = data['period_id'][0] tax_info = obj_tax_code.read(cr, uid, tax_code_ids, ['code','sum_period'], context=ctx) - name = email = phone = address = post_code = city = country_code = '' - name, email, phone, city, post_code, address, country_code = self.pool.get('res.company')._get_default_ad(obj_company.partner_id) + default_address = obj_partner.address_get(cr, uid, [obj_company.partner_id.id]) + default_address_id = default_address.get("default", obj_company.partner_id.id) + address_id= obj_partner.browse(cr, uid, default_address_id, context) account_period = obj_acc_period.browse(cr, uid, data['period_id'][0], context=context) issued_by = vat_no[:2] @@ -106,21 +108,21 @@ class l10n_be_vat_declaration(osv.osv_memory): ending_month = account_period.date_stop[5:7] quarter = str(((int(starting_month) - 1) / 3) + 1) - if not email: + if not address_id.email: raise osv.except_osv(_('Insufficient Data!'),_('No email address associated with the company.')) - if not phone: + if not address_id.phone: raise osv.except_osv(_('Insufficient Data!'),_('No phone associated with the company.')) file_data = { 'issued_by': issued_by, 'vat_no': vat_no, 'only_vat': vat_no[2:], 'cmpny_name': obj_company.name, - 'address': address, - 'post_code': post_code, - 'city': city, - 'country_code': country_code, - 'email': email, - 'phone': phone.replace('.','').replace('/','').replace('(','').replace(')','').replace(' ',''), + 'address': "%s %s"%(address_id.street or "",address_id.street2 or ""), + 'post_code': address_id.zip or "", + 'city': address_id.city or "", + 'country_code': address_id.country_id and address_id.country_id.code or "", + 'email': address_id.email or "", + 'phone': address_id.phone.replace('.','').replace('/','').replace('(','').replace(')','').replace(' ',''), 'send_ref': send_ref, 'quarter': quarter, 'month': starting_month, diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index 8cad2d01a3e..fad6ca53f92 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -61,7 +61,7 @@ class partner_vat(osv.osv_memory): company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id period_ids = obj_period.search(cr, uid, [('date_start' ,'>=', date_start), ('date_stop','<=',date_stop), ('company_id','=',company_id)]) if not period_ids: - raise osv.except_osv(_('Insufficient Data!'), _('No data for the selected year.')) + raise osv.except_osv(_('insufficient data!'), _('No data for the selected year.')) partners = [] partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context) @@ -87,6 +87,9 @@ class partner_vat(osv.osv_memory): if record['turnover'] >= data['limit_amount']: id_client = obj_vat_lclient.create(cr, uid, record, context=context) partners.append(id_client) + + if not partners: + raise osv.except_osv(_('insufficient data!'), _('No data found for the selected year.')) context.update({'partner_ids': partners, 'year': data['year'], 'limit_amount': data['limit_amount']}) model_data_ids = obj_model_data.search(cr, uid, [('model','=','ir.ui.view'), ('name','=','view_vat_listing')]) resource_id = obj_model_data.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id'] @@ -190,7 +193,7 @@ class partner_vat_list(osv.osv_memory): phone = ads.phone.replace(' ','') or '' email = ads.email or '' name = ads.name or '' - city = obj_partner.get_city(cr, uid, ads.id) + city = ads.city or '' zip = obj_partner.browse(cr, uid, ads.id, context=context).zip or '' if not city: city = '' diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml index 563396c8a03..4ac165344e8 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml @@ -6,18 +6,18 @@ partner.vat - + + This wizard will create an XML file for VAT details and total invoiced amounts per partner. + + + + + + - - - - - - - + diff --git a/addons/l10n_be/wizard/l10n_be_vat_intra.py b/addons/l10n_be/wizard/l10n_be_vat_intra.py index 47a29a8457f..aa4dac11072 100644 --- a/addons/l10n_be/wizard/l10n_be_vat_intra.py +++ b/addons/l10n_be/wizard/l10n_be_vat_intra.py @@ -108,7 +108,7 @@ class partner_vat_intra(osv.osv_memory): # Get Company vat company_vat = data_company.partner_id.vat if not company_vat: - raise osv.except_osv(_('Insufficient Data!'),_('No VAT number associated with the company.')) + raise osv.except_osv(_('insufficient data!'),_('No VAT number associated with your company.')) company_vat = company_vat.replace(' ','').upper() issued_by = company_vat[:2] diff --git a/addons/l10n_fr_rib/bank_view.xml b/addons/l10n_fr_rib/bank_view.xml index a25867ffa6a..5b750326601 100644 --- a/addons/l10n_fr_rib/bank_view.xml +++ b/addons/l10n_fr_rib/bank_view.xml @@ -8,7 +8,7 @@ - +
+ This wizard will create an XML file for VAT details and total invoiced amounts per partner. +