Amit Patel (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-addons9-accounting-apa into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons9-accounting-apa/+merge/125180
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons9-accounting-apa/+merge/125180
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-addons9-accounting-apa.
=== modified file 'account/account.py'
--- account/account.py	2012-09-14 04:27:25 +0000
+++ account/account.py	2012-09-19 12:16:28 +0000
@@ -836,6 +836,9 @@
 
         @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)

=== modified file 'account/account_invoice.py'
--- account/account_invoice.py	2012-09-12 08:06:24 +0000
+++ account/account_invoice.py	2012-09-19 12:16:28 +0000
@@ -1103,10 +1103,10 @@
         if not ids:
             return []
         types = {
-                'out_invoice': 'CI: ',
-                'in_invoice': 'SI: ',
-                'out_refund': 'OR: ',
-                'in_refund': 'SR: ',
+                'out_invoice': 'Draft Invoice',
+                'in_invoice': 'Draft Invoice ',
+                'out_refund': 'Draft Refund ',
+                'in_refund': 'Draft 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')]
 

=== modified file 'account/account_menuitem.xml'
--- account/account_menuitem.xml	2012-08-29 06:10:48 +0000
+++ account/account_menuitem.xml	2012-09-19 12:16:28 +0000
@@ -30,7 +30,7 @@
         <menuitem id="menu_analytic" parent="menu_analytic_accounting" name="Accounts" groups="analytic.group_analytic_accounting"/>
         <menuitem id="menu_journals" sequence="15" name="Journals" parent="menu_finance_configuration" groups="group_account_manager"/>
         <menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="55"/>
-        <menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20" groups="base.group_no_one"/>
+        <menuitem id="base.menu_action_currency_form" name="Currencies" parent="menu_configuration_misc" sequence="20" groups="base.group_no_one"/>
         <menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reports" sequence="100"/>
         <menuitem id="menu_finance_entries" name="Journal Entries" parent="menu_finance" sequence="5" groups="group_account_user,group_account_manager"/>
         <menuitem id="menu_account_reports" name="Financial Reports" parent="menu_finance_configuration" sequence="30" />

=== modified file 'account/account_move_line.py'
--- account/account_move_line.py	2012-09-10 06:34:52 +0000
+++ account/account_move_line.py	2012-09-19 12:16:28 +0000
@@ -215,8 +215,10 @@
     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 @@
         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.update({'journal_id':context.get('search_default_journal_id',False)})
         # Compute simple values
         data = super(account_move_line, self).default_get(cr, uid, fields, context=context)
         # Starts: Manual entry from account.move form
@@ -926,12 +931,14 @@
             return res
         if (not context.get('journal_id', False)) or (not context.get('period_id', False)):
             return False
-        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'], ))
-        p = cr.fetchone()[0] or ''
-        if j or p:
-            return j + (p and (':' + p) or '')
+        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'], ))
+            p = cr.fetchone()[0] or ''
+            if j or p:
+                return j + (p and (':' + p) or '')
         return False
 
     def onchange_date(self, cr, user, ids, date, context=None):

=== modified file 'account/account_view.xml'
--- account/account_view.xml	2012-09-17 16:49:39 +0000
+++ account/account_view.xml	2012-09-19 12:16:28 +0000
@@ -102,6 +102,7 @@
             <field name="arch" type="xml">
                 <form string="Account Period" version="7.0">
 	                <header>
+	                    <button string="Close Period" name="%(account.action_account_period_close)d" type="action" class="oe_highlight" states="draft"/>
 	                    <button name="action_draft" states="done" string="Set to Draft" type="object" groups="account.group_account_manager"/>
 	                    <field name="state" widget="statusbar" nolabel="1"/>
 	                </header>
@@ -1718,8 +1719,10 @@
             <field name="model">account.payment.term.line</field>
             <field name="arch" type="xml">
                 <form string="Payment Term" version="7.0">
-                    <field name="name"/>
-                    <field name="sequence"/>
+                    <group>
+                        <field name="name"/>
+                        <field name="sequence"/>
+                    </group>
                     <group>
                         <group string="Amount Computation">
                             <field name="value"/>
@@ -1767,12 +1770,11 @@
             <field name="model">account.payment.term</field>
             <field name="arch" type="xml">
                 <form string="Payment Term" version="7.0">
-                    <group>
+                    <group col="4" colspan="4">
                         <field name="name"/>
                         <field name="active"/>
                     </group>
-                    <separator string="Description on Invoices"/>
-                    <field name="note"/>
+                    <field name="note" placeholder="Description on Invoices"/>
                     <separator string="Computation"/>
                     <field name="line_ids"/>
                 </form>

=== modified file 'account/partner_view.xml'
--- account/partner_view.xml	2012-08-13 16:06:57 +0000
+++ account/partner_view.xml	2012-09-19 12:16:28 +0000
@@ -7,34 +7,43 @@
             <field name="model">account.fiscal.position</field>
             <field name="arch" type="xml">
                 <form string="Fiscal Position">
-                    <group col="4">
+                    <group col="4" colspan="4">
                         <field name="name"/>
                         <field name="active"/>
                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
                     </group>
-                    <separator string="Mapping"/>
-                    <field name="tax_ids" widget="one2many_list">
-                        <tree string="Tax Mapping" editable="bottom">
-                            <field name="tax_src_id" domain="[('parent_id','=',False)]"/>
-                            <field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
-                        </tree>
-                        <form string="Tax Mapping">
-                            <field name="tax_src_id" domain="[('parent_id','=',False)]"/>
-                            <field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
-                        </form>
-                    </field>
-                    <field name="account_ids" widget="one2many_list">
-                        <tree string="Account Mapping" editable="bottom">
-                            <field name="account_src_id"/>
-                            <field name="account_dest_id"/>
-                        </tree>
-                        <form string="Account Mapping">
-                            <field name="account_src_id"/>
-                            <field name="account_dest_id"/>
-                        </form>
-                    </field>
-                    <separator string="Notes"/>
-                    <field name="note"/>
+                    <group col="4" colspan="4">
+                         <group col="4" colspan="4">
+                            <group string="Account Mapping">
+                                <field name="account_ids" widget="one2many_list" nolabel="1">
+                                    <tree string="Account Mapping" editable="bottom" >
+                                        <field name="account_src_id"/>
+                                        <field name="account_dest_id"/>
+                                    </tree>
+                                    <form string="Account Mapping">
+                                        <field name="account_src_id"/>
+                                        <field name="account_dest_id"/>
+                                    </form>
+                                </field>
+                            </group>                    
+                            <group string="Tax Mapping">
+                                <field name="tax_ids" widget="one2many_list" nolabel="1">
+                                    <tree string="Tax Mapping" editable="bottom" >
+                                        <field name="tax_src_id" domain="[('parent_id','=',False)]"/>
+                                        <field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
+                                    </tree>
+                                    <form string="Tax Mapping">
+                                        <field name="tax_src_id" domain="[('parent_id','=',False)]"/>
+                                        <field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
+                                    </form>
+                               </field>
+                            </group>
+                        </group>
+                    </group>
+                     <separator string="Notes"/>
+                    <group col="4" colspan="4">
+                        <field name="note" nolabel="1"/>
+                    </group>
                 </form>
             </field>
         </record>
@@ -93,8 +102,10 @@
                     </group>
                     <field name="bank_ids">
                         <form string="Bank account" version="7.0">
-                            <field name="state"/>
-                            <field name="acc_number"/>
+                            <group>
+                                <field name="state" class="oe_inline"/>
+                                <field name="acc_number" class="oe_inline"/>
+                            </group>
                             <group>
                                 <group name="owner" string="Bank Account Owner">
                                     <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>

=== modified file 'account/wizard/account_move_journal.py'
--- account/wizard/account_move_journal.py	2012-09-17 09:41:12 +0000
+++ account/wizard/account_move_journal.py	2012-09-19 12:16:28 +0000
@@ -92,7 +92,7 @@
 
             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")

=== modified file 'account_analytic_analysis/__openerp__.py'
--- account_analytic_analysis/__openerp__.py	2012-08-29 19:08:31 +0000
+++ account_analytic_analysis/__openerp__.py	2012-09-19 12:16:28 +0000
@@ -36,6 +36,7 @@
     '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',

=== added file 'account_analytic_analysis/security/account_analytic_analysis_security.xml'
--- account_analytic_analysis/security/account_analytic_analysis_security.xml	1970-01-01 00:00:00 +0000
+++ account_analytic_analysis/security/account_analytic_analysis_security.xml	2012-09-19 12:16:28 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+    
+    <record model="res.users" id="base.user_root">
+        <field eval="[(4,ref('sale.group_analytic_accounting'))]" name="groups_id"/>
+    </record>
+
+    </data>
+</openerp>
\ No newline at end of file

=== modified file 'account_asset/account_asset_view.xml'
--- account_asset/account_asset_view.xml	2012-08-27 13:24:00 +0000
+++ account_asset/account_asset_view.xml	2012-09-19 12:16:28 +0000
@@ -129,7 +129,7 @@
 	                        </group>
                         </page>
                         <page string="Depreciation Board">
-                            <field name="depreciation_line_ids" mode="tree,graph">
+                            <field name="depreciation_line_ids" mode="tree">
                                 <tree string="Depreciation Lines" colors="blue:(move_check == False);black:(move_check == True)">
                                     <field name="depreciation_date"/>
                                     <field name="sequence" invisible="1"/>
@@ -159,11 +159,6 @@
                                         </group>
                                     </group>
                                 </form>
-                                <graph type="bar">
-                                    <field name="name"/>
-                                    <field name="amount"/>
-                                    <field name="depreciated_value"/>
-                                </graph>
                             </field>
                             <button type="object" name="compute_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','=','close')]}"/>
                         </page>

=== modified file 'account_budget/account_budget_view.xml'
--- account_budget/account_budget_view.xml	2012-09-12 11:18:39 +0000
+++ account_budget/account_budget_view.xml	2012-09-19 12:16:28 +0000
@@ -62,12 +62,7 @@
                             <field name="account_ids"/>
                         </page>
                         <page string="Budget Lines">
-                            <field name="crossovered_budget_line" widget="one2many_list" mode="graph,tree">
-                                <graph type="bar" string="Lines">
-                                    <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
-                                    <field name="planned_amount" operator="+"/>
-                                    <field group="True" name="general_budget_id"/>
-                                </graph>
+                            <field name="crossovered_budget_line" widget="one2many_list" mode="tree">
                                 <tree string="Budget Lines"  editable="top">
                                     <field name="crossovered_budget_id"/>
                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>

=== modified file 'account_budget/security/account_budget_security.xml'
--- account_budget/security/account_budget_security.xml	2011-02-28 13:57:54 +0000
+++ account_budget/security/account_budget_security.xml	2012-09-19 12:16:28 +0000
@@ -22,6 +22,10 @@
             <field eval="True" name="global"/>
             <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
         </record>
+        
+        <record model="res.users" id="base.user_root">
+            <field eval="[(4,ref('analytic.group_analytic_accounting'))]" name="groups_id"/>
+        </record>
 
     </data>
 </openerp>

=== modified file 'account_check_writing/account_voucher.py'
--- account_check_writing/account_voucher.py	2012-06-05 11:51:00 +0000
+++ account_check_writing/account_voucher.py	2012-09-19 12:16:28 +0000
@@ -38,7 +38,7 @@
     _columns = {
         'amount_in_word' : fields.char("Amount in Word" , size=128, readonly=True, states={'draft':[('readonly',False)]}),
         'allow_check' : fields.related('journal_id', 'allow_check_writing', type='boolean', string='Allow Check Writing'),
-        'number': fields.char('Number', size=32),
+        'number': fields.char('Number', size=32,readonly=True),
     }
 
     def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=None):

=== modified file 'account_coda/account_coda_view.xml'
--- account_coda/account_coda_view.xml	2012-08-29 06:10:48 +0000
+++ account_coda/account_coda_view.xml	2012-09-19 12:16:28 +0000
@@ -404,9 +404,9 @@
           <field name="name"/>
           <field name="statement_id" readonly="1"/>
           <field name="ref" readonly="1"/>
-          <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
-          <field name="type" on_change="onchange_type(partner_id, type)"/>
-          <field name="account_id" domain="[('journal_id','=',parent.journal_id)]"/>
+          <field name="partner_id" />
+          <field name="type" />
+          <field name="account_id" />
           <field name="amount" readonly="1" sum="Total Amount"/>
           <field name="globalisation_id" string="Glob. Id"/>
           <field name="globalisation_amount" string="Glob. Am."/>
@@ -426,9 +426,9 @@
                 <field name="val_date"/>
                 <field name="name"/>
                 <field name="ref" readonly="0"/>
-                <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
-                <field name="type" on_change="onchange_type(partner_id, type)"/>
-                <field domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id"/>
+                <field name="partner_id"/>
+                <field name="type" />
+                <field domain="[('type', '&lt;&gt;', 'view')]" name="account_id"/>
                 <field name="amount"/>
                 <field name="globalisation_id"/>
                 <field name="sequence" readonly="0"/>

=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py	2012-09-11 15:35:41 +0000
+++ account_voucher/account_voucher.py	2012-09-19 12:16:28 +0000
@@ -1375,8 +1375,14 @@
         'company_id': fields.related('voucher_id','company_id', relation='res.company', type='many2one', string='Company', store=True, readonly=True),
         'currency_id': fields.function(_currency_id, string='Currency', type='many2one', relation='res.currency', readonly=True),
     }
+    
+    def _default_account_id(self, cr, uid, ids, context=None):
+        prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context)
+        return prop and prop.id or False
+    
     _defaults = {
         'name': '',
+        'account_id':_default_account_id
     }
 
     def onchange_reconcile(self, cr, uid, ids, reconcile, amount, amount_unreconciled, context=None):

=== modified file 'account_voucher/account_voucher_view.xml'
--- account_voucher/account_voucher_view.xml	2012-09-16 11:42:49 +0000
+++ account_voucher/account_voucher_view.xml	2012-09-19 12:16:28 +0000
@@ -47,16 +47,18 @@
                       <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
                   </header>
                   <sheet string="Accounting Voucher">
-                    <group col="6" colspan="4">
+                    <group col="4" colspan="4">
                         <field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
-                        <field name="payment_rate_currency_id" invisible="1"/>
                         <field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id)"/>
                         <field name="journal_id" widget="selection" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
                         <field name="type" required="1"/>
                         <field name="name" colspan="2"/>
                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
                         <field name="reference"/>
+                        <field name="number"/>
+                        <field name="currency_id" groups="base.group_multi_currency"/>
                         <field name="account_id" widget="selection" invisible="True"/>
+                        <field name="payment_rate_currency_id" invisible="1"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Voucher Entry">
@@ -69,20 +71,16 @@
                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
                                 </tree>
                             </field>
-                            <group col="3">
-                                <group string="Internal Notes">
-                                    <field name="narration" colspan="2" nolabel="1"/>
-                                </group>
-                                <group string="Other Information">
-                                    <field name="number"/>
-                                    <field name="currency_id" groups="base.group_multi_currency"/>
-                                </group>
-                                <group col="4" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
-                                    <separator string="Total" colspan="4"/>
-                                    <field name="tax_id" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection"/>
+                            <group>
+                                <field name="narration" nolabel="1" placeholder="Internal Notes"/>
+                                <group class="oe_subtotal_footer oe_right" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
+                                    <field name="tax_id" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection" nolabel="1"/>
                                     <field name="tax_amount" nolabel="1"/>
-                                    <button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
-                                    <label colspan="1" string=""/><field name="amount" string="Total"/>
+                                    <div class="oe_subtotal_footer_separator">
+                                        <label for="amount"/>
+                                        <button type="object" icon="terp-stock_format-scientific"   name="compute_tax" class="oe_link oe_edit_only" string="(Update)" attrs="{'invisible': [('state','!=','draft')]}"/>
+                                    </div>
+                                    <field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
                                 </group>
                             </group>
                         </page>

=== modified file 'l10n_be/__init__.py'
--- l10n_be/__init__.py	2011-01-14 00:11:01 +0000
+++ l10n_be/__init__.py	2012-09-19 12:16:28 +0000
@@ -19,7 +19,6 @@
 #
 ##############################################################################
 
-import company
 import wizard
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file

=== removed file 'l10n_be/company.py'
--- l10n_be/company.py	2012-01-18 10:18:48 +0000
+++ l10n_be/company.py	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    OpenERP, Open Source Management Solution
-#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-#    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 <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-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:

=== modified file 'l10n_be/wizard/l10n_be_account_vat_declaration.py'
--- l10n_be/wizard/l10n_be_account_vat_declaration.py	2012-08-07 10:23:26 +0000
+++ l10n_be/wizard/l10n_be_account_vat_declaration.py	2012-09-19 12:16:28 +0000
@@ -45,8 +45,8 @@
         '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 @@
         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 @@
             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 company.'))
         vat_no = vat_no.replace(' ','').upper()
         vat = vat_no[2:]
 
@@ -93,8 +94,9 @@
         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 @@
         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,

=== modified file 'l10n_be/wizard/l10n_be_partner_vat_listing.py'
--- l10n_be/wizard/l10n_be_partner_vat_listing.py	2012-08-07 10:23:26 +0000
+++ l10n_be/wizard/l10n_be_partner_vat_listing.py	2012-09-19 12:16:28 +0000
@@ -61,7 +61,7 @@
             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 @@
             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 @@
             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 = ''

=== modified file 'l10n_be/wizard/l10n_be_partner_vat_listing.xml'
--- l10n_be/wizard/l10n_be_partner_vat_listing.xml	2012-08-08 13:06:14 +0000
+++ l10n_be/wizard/l10n_be_partner_vat_listing.xml	2012-09-19 12:16:28 +0000
@@ -6,18 +6,18 @@
       <field name="model">partner.vat</field>
       <field name="arch" type="xml">
         <form string="Partner VAT Listing" version="7.0">
-          <header>
+          <group>
+            <label string="This wizard will create an XML file for VAT details and total invoiced amounts per partner." colspan="4"/>
+            <newline/>
+            <field name="year"/>
+            <newline/>
+            <field name="limit_amount"/>
+          </group>
+          <footer>
             <button name="get_partner" string="View Customers" type="object"  class="oe_highlight"  />
             or 
             <button string="Cancel" class="oe_link" special="cancel" />
-          </header>
-          <group>
-            <label string="This wizard will create an XML file for VAT details and total invoiced amounts per partner." colspan="4"/>
-          </group>
-          <newline/>
-          <field name="year"/>
-          <newline/>
-          <field name="limit_amount"/>
+          </footer>
         </form>
       </field>
     </record>

=== modified file 'l10n_be/wizard/l10n_be_vat_intra.py'
--- l10n_be/wizard/l10n_be_vat_intra.py	2012-08-07 10:23:26 +0000
+++ l10n_be/wizard/l10n_be_vat_intra.py	2012-09-19 12:16:28 +0000
@@ -108,7 +108,7 @@
         # 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 company.'))
         company_vat = company_vat.replace(' ','').upper()
         issued_by = company_vat[:2]
 

=== modified file 'l10n_fr_rib/bank_view.xml'
--- l10n_fr_rib/bank_view.xml	2012-08-08 13:06:14 +0000
+++ l10n_fr_rib/bank_view.xml	2012-09-19 12:16:28 +0000
@@ -8,7 +8,7 @@
             <field name="inherit_id" ref="account.view_partner_property_form" />
             <field name="arch" type="xml">
                 <data>
-                    <xpath expr="//field[@name='bank_ids']/form/field[@name='acc_number']" position="before">
+                    <xpath expr="//field[@name='bank_ids']/form/group/field[@name='acc_number']" position="before">
                         <newline />
                         <field name="bank_code" />
                         <field name="office" />

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to