diff --git a/addons/.pydevproject b/addons/.pydevproject new file mode 100644 index 00000000000..78259a9c3db --- /dev/null +++ b/addons/.pydevproject @@ -0,0 +1,6 @@ + + + + +python 2.4 + diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index 01d9f9e499f..5084b6e2318 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -50,9 +50,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 27075fbb648..1f8428527ae 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -844,7 +844,7 @@ class account_move(osv.osv): if line.account_id.currency_id: if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id): - raise osv.except_osv(_('Error'), _('Couldn\'t create move with currency different than the secondary currency of the account')) + raise osv.except_osv(_('Error'), _('Couldn\'t create move with currency different than the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.' % (line.account_id.code, line.account_id.name))) if abs(amount) < 0.0001: if not len(line_draft_ids): @@ -1687,10 +1687,13 @@ class account_tax_code_template(osv.osv): 'info': fields.text('Description'), 'parent_id': fields.many2one('account.tax.code.template', 'Parent Code', select=True), 'child_ids': fields.one2many('account.tax.code.template', 'parent_id', 'Childs Codes'), - 'company_id': fields.many2one('res.company', 'Company', required=True), 'sign': fields.float('Sign for parent', required=True), } + _defaults = { + 'sign': lambda *args: 1.0, + } + def name_get(self, cr, uid, ids, context=None): if not len(ids): return [] @@ -1700,17 +1703,6 @@ class account_tax_code_template(osv.osv): return [(x['id'], (x['code'] and x['code'] + ' - ' or '') + x['name']) \ for x in reads] - def _default_company(self, cr, uid, context={}): - user = self.pool.get('res.users').browse(cr, uid, uid, context=context) - if user.company_id: - return user.company_id.id - return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] - - _defaults = { - 'company_id': _default_company, - 'sign': lambda *args: 1.0, - } - def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): @@ -1742,7 +1734,6 @@ class account_chart_template(osv.osv): 'property_account_payable': fields.many2one('account.account.template','Payable Account'), 'property_account_expense_categ': fields.many2one('account.account.template','Expense Category Account'), 'property_account_income_categ': fields.many2one('account.account.template','Income Category Account'), - 'property_account_tax': fields.many2one('account.account.template','Default Tax on Partner'), 'property_account_expense': fields.many2one('account.account.template','Expense Account on Product Template'), 'property_account_income': fields.many2one('account.account.template','Income Account on Product Template'), } @@ -1859,9 +1850,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): obj_journal = self.pool.get('account.journal') obj_acc_template = self.pool.get('account.account.template') - if obj_multi.code_digits<=5: - raise osv.except_osv(_('User Error'), _('Account code should be of more than 5 digits.')) - # Creating Account obj_acc_root = obj_multi.chart_template_id.account_root_id tax_code_root_id = obj_multi.chart_template_id.tax_code_root_id.id @@ -1926,6 +1914,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): #deactivate the parent_store functionnality on account_account for rapidity purpose self.pool._init = True + children_acc_template = obj_acc_template.search(cr, uid, [('parent_id','child_of',[obj_acc_root.id])]) for account_template in obj_acc_template.browse(cr, uid, children_acc_template): tax_ids = [] @@ -1943,7 +1932,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'name': (obj_acc_root.id == account_template.id) and obj_multi.company_id.name or account_template.name, #'sign': account_template.sign, 'currency_id': account_template.currency_id and account_template.currency_id.id or False, - 'code': code_acc[:dig], + 'code': code_acc, 'type': account_template.type, 'user_type': account_template.user_type and account_template.user_type.id or False, 'reconcile': account_template.reconcile, @@ -1963,8 +1952,8 @@ class wizard_multi_charts_accounts(osv.osv_memory): for key,value in todo_dict.items(): if value['account_collected_id'] or value['account_paid_id']: obj_acc_tax.write(cr, uid, [key], vals={ - 'account_collected_id': value['account_collected_id'], - 'account_paid_id': value['account_paid_id'], + 'account_collected_id': acc_template_ref[value['account_collected_id']], + 'account_paid_id': acc_template_ref[value['account_paid_id']], }) # Creating Journals @@ -2045,7 +2034,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): ('property_account_payable','res.partner','account.account'), ('property_account_expense_categ','product.category','account.account'), ('property_account_income_categ','product.category','account.account'), - ('property_account_tax','res.partner','account.tax'), ('property_account_expense','product.template','account.account'), ('property_account_income','product.template','account.account') ] diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 1f76270ee4e..1c4ef5546c7 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -124,6 +124,7 @@ + @@ -149,7 +150,7 @@ - + @@ -198,7 +199,7 @@ - + @@ -208,17 +209,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -280,7 +281,7 @@ - + @@ -290,17 +291,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 9b3726b5c40..a9500a37187 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -10,12 +10,13 @@ + - + diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 89c19a436d0..8d652e06723 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1568,7 +1568,6 @@
- diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml index f2573a71f9b..7be194e2f65 100644 --- a/addons/account/account_wizard.xml +++ b/addons/account/account_wizard.xml @@ -48,19 +48,19 @@ - + - + - + - - + + diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index cee3a333e6a..606440020d0 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -149,15 +149,9 @@ your own chart of account. - - property_account_supplier_tax - - - - - - property_account_tax - + + property_account_position + @@ -199,15 +193,6 @@ your own chart of account. - - Stock Journal - STJ - general - - - - - diff --git a/addons/account/i18n/fr_FR.po b/addons/account/i18n/fr_FR.po index e275365f645..2a888155ce6 100644 --- a/addons/account/i18n/fr_FR.po +++ b/addons/account/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account # @@ -6,18 +6,14 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 4.3.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"Date: 2008-09-10 15:05:34+0000Last-Translator: <>Language-Team: MIME-" -"Version: 1.0Content-Type: text/plain; charset=UTF-8Content-Transfer-" -"Encoding: Plural-Forms:\n" -"Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-09-05 16:27+0000\n" -"PO-Revision-Date: 2008-10-10 06:55+0000\n" +"PO-Revision-Date: 2008-10-14 11:13+0000\n" "Last-Translator: Olivier Laurent \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2008-10-10 06:56+0000\n" +"X-Launchpad-Export-Date: 2008-10-14 11:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -28,7 +24,7 @@ msgstr "% réalisation" #. module: account #: view:account.move:0 msgid "Account entry" -msgstr "Pièce comptable" +msgstr "Entrée de compte" #. module: account #: field:account.tax,description:0 @@ -39,7 +35,7 @@ msgstr "Nom interne" #. module: account #: view:account.tax.code:0 msgid "Account Tax Code" -msgstr "Compte de Taxe" +msgstr "Code du compte taxe" #. module: account #: model:ir.model,name:account.model_account_budget_post @@ -59,7 +55,7 @@ msgstr "" #. module: account #: selection:account.subscription,period_type:0 msgid "month" -msgstr "mois" +msgstr "Mois" #. module: account #: view:account.payment.term:0 @@ -143,7 +139,7 @@ msgstr "Entrées non-réconciliées" #: model:ir.ui.menu,name:account.menu_action_move_line_form #: view:account.bank.statement.reconcile:0 msgid "Entries" -msgstr "Ecritures" +msgstr "Écritures" #. module: account #: selection:account.move.line,centralisation:0 @@ -171,12 +167,12 @@ msgstr "Quantité" #. module: account #: field:account.analytic.line,product_uom_id:0 msgid "UoM" -msgstr "Unité Principale" +msgstr "UdM" #. module: account #: view:account.tax:0 msgid "Keep empty to use the expense account" -msgstr "Ne pas remplir pour utiliser le compte de dépense" +msgstr "Laisser vide pour utiliser le compte de dépense" #. module: account #: rml:account.third_party_ledger:0 @@ -194,7 +190,7 @@ msgstr "Modèle d'écriture comptable" #. module: account #: field:account.tax.code,sum_period:0 msgid "Period Sum" -msgstr "Somme de la période" +msgstr "Montant total de la période" #. module: account #: view:account.tax:0 @@ -261,7 +257,7 @@ msgstr "Fixe" #: wizard_view:account.partner.balance.report,init:0 #: wizard_view:account.third_party_ledger.report,init:0 msgid "Select period" -msgstr "Sélectionner une période" +msgstr "Sélectionnez une période" #. module: account #: field:account.invoice,origin:0 @@ -623,7 +619,7 @@ msgstr "Note de Crédit Client" #: field:account.tax,ref_tax_sign:0 #: field:account.tax,tax_sign:0 msgid "Tax Code Sign" -msgstr "Facteur multiplicateur"l +msgstr "Facteur multiplicateur" #. module: account #: view:account.move.line:0 @@ -913,7 +909,7 @@ msgstr "Montant payé" #. module: account #: model:account.account.type,name:account.account_type_view msgid "Total Account" -msgstr "" +msgstr "Compte Total" #. module: account #: selection:account.account,sign:0 @@ -1130,7 +1126,7 @@ msgstr "Résultats budgétaires" #. module: account #: view:res.partner:0 msgid "Customer Credit" -msgstr "" +msgstr "Crédit Client" #. module: account #: field:account.invoice,tax_line:0 @@ -1160,7 +1156,7 @@ msgstr "Date de Facture :" #. module: account #: field:account.chart.template,property_receivable_id:0 msgid "Receivable Account" -msgstr "" +msgstr "Compte Recevable" #. module: account #: rml:account.central.journal:0 @@ -1187,12 +1183,12 @@ msgstr "Date de fin" #. module: account #: field:res.partner,debit:0 msgid "Total Payable" -msgstr "" +msgstr "Montant à payer" #. module: account #: wizard_view:account_use_models,create:0 msgid "Use Model" -msgstr "" +msgstr "Utiliser un Modèle" #. module: account #: model:account.account.type,name:account.account_type_income @@ -2383,7 +2379,7 @@ msgstr "Êtes-vous sûr de vouloir rembourser cette facture ?" #. module: account #: model:ir.actions.wizard,name:account.wizard_paid_open msgid "Open State" -msgstr "" +msgstr "État Ouvert" #. module: account #: field:account.journal,entry_posted:0 @@ -2739,7 +2735,7 @@ msgstr "Créer" #: model:ir.actions.act_window,name:account.action_bank_statement_tree2 #: model:ir.ui.menu,name:account.menu_bank_statement_tree2 msgid "New Statement" -msgstr "" +msgstr "Nouvelle Déclaration" #. module: account #: model:ir.model,name:account.model_account_invoice_line @@ -2953,7 +2949,7 @@ msgstr "Écriture d'abonnement" #. module: account #: rml:account.invoice:0 msgid "Tel. :" -msgstr "" +msgstr "Tél. :" #. module: account #: wizard_button:account.wizard_paid_open,init,yes:0 @@ -3126,7 +3122,7 @@ msgstr "Nom de la taxe" #. module: account #: rml:account.invoice:0 msgid "VAT :" -msgstr "" +msgstr "TVA :" #. module: account #: field:account.chart.template,property_payable_id:0 @@ -3142,7 +3138,7 @@ msgstr "Devise" #. module: account #: view:account.config.fiscalyear:0 msgid "Don't Create" -msgstr "" +msgstr "Ne pas créer" #. module: account #: rml:account.partner.balance:0 @@ -4122,7 +4118,7 @@ msgstr "Toutes les entrées de compte" #: wizard_button:account.wizard.account.duplicate,init,duplicate:0 #: model:ir.actions.wizard,name:account.wizard_account_duplicate msgid "Duplicate" -msgstr "" +msgstr "Dupliquer" #. module: account #: model:ir.actions.wizard,name:account.wizard_reconcile_unreconcile diff --git a/addons/account/invoice.py b/addons/account/invoice.py index b81c624ded4..4b9ab3f10d5 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -171,7 +171,7 @@ class account_invoice(osv.osv): ('cancel','Canceled') ],'State', select=True, readonly=True), - 'date_invoice': fields.date('Date Invoiced', required=True, states={'open':[('readonly',True)],'close':[('readonly',True)]}), + 'date_invoice': fields.date('Date Invoiced', states={'open':[('readonly',True)],'close':[('readonly',True)]}), 'date_due': fields.date('Due Date', states={'open':[('readonly',True)],'close':[('readonly',True)]}), 'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}), @@ -203,7 +203,7 @@ class account_invoice(osv.osv): } _defaults = { 'type': _get_type, - 'date_invoice': lambda *a: time.strftime('%Y-%m-%d'), + #'date_invoice': lambda *a: time.strftime('%Y-%m-%d'), 'state': lambda *a: 'draft', 'journal_id': _get_journal, 'currency_id': _get_currency, @@ -332,9 +332,9 @@ class account_invoice(osv.osv): if default is None: default = {} default = default.copy() - default.update({'state':'draft', 'number':False, 'move_id':False,}) + default.update({'state':'draft', 'number':False, 'move_id':False}) if 'date_invoice' not in default: - default['date_invoice'] = time.strftime('%Y-%m-%d') + default['date_invoice'] = False if 'date_due' not in default: default['date_due'] = False return super(account_invoice, self).copy(cr, uid, id, default, context) @@ -428,6 +428,8 @@ class account_invoice(osv.osv): continue if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0): raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.')) + if not inv.date_invoice: + self.write(cr, uid, [inv.id], {'date_invoice':time.strftime('%Y-%m-%d')}) company_currency = inv.company_id.currency_id.id # create the analytical lines line_ids = self.read(cr, uid, [inv.id], ['invoice_line'])[0]['invoice_line'] @@ -473,7 +475,7 @@ class account_invoice(osv.osv): i['amount_currency'] = i['price'] i['price'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, i['price'], - context={'date': inv.date_invoice}) + context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}) else: i['amount_currency'] = False i['currency_id'] = False @@ -534,7 +536,7 @@ class account_invoice(osv.osv): 'ref': ref }) - date = inv.date_invoice + date = inv.date_invoice or time.strftime('%Y-%m-%d') part = inv.partner_id.id line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x, part, date, context={})) ,iml) @@ -549,7 +551,7 @@ class account_invoice(osv.osv): move = {'name': name, 'line_id': line, 'journal_id': journal_id} period_id=inv.period_id and inv.period_id.id or False if not period_id: - period_ids= self.pool.get('account.period').search(cr,uid,[('date_start','<=',inv.date_invoice),('date_stop','>=',inv.date_invoice)]) + period_ids= self.pool.get('account.period').search(cr,uid,[('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))]) if len(period_ids): period_id=period_ids[0] if period_id: @@ -856,7 +858,8 @@ class account_invoice_line(osv.osv): lang=self.pool.get('res.partner').read(cr, uid, [partner_id])[0]['lang'] tax_obj = self.pool.get('account.tax') if type in ('out_invoice', 'out_refund'): - taxep = self.pool.get('res.partner').browse(cr, uid, partner_id).property_account_tax + part = self.pool.get('res.partner').browse(cr, uid, partner_id) + taxep = part.property_account_position and part.property_account_position.account_tax if not taxep or not taxep.id: tax_id = map(lambda x: x.id, res.taxes_id) else: @@ -865,7 +868,8 @@ class account_invoice_line(osv.osv): if not t.tax_group==taxep.tax_group: tax_id.append(t.id) else: - taxep = self.pool.get('res.partner').browse(cr, uid, partner_id).property_account_supplier_tax + part = self.pool.get('res.partner').browse(cr, uid, partner_id) + taxep = part.property_account_position and part.property_account_position.account_supplier_tax if not taxep or not taxep.id: tax_id = map(lambda x: x.id, res.supplier_taxes_id) else: @@ -889,6 +893,8 @@ class account_invoice_line(osv.osv): a = res.product_tmpl_id.property_account_expense.id if not a: a = res.categ_id.property_account_expense_categ.id + + a = self.pool.get('account.fiscal.position').map_account(cr, uid, part, a) if a: result['account_id'] = a @@ -961,7 +967,8 @@ class account_invoice_line(osv.osv): if not (partner_id and account_id): return {} taxes = self.pool.get('account.account').browse(cr, uid, account_id).tax_ids - taxep = self.pool.get('res.partner').browse(cr, uid, partner_id).property_account_tax + part = self.pool.get('res.partner').browse(cr, uid, partner_id) + taxep = partner.property_account_position and partner.property_account_position.account_tax if not taxep.id: return {'value': {'invoice_line_tax_id': map(lambda x: x.id, taxes or []) }} res = [taxep.id] @@ -1020,14 +1027,14 @@ class account_invoice_tax(osv.osv): if inv.type in ('out_invoice','in_invoice'): val['base_code_id'] = tax['base_code_id'] val['tax_code_id'] = tax['tax_code_id'] - val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice}) - val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'date': inv.date_invoice}) + val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}) + val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}) val['account_id'] = tax['account_collected_id'] or line.account_id.id else: val['base_code_id'] = tax['ref_base_code_id'] val['tax_code_id'] = tax['ref_tax_code_id'] - val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice}) - val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date': inv.date_invoice}) + val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}) + val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}) val['account_id'] = tax['account_paid_id'] or line.account_id.id key = (val['tax_code_id'], val['base_code_id'], val['account_id']) diff --git a/addons/account/partner.py b/addons/account/partner.py index a47aae0d792..fbb4839f452 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -31,6 +31,44 @@ from osv import fields, osv import ir +class account_fiscal_position(osv.osv): + _name = 'account.fiscal.position' + _description = 'Fiscal Position' + _columns = { + 'name': fields.char('Fiscal Position', size=64, translate=True, required=True), + 'company_id': fields.many2one('res.company', 'Company'), + 'account_tax': fields.many2one( + 'account.tax', 'Customer Tax', + help="This account will be used as the receivable account for partners in this position", + ), + 'account_supplier_tax': fields.many2one( + 'account.tax', 'Supplier Tax', + help="This account will be used as the payable account for partners in this position", + ), + 'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Accounts Mapping') + } + def map_account(self, cr, uid, partner, account_id, context={}): + if (not partner) or (not partner.property_account_position) : + return account_id + for pos in partner.property_account_position.account_ids: + if pos.account_src_id.id==account_id: + account_id = pos.account_dest_id.id + break + return account_id +account_fiscal_position() + + +class account_fiscal_position_account(osv.osv): + _name = 'account.fiscal.position.account' + _description = 'Fiscal Position Accounts Mapping' + _rec_name = 'position_id' + _columns = { + 'position_id': fields.many2one('account.fiscal.position', 'Fiscal Position', required=True, ondelete='cascade'), + 'account_src_id': fields.many2one('account.account', 'Account Source', required=True), + 'account_dest_id': fields.many2one('account.account', 'Account Destination', required=True) + } +account_fiscal_position_account() + class res_partner(osv.osv): _name = 'res.partner' _inherit = 'res.partner' @@ -109,24 +147,15 @@ class res_partner(osv.osv): domain="[('type', '=', 'receivable')]", help="This account will be used, instead of the default one, as the receivable account for the current partner", required=True), - 'property_account_supplier_tax': fields.property( - 'account.tax', + 'property_account_position': fields.property( + 'account.fiscal.position', type='many2one', - relation='account.tax', - string="Default Supplier Tax", + relation='account.fiscal.position', + string="Fiscal Position", method=True, view_load=True, - domain=[('parent_id','=',False)], - help="This tax will be used, instead of the default one for supplier invoices."), - 'property_account_tax': fields.property( - 'account.tax', - type='many2one', - relation='account.tax', - string="Default Tax", - method=True, - view_load=True, - domain=[('parent_id','=',False)], - help="This tax will be used, instead of the default one for customers."), + help="The fiscal position will determine taxes and the accounts used for the the partner.", + ), 'property_payment_term': fields.property( 'account.payment.term', type='many2one', diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index d580ff02285..bfe4e80ced0 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -1,6 +1,57 @@ + + + account.fiscal.position.form + account.fiscal.position + form + + + + + + + + + + + + + + + + + + + + + + account.fiscal.position.tree + account.fiscal.position + tree + + + + + + + + + + + + Fiscal Positions + account.fiscal.position + form + tree,form + + + + @@ -17,13 +68,12 @@ - + - diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index ccc8fb420e7..74ce6a354e9 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -91,7 +91,7 @@ + parent="account_analytic_def_account"/> diff --git a/addons/account/project/report/analytic_check.rml b/addons/account/project/report/analytic_check.rml index 991d8e38c55..0bbc727e9f6 100644 --- a/addons/account/project/report/analytic_check.rml +++ b/addons/account/project/report/analytic_check.rml @@ -17,7 +17,7 @@ [[ company.name ]] - Analytic Check + Analytic Check - [[ company.currency_id.name ]] diff --git a/addons/account/project/report/analytic_journal.py b/addons/account/project/report/analytic_journal.py index 80673bba85d..5fc8466c90c 100644 --- a/addons/account/project/report/analytic_journal.py +++ b/addons/account/project/report/analytic_journal.py @@ -65,7 +65,7 @@ class account_analytic_journal(report_sxw.rml_parse): res = self.cr.dictfetchone() return res['sum'] or 0 -report_sxw.report_sxw('report.account.analytic.journal', 'account.analytic.journal', 'addons/account/project/report/analytic_journal.rml',parser=account_analytic_journal) +report_sxw.report_sxw('report.account.analytic.journal', 'account.analytic.journal', 'addons/account/project/report/analytic_journal.rml',parser=account_analytic_journal,header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/report/analytic_journal.rml b/addons/account/project/report/analytic_journal.rml index 105c137d4d2..d7e9f391114 100644 --- a/addons/account/project/report/analytic_journal.rml +++ b/addons/account/project/report/analytic_journal.rml @@ -3,229 +3,136 @@ - + + - + + - - - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - [[ repeatIn(objects,'o') ]] - - - - [[ company.name ]] - - - Analytic journal - - - Period from [[ data['form']['date1'] ]] - to [[ data['form']['date2'] ]] - + + [[ repeatIn(objects,'o') ]] + + + Date + Code + Move name + Account n° + General + Analytic - - - - [[ o.code ]] - - - [[ o.name ]] - - - Currency: [[ company.currency_id.name ]] - - - - - - - Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] - - - - - - - Date - - - Code - - - Move name - - - Account n° - - - Accounting moves - General - Analytic - - - - - - -
- [[ repeatIn(lines(o.id,data['form']['date1'],data['form']['date2']), 'move') ]] - - - - - - - - - - - - - - [[ move.name ]] - - - [[ move.account_id.code ]] - [[ move.account_id.name ]] - - - [[ '%.2f' % (move.debit-move.credit) ]] - - - - - - - [[ repeatIn(lines_a(move.id,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] - [[ move_a.date ]] - - - [[ move_a.code ]] - - - [[ move_a.name ]] - - - [[ move_a.account_id.code ]] - [[ move_a.account_id.name ]] - - - [[ '%.2f' % move_a.amount ]] - - - - - - -
- - - - [[ repeatIn(lines_a(False,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] - [[ move_a.date ]] - - - [[ move_a.code ]] - - - [[ move_a.name ]] - - - [[move_a.account_id.code ]] - [[ move_a.account_id.name ]] - - - [[ '%.2f' % move_a.amount ]] - - - - - - - - - - Sums of the journal - - - [[ '%.2f' % sum_general(o.id,data['form']['date1'],data['form']['date2']) ]] - [[ '%.2f' % sum_analytic(o.id,data['form']['date1'],data['form']['date2']) ]] - - - - - - -
- + + + + [[ o.code ]] - [[ o.name ]] + [[ '%.2f' % sum_general(o.id,data['form']['date1'],data['form']['date2']) ]] + [[ '%.2f' % sum_analytic(o.id,data['form']['date1'],data['form']['date2']) ]] + + + +
+ + [[ repeatIn(lines(o.id,data['form']['date1'],data['form']['date2']), 'move') ]] + + + + + + [[ move.name ]] + [[ move.account_id.code ]] - [[ move.account_id.name ]] + + [[ '%.2f' % (move.debit-move.credit) ]] + + + + + + + + [[ repeatIn(lines_a(move.id,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] + [[ move_a.date ]] + + [[ move_a.code ]] + [[ move_a.name ]] + [[ move_a.account_id.code ]] - [[ move_a.account_id.name ]] + + [[ '%.2f' % move_a.amount ]] + + + +
+ + + + + [[ repeatIn(lines_a(False,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] + [[ move_a.date ]] + [[ move_a.code ]] + [[ move_a.name ]] + [[move_a.account_id.code ]] - [[ move_a.account_id.name ]] + + [[ '%.2f' % move_a.amount ]] + + + + + + \ No newline at end of file diff --git a/addons/account/project/report/cost_ledger.rml b/addons/account/project/report/cost_ledger.rml index 9b62c559a12..f3640e421d6 100644 --- a/addons/account/project/report/cost_ledger.rml +++ b/addons/account/project/report/cost_ledger.rml @@ -72,18 +72,20 @@ - - + + + + @@ -94,7 +96,6 @@ - @@ -125,15 +126,18 @@ - - - + + + + + - - + + - - + + + @@ -161,7 +165,7 @@ - + Period from @@ -174,7 +178,7 @@ - + [[ data['form']['date1'] ]] @@ -191,10 +195,10 @@
- + - Code / Date + Code / Date J.C. / Move name @@ -211,15 +215,13 @@ - + - - - + Total : - Total: + [[ '%.2f' % (sum_debit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]] @@ -237,7 +239,7 @@ [[ repeatIn(objects,'o') ]] - + [[ o.code ]] @@ -259,46 +261,43 @@ [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]] - + - [[ move_g['code'] ]] + [[ move_g['code'] ]] - [[ move_g['name'] ]] + [[ move_g['name'] ]] - [[ '%.2f' % move_g['debit'] ]] + [[ '%.2f' % move_g['debit'] ]] - [[ '%.2f' % move_g['credit'] ]] + [[ '%.2f' % move_g['credit'] ]] - [[ '%.2f' % move_g['balance'] ]] + [[ '%.2f' % move_g['balance'] ]] [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] - + - [[ move_a['date'] ]] + [[ move_a['date'] ]] - [[ move_a['cj'] ]] + [[ move_a['cj'] ]] / [[ move_a['name'] ]] - [[ move_a['name'] ]] + [[ '%.2f' % move_a['debit'] ]] - [[ '%.2f' % move_a['debit'] ]] + [[ '%.2f' % move_a['credit'] ]] - [[ '%.2f' % move_a['credit'] ]] - - - [[ '%.2f' % move_a['balance'] ]] + [[ '%.2f' % move_a['balance'] ]] @@ -319,4 +318,4 @@ - + \ No newline at end of file diff --git a/addons/account/project/report/inverted_analytic_balance.rml b/addons/account/project/report/inverted_analytic_balance.rml index 63100e50a9d..3453e8f009b 100644 --- a/addons/account/project/report/inverted_analytic_balance.rml +++ b/addons/account/project/report/inverted_analytic_balance.rml @@ -17,7 +17,7 @@ [[ company.name ]] - Inverted Analytic Balance + Inverted Analytic Balance - [[ company.currency_id.name ]] diff --git a/addons/account/project/report/quantity_cost_ledger.rml b/addons/account/project/report/quantity_cost_ledger.rml index 755ed501fd3..f87c74f4d69 100644 --- a/addons/account/project/report/quantity_cost_ledger.rml +++ b/addons/account/project/report/quantity_cost_ledger.rml @@ -132,8 +132,10 @@ - - + + + + @@ -217,12 +219,10 @@ - - - + Total: - Total: + [[ '%.2f' % (sum_quantity(objects,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0) ]] @@ -238,7 +238,7 @@ - [[ o.code ]] + [[ o.code ]] [[ o.complete_name ]] @@ -257,33 +257,30 @@ - [[ move_g['code'] ]] + [[ move_g['code'] ]] - [[ move_g['name'] ]] + [[ move_g['name'] ]] - + - [[ '%.2f' % (move_g['quantity'] or 0.0) ]] + [[ '%.2f' % (move_g['quantity'] or 0.0) ]] - + - [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]][[ move_a['date'] ]] + [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]][[ move_a['date'] ]] - [[ move_a['cj'] ]] - - - [[ move_a['name'] ]] + [[ move_a['cj'] ]] / [[ move_a['name'] ]] [[ '%.2f' % (move_a['quantity'] or 0.0 )]] diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index f14ab460225..a3206fbcdf8 100644 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -40,6 +40,7 @@ import overdue import aged_trial_balance import tax_report import general_ledger_landscape +import account_tax_code # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml index cfabf9d545f..8178d8fa399 100755 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -42,7 +42,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -80,6 +80,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + [[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][[ a['jname'] or removeParentNode('tr') ]] - [[ a['level']<4 and removeParentNode('font') or '...'*(2) ]][[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][ref: [[ a['ref'] or removeParentNode('font') ]] ] [[ a['lname'] ]] + [[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]] [[ setTag('tr','tr',{'style':('TrLevel_Name'+str(a['level']))}) ]][ref: [[ a['ref'] or removeParentNode('font') ]] ] [[ a['lname'] ]] [[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']] [[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']] [[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]] @@ -277,4 +302,3 @@ - diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index 5110287b2b0..5076fbaba87 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -59,7 +59,7 @@ class journal_print(report_sxw.rml_parse): def _sum_credit(self, period_id, journal_id): self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id)) return self.cr.fetchone()[0] or 0.0 -report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print) +report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print,header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml index 0deffbdee64..4831315864a 100644 --- a/addons/account/report/account_journal.rml +++ b/addons/account/report/account_journal.rml @@ -3,6 +3,37 @@ @@ -13,24 +44,25 @@ - - - + + + + + - + + + + + - - - - - @@ -38,14 +70,18 @@ - - + + - - - - - + + + + + + + + + @@ -53,111 +89,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + [[ repeatIn(objects, 'o') ]] - + - - - + Date - Journal + Voucher No - [[o.period_id.name ]] + A/c No. + + + Third party + + + Entry label + + + Debit + + + Credit - + - [[ company.name ]] + [[o.period_id.name ]] - [[ o.journal_id.code ]] [[ o.journal_id.name ]] + [[ o.journal_id.code ]] + + + + + [[ '%.2f' % sum_debit(o.period_id.id, o.journal_id.id) or '0.00' ]] - Currency: [[ company.currency_id.name ]] + [[ '%.2f' % sum_credit(o.period_id.id, o.journal_id.id) or '0.00' ]] - - + + + [[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]] + [[ line.date ]] + + + [[ line.ref ]] + + + [[ line.account_id.code ]] + + + [[ line.partner_id and line.partner_id.name ]] + + + [[ line.name ]] + + + [[ line.debit and '%.2f' % line.debit or '0.00' ]] + + + [[ line.credit and '%.2f' % line.credit or '0.00' ]] + + - Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] - - - - - - - Date - - - Voucher Nb - - - Account Number - - - Third party - - - Entry label - - - Debit - - - Credit - - - - - - [[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]] - [[ line.date ]] - - - - [[ line.ref ]] - - - [[ line.account_id.code ]] - - - [[ line.partner_id and line.partner_id.name ]] - - - [[ line.name ]] - - - [[ line.debit and '%.2f' % line.debit or '' ]] - - - [[ line.credit and '%.2f' % line.credit or '' ]] - - - - - - - TOTAL: - - - [[ '%.2f' % sum_debit(o.period_id.id, o.journal_id.id) ]] - - - [[ '%.2f' % sum_credit(o.period_id.id, o.journal_id.id) ]] - - - - - - - - + \ No newline at end of file diff --git a/addons/account/report/account_tax_code.py b/addons/account/report/account_tax_code.py new file mode 100644 index 00000000000..b236c087949 --- /dev/null +++ b/addons/account/report/account_tax_code.py @@ -0,0 +1,19 @@ +import time +import pooler +import rml_parse +import copy +from report import report_sxw +import re + +class account_tax_code_report(rml_parse.rml_parse): + _name = 'report.account.tax.code.entries' + def __init__(self, cr, uid, name, context): + super(account_tax_code_report, self).__init__(cr, uid, name, context) + self.localcontext.update({ + 'time': time, + }) + + +report_sxw.report_sxw('report.account.tax.code.entries', 'account.tax.code', + 'addons/account/report/account_tax_code.rml', parser=account_tax_code_report, header=False) + diff --git a/addons/account/report/account_tax_code.rml b/addons/account/report/account_tax_code.rml index ade928c8a9d..c33827bf559 100644 --- a/addons/account/report/account_tax_code.rml +++ b/addons/account/report/account_tax_code.rml @@ -2,7 +2,31 @@ @@ -10,42 +34,29 @@ - - - - - - - - - - - - - + - + - + + + + + + + + + + + + - - - - - - - - - - - - @@ -53,113 +64,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + - [[ repeatIn(objects, 'o') ]] - + + - +
+ - Date + Date - Voucher Nb + Voucher Nb - Account Number + Account Number - Third party (Country) + Third party (Country) - Entry label + Entry label - Debit + Debit - Credit + Credit - - + - - - [[ repeatIn(o.line_ids, 'line') ]] - [[ line.date ]] - - - - [[ line.ref ]] - - - [[ line.account_id.code ]] - - - [[ line.partner_id and line.partner_id.name ]] ([[ line.partner_id and line.partner_id.address and line.partner_id.address[0].country_id.code or '' ]] ) - - - [[ line.name ]] - - - [[ '%.2f' % line.debit ]] - - - [[ '%.2f' % line.credit ]] - + + [[ repeatIn(objects, 'o') ]] + [[ repeatIn(o.line_ids, 'line') ]] + + + + [[ line.date ]] + + + [[ line.ref ]] + + + [[ line.account_id.code ]] + + + [[ line.partner_id and line.partner_id.name ]]([[ line.partner_id and line.partner_id.address and line.partner_id.address[0].country_id.code or removeParentNode('font') ]] ) + + + [[ line.name ]] + + + [[ formatLang(line.debit) or '%.2f' % line.debit ]] + + + [[ formatLang(line.credit) or '%.2f' % line.credit ]] + + + + - - - - TOTAL: - - - - - - - - - - - - - - +
+
diff --git a/addons/account/report/central_journal.py b/addons/account/report/central_journal.py index c4dab8fc600..7b595a311a7 100644 --- a/addons/account/report/central_journal.py +++ b/addons/account/report/central_journal.py @@ -55,7 +55,7 @@ class journal_print(report_sxw.rml_parse): def _sum_credit(self, period_id, journal_id): self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id)) return self.cr.fetchone()[0] or 0.0 -report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print) +report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/central_journal.rml b/addons/account/report/central_journal.rml index 359465379d2..ade1659de58 100644 --- a/addons/account/report/central_journal.rml +++ b/addons/account/report/central_journal.rml @@ -3,6 +3,30 @@ @@ -10,44 +34,62 @@ - - - - - - - - - - - - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - @@ -55,104 +97,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - [[ repeatIn(objects, 'o') ]] - + + - Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] - + - + [[ repeatIn(objects, 'o') ]] + - Account number + Journal Code - Account name + Journal Name - Currency - - - Debit - - - Credit + Printing Date - + - [[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]][[ line['code'] ]] + [[ o.journal_id.code or '' ]] - [[ line['name'] ]] + [[ o.journal_id.name ]] - - - - - - [[ line['debit'] and '%.2f' % line['debit'] or '' ]] - - - [[ line['credit'] and '%.2f' % line['credit'] or '' ]] + [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] - - - - TOTAL: - - - [[ '%.2f' % sum_debit(o.period_id.id, o.journal_id.id) ]] - - - [[ '%.2f' % sum_credit(o.period_id.id, o.journal_id.id) ]] - - - - + - - + + + + + + + Account Num. + + + Account Name + + + Debit + + + Credit + + + + + + + + + Total: + + + + + + + + [[ '%.2f' % sum_debit(o.period_id.id, o.journal_id.id) ]] + + + [[ '%.2f' % sum_credit(o.period_id.id, o.journal_id.id) ]] + + + + + + + + + [[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]] + + + + [[ line['code'] ]] + + + [[ line['name'] ]] + + + [[ formatLang(line['debit']) and '%.2f' % line['debit'] or '0.00' ]] + + + [[ formatLang(line['credit']) and '%.2f' % line['credit'] or '0.00' ]] + + + + + + +
- diff --git a/addons/account/report/general_journal.py b/addons/account/report/general_journal.py index 9233a98b765..8899977e17a 100644 --- a/addons/account/report/general_journal.py +++ b/addons/account/report/general_journal.py @@ -96,7 +96,7 @@ class journal_print(report_sxw.rml_parse): return 0.0 self.cr.execute('select sum(credit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'') return self.cr.fetchone()[0] or 0.0 -report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print) +report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/general_journal.rml b/addons/account/report/general_journal.rml index 8de0f1a82ea..f89c7d201b6 100644 --- a/addons/account/report/general_journal.rml +++ b/addons/account/report/general_journal.rml @@ -1,8 +1,32 @@ - - + - + - + - + - - + + - - + + @@ -91,7 +91,7 @@ - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] Date @@ -122,7 +122,7 @@ [[ repeatIn(objects, 'a') ]] [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - + @@ -139,7 +139,7 @@ [[sum_solde_account(o, data['form']) or '0.0' ]] - + @@ -147,7 +147,7 @@ - + Balance Initial @@ -169,13 +169,13 @@ [[ (o.init_debit - o.init_credit) or '0.0' ]] - + [[ repeatIn(lines(o, data['form']), 'line') ]] [[ line['date'] ]] - + [[ line['partner'] ]] @@ -197,14 +197,14 @@ [[ line['progress'] and line['progress'] or '0.0' ]] - + - - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + + [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] Date @@ -229,17 +229,17 @@ Balance - + Currency - - + + [[ repeatIn(objects, 'a') ]] [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - + @@ -256,18 +256,18 @@ [[sum_solde_account(o, data['form']) or '0.0' ]] - + [[ sum_currency_amount_account(a, data['form']) or '0.0' ]] - + [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] - + Balance Initial @@ -292,7 +292,7 @@ - + [[ repeatIn(lines(o, data['form']), 'line') ]] @@ -323,15 +323,15 @@ [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]] - + - + - + - - - - + + + + \ No newline at end of file diff --git a/addons/account/report/general_ledger_landscape.rml b/addons/account/report/general_ledger_landscape.rml index 439dff350bb..16ddfa9a594 100755 --- a/addons/account/report/general_ledger_landscape.rml +++ b/addons/account/report/general_ledger_landscape.rml @@ -16,7 +16,7 @@ [[ company.name ]] - General Ledger + General Ledger - [[ company.currency_id.name ]] @@ -24,39 +24,39 @@ Page - + 1.3cm 24.9cm 38.3cm 24.9cm - + - + - + - + - + - - + + - - + + @@ -92,10 +92,10 @@ - - - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] - + + + [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + @@ -145,10 +145,10 @@ [[ repeatIn(objects, 'a') ]] [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - + - - + + @@ -165,18 +165,18 @@ [[ sum_solde_account(o, data['form']) or '0.0' ]] - + [[ sum_currency_amount_account(o, data['form']) or '0.0' ]] - + [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] Balance Initial - + @@ -207,13 +207,13 @@ - - - + + + [[ repeatIn(lines(o, data['form']), 'line') ]] - + [[ line['date'] ]] @@ -247,17 +247,17 @@ [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]] - - + + - - - + + + - - - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + + + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] @@ -320,7 +320,7 @@ Balance - + [[ repeatIn(objects, 'a') ]] @@ -342,14 +342,14 @@ [[sum_solde_account(o, data['form']) or '0.0' ]] - + [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] - + Solde Initial @@ -368,7 +368,7 @@ - + [[ o.init_debit or '0.0' ]] @@ -378,7 +378,7 @@ [[ o.init_debit - o.init_credit or '0.0' ]] - + [[ repeatIn(lines(o, data['form']), 'line') ]] @@ -412,15 +412,15 @@ [[ line['progress'] and line['progress'] or '0.0' ]] - -
+ +
-
+
- - + + - + \ No newline at end of file diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml index f9f213f0d89..aa0d111b28f 100644 --- a/addons/account/report/overdue.rml +++ b/addons/account/report/overdue.rml @@ -14,195 +14,193 @@ + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - [[ repeatIn(objects,'o') ]] - [[ setLang(o.lang) ]] + [[ repeatIn(objects,'o') ]] + [[ setLang(o.lang) ]] - + - [[ o.name ]] - [[ adr_get(o, 'invoice')['name'] ]] - [[ adr_get(o, 'invoice')['street'] ]] - [[ adr_get(o, 'invoice')['zip'] ]] [[ adr_get(o, 'invoice')['city'] ]] - [[ adr_get(o, 'invoice')['country_id'] and adr_get(o, 'invoice')['country_id'][1] ]] - + [[ o.name ]] + [[ adr_get(o, 'invoice')['name'] ]] + [[ adr_get(o, 'invoice')['street'] ]] + [[ adr_get(o, 'invoice')['zip'] ]] [[ adr_get(o, 'invoice')['city'] ]] + [[ adr_get(o, 'invoice')['country_id'] and adr_get(o, 'invoice')['country_id'][1] ]] + - VAT: [[ o.vat or removeParentNode('para') ]] + VAT: [[ o.vat or removeParentNode('para') ]] + + + + + + + Document: Customer account statement - + Date: + [[ time.strftime('%d/%m/%Y') ]] - - - - Document: Customer account statement - - Date: - [[ time.strftime('%d/%m/%Y') ]] - - Customer Ref: [[ o.id ]] - - - - Dear Sir/Madam, - - - - Exception made of a mistake of our side, it seems that the following bills stay unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. - - - - Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at [[ tel_get(company.partner_id) ]]. - - - - Best regards. + Customer Ref: [[ o.id ]] - + Dear Sir/Madam, + + + + Exception made of a mistake of our side, it seems that the following bills stay unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. + + + + Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at +32 81 81 37 00. + + + + Best regards. + + + + - Date + Date - Description + Description - Ref + Ref - Maturity date + Maturity date - Due + Due - Paid + Paid - Maturity + Maturity - Li. + Li. - + - - [[repeatIn(getLines(o), 'line') ]] - [[ line['date'] ]] - + Sub-Total: + + + + + + [[ '%.2f' % (reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] - [[ line['name'] ]] + [[ '%.2f' % (reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] - [[ line['ref'] ]] + [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]] - [[ line['date_maturity'] ]] - - - [[ line['debit'] and '%.2f' % (line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] - - - [[ line['credit'] and '%.2f' % (line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] - - - [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and '%.2f' % ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] - - - [[ line['blocked'] and 'X' or '' ]] - - - - - - - Sub-Total: - - - [[ '%.2f' % (reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] - - - - [[ '%.2f' % (reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] - - - - [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]] - - - + - Balance: + Balance: + + + + + + [[ '%.2f' % (reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] - [[ '%.2f' % (reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] + + + @@ -210,27 +208,52 @@ - + + + + + + + [[repeatIn(getLines(o), 'line') ]] + [[ line['date'] ]] + + - - - + [[ line['name'] ]] + + + [[ line['ref'] ]] + + + [[ line['date_maturity'] ]] + + + [[ line['debit'] and '%.2f' % (line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] + + + [[ line['credit'] and '%.2f' % (line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] + + + [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and '%.2f' % ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]] + + + [[ line['blocked'] and 'X' or '' ]] - + - - Total amount due: - [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] [[ company.currency_id.name ]]. + + Total amount due: + [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] [[ company.currency_id.name ]] + . - + - diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py index e7313354aea..519456527c8 100644 --- a/addons/account/report/partner_balance.py +++ b/addons/account/report/partner_balance.py @@ -67,10 +67,13 @@ class partner_balance(report_sxw.rml_parse): return full_str_date # + + def transform_period_into_date_array(self,data): ## Get All Period Date # # If we have no period we will take all perdio in the FiscalYear. + print"data['form']['periods'][0][2]",data['form']['periods'][0][2] if not data['form']['periods'][0][2] : periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])]) else: @@ -79,7 +82,6 @@ class partner_balance(report_sxw.rml_parse): for period_id in periods_id: period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id) date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop) - self.date_lst = date_array self.date_lst.sort() @@ -89,7 +91,54 @@ class partner_balance(report_sxw.rml_parse): self.date_lst = return_array self.date_lst.sort() - + def transform_both_into_date_array(self,data): + if not data['form']['periods'][0][2] : + periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])]) + else: + periods_id = data['form']['periods'][0][2] + date_array = [] + for period_id in periods_id: + period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id) + date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop) + + period_start_date = date_array[0] + date_start_date = data['form']['date1'] + period_stop_date = date_array[-1] + date_stop_date = data['form']['date2'] + + if period_start_date sum(credit) " \ @@ -178,6 +245,7 @@ class partner_balance(report_sxw.rml_parse): # # # + self.cr.execute( "SELECT p.ref,l.account_id,ac.name as account_name,ac.code as code ,p.name, sum(debit) as debit, sum(credit) as credit, " \ "CASE WHEN sum(debit) > sum(credit) " \ @@ -202,7 +270,7 @@ class partner_balance(report_sxw.rml_parse): "GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \ "ORDER BY l.account_id,p.name") res = self.cr.dictfetchall() - print"=====res=====",res + for r in res: full_account.append(r) @@ -229,18 +297,19 @@ class partner_balance(report_sxw.rml_parse): new_header['ref'] = '' new_header['name'] = r['account_name'] new_header['code'] = r['code'] - new_header['debit'] = 0 - new_header['credit'] = 0 - new_header['scredit'] = 0 - new_header['sdebit'] = 0 - new_header['enlitige'] = 0 - new_header['balance'] = 0 + new_header['debit'] = tot_debit + new_header['credit'] = tot_credit + new_header['scredit'] = tot_scredit + new_header['sdebit'] = tot_sdebit + new_header['enlitige'] = tot_enlitige + new_header['balance'] = float(tot_sdebit) - float(tot_scredit) new_header['type'] = 3 ## completearray.append(new_header) # r['type'] = 1 r['balance'] = float(r['sdebit']) - float(r['scredit']) + completearray.append(r) # tot_debit = r['debit'] @@ -252,21 +321,27 @@ class partner_balance(report_sxw.rml_parse): else: if cleanarray[i]['account_id'] <> cleanarray[i-1]['account_id']: ## - new_tot = {} - new_tot['ref'] = 'Total' - new_tot['name'] = cleanarray[i-1]['account_name'] - new_tot['code'] = cleanarray[i-1]['code'] - - new_tot['debit'] = tot_debit - new_tot['credit'] = tot_credit - new_tot['scredit'] = tot_scredit - new_tot['sdebit'] = tot_sdebit - new_tot['enlitige'] = tot_enlitige - new_tot['balance'] = float(tot_sdebit) - float(tot_scredit) - new_tot['type'] = 3 - ## - completearray.append(new_tot) - +# new_tot = {} +# new_tot['ref'] = 'Total' +# new_tot['name'] = cleanarray[i-1]['account_name'] +# new_tot['code'] = cleanarray[i-1]['code'] +# +# new_tot['debit'] = tot_debit +# new_tot['credit'] = tot_credit +# new_tot['scredit'] = tot_scredit +# new_tot['sdebit'] = tot_sdebit +# new_tot['enlitige'] = tot_enlitige +# new_tot['balance'] = float(tot_sdebit) - float(tot_scredit) +# new_tot['type'] = 3 +# ## +# completearray.append(new_tot) + new_header['debit'] = tot_debit + new_header['credit'] = tot_credit + new_header['scredit'] = tot_scredit + new_header['sdebit'] = tot_sdebit + new_header['enlitige'] = tot_enlitige + new_header['balance'] = float(tot_sdebit) - float(tot_scredit) + new_header['type'] = 3 # we reset the counter tot_debit = r['debit'] tot_credit = r['credit'] @@ -279,12 +354,12 @@ class partner_balance(report_sxw.rml_parse): new_header['ref'] = '' new_header['name'] = r['account_name'] new_header['code'] = r['code'] - new_header['debit'] = 0 - new_header['credit'] = 0 - new_header['scredit'] = 0 - new_header['sdebit'] = 0 - new_header['enlitige'] = 0 - new_header['balance'] = 0 + new_header['debit'] = tot_debit + new_header['credit'] = tot_credit + new_header['scredit'] = tot_scredit + new_header['sdebit'] = tot_sdebit + new_header['enlitige'] = tot_enlitige + new_header['balance'] = float(tot_sdebit) - float(tot_scredit) new_header['type'] = 3 ## ## @@ -296,8 +371,10 @@ class partner_balance(report_sxw.rml_parse): r['balance'] = float(r['sdebit']) - float(r['scredit']) # completearray.append(r) + if cleanarray[i]['account_id'] == cleanarray[i-1]['account_id']: # we reset the counter + tot_debit = tot_debit + r['debit'] tot_credit = tot_credit + r['credit'] tot_scredit = tot_scredit + r['scredit'] @@ -308,8 +385,11 @@ class partner_balance(report_sxw.rml_parse): # r['balance'] = float(r['sdebit']) - float(r['scredit']) # + completearray.append(r) + i = i + 1 + return completearray @@ -320,6 +400,7 @@ class partner_balance(report_sxw.rml_parse): result_tmp = 0.0 # # + if data['form']['soldeinit'] : self.cr.execute( 'SELECT sum(debit) ' \ @@ -443,17 +524,21 @@ class partner_balance(report_sxw.rml_parse): # ' account_id IN (' + self.account_ids + ') ' \ 'l.date IN (' + self.date_lst_string + ') ' \ 'GROUP BY partner_id') - + a = self.cr.fetchone()[0] + print"====self.cr.fetchone()====",a if self.cr.fetchone() != None: - result_tmp = result_tmp + float(self.cr.fetchone()[0] or 0.0) + result_tmp = result_tmp + (a or 0.0) else: result_tmp = 0.0 + return result_tmp def _sum_scredit(self,data): + if not self.ids: return 0.0 account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') + result_tmp = 0.0 # # @@ -470,8 +555,9 @@ class partner_balance(report_sxw.rml_parse): 'AND l.reconcile_id IS NULL ' \ 'GROUP BY partner_id', (self.date_lst[0],)) + print"self.cr.fetchone()[0]",self.cr.fetchone() if self.cr.fetchone() != None: - result_tmp = float(self.cr.fetchone()[0]) + result_tmp = float(self.cr.fetchone()[0]) or 0.0 else: result_tmp = 0.0 # @@ -486,9 +572,10 @@ class partner_balance(report_sxw.rml_parse): # ' account_id IN (' + self.account_ids + ') ' \ 'l.date IN (' + self.date_lst_string + ') ' \ 'GROUP BY partner_id') - + a = self.cr.fetchone()[0] if self.cr.fetchone() != None: - result_tmp = result_tmp + float(self.cr.fetchone()[0] or 0.0) + result_tmp = result_tmp + (a or 0.0) + else: result_tmp = 0.0 diff --git a/addons/account/report/partner_balance.rml b/addons/account/report/partner_balance.rml index 5e99323bb09..561eb07f505 100644 --- a/addons/account/report/partner_balance.rml +++ b/addons/account/report/partner_balance.rml @@ -3,6 +3,7 @@ @@ -55,11 +57,13 @@ - - - - - + + + + + @@ -76,24 +80,29 @@ - + - - + - - + + + + + + + - - + + + @@ -103,106 +112,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - Grand total - - - [[ comma_me(sum_debit(data)) ]] - - - [[ comma_me(sum_credit(data)) ]] - - - [[ comma_me(sum_sdebit(data)) ]] - - - [[ comma_me(sum_scredit(data)) ]] - - - [[ comma_me(sum_litige(data)) ]] - - - - - Balance - - - - - - - - - - - - - [[ comma_me(solde_debit(data)) ]] - - - [[ comma_me(solde_credit(data)) ]] - - - - - - - - - - - - Code + [[ setTag('tr','tr',{'style':'Line1'}) ]] Code Partner name - Débit + Débit - Crédit + Crédit - Balance + Balance - In dispute + In dispute - [[ repeatIn(lines(data), 'a') ]][[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['ref'] ]] + [[ setTag('tr','tr',{'style':'Line2'}) ]] Grand total - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['type']==3 and a['code'] ]] [[ a['name'] ]] + - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ comma_me(a['debit']) ]] + [[ sum_debit(data) or '0.0' ]] - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ comma_me(a['credit']) ]] + [[ sum_credit(data) or '0.0' ]] - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ comma_me(a['balance']) ]] + [[ (sum_scredit(data)-sum_sdebit(data)) or '0.0' ]] - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ comma_me(a['enlitige']) ]] + [[ sum_litige(data) or '0.0' ]] + + + + + + [[ repeatIn(lines(data), 'a') ]][[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['ref'] ]] [[ a['type']==3 and a['code'] ]] + + + [[ a['type']==3 and ( setTag('tr','tr',{'style':'TrLevel0'})) ]] [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['type']==1 and ( setTag('blockTable','blockTable',{'style':'LineLevel1'})) ]] [[ a['name'] ]] + + + + [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['debit'] or '0.0' ]] + [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['debit'] or '0.0' ]] + + + + + [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['credit'] or '0.0' ]] + [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['credit'] or '0.0' ]] + + + + + [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['balance'] or '0.0' ]] + [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['balance'] or '0.0' ]] + + + + + [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['enlitige'] or '0.0' ]] + [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['enlitige'] or '0.0' ]] + - - - - - - - - - + \ No newline at end of file diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py index 445ca968878..6e8cc64f29c 100755 --- a/addons/account/report/tax_report.py +++ b/addons/account/report/tax_report.py @@ -87,7 +87,7 @@ class tax_report(rml_parse.rml_parse): while ind_general < len(res_general) : res_general[ind_general]['type'] = 2 res_general[ind_general]['pos'] = 0 - res_general[ind_general]['level'] = res_dict['level'] + ' ' + res_general[ind_general]['level'] = res_dict['level'] top_result.append(res_general[ind_general]) ind_general+=1 i+=1 @@ -143,6 +143,7 @@ class tax_report(rml_parse.rml_parse): GROUP BY account.id,account.name,account.code', ('draft',tax_code_id, company_id)) res = self.cr.dictfetchall() + #AND line.period_id IN ('+ period_sql_list +') \ i = 0 @@ -158,7 +159,7 @@ class tax_report(rml_parse.rml_parse): res = [] for code in tc.browse(self.cr, self.uid, ids, {'based_on': based_on}): res.append(('a'*2*level,code)) - print"=====res=====",res + res += self._get_codes(based_on, code.id, level+1) return res diff --git a/addons/account/report/tax_report.rml b/addons/account/report/tax_report.rml index 50dd5a89dda..3b34e3bb618 100755 --- a/addons/account/report/tax_report.rml +++ b/addons/account/report/tax_report.rml @@ -128,19 +128,11 @@ - - - - - + - - - - [[ repeatIn(get_lines(data['form']['based_on'],data['form']['periods'],data['form']['company_id']), 'o') ]] [[ o['level'] ]] - [[o['type']==1 and ( setTag('para','para',{'fontName':'Helvetica'}))]] + [[o['type']==1 and ( setTag('para','para',{'fontName':'Helvetica'}))]] [[ setTag('tr','tr',{'style':'TrLevel'+str(o['level']), 'paraStyle':('Level'+str(o['level']))}) ]] [[ o['code'] ]] [[ o['name'] ]] - [[o['type']==2 and (o['debit']) ]] + + + [[ len(o['level'])>3 and removeParentNode('font') ]][[ formatLang(o['debit']) and '%.2f'%o['debit'] or '0.00' ]] + [[ len(o['level'])<4 and removeParentNode('font') ]][[ formatLang(o['debit']) and '%.2f'%o['debit'] or '0.00' ]] + - [[o['type']==2 and (o['credit']) ]] + [[ len(o['level'])>3 and removeParentNode('font') ]][[ formatLang(o['credit']) and '%.2f'%o['credit'] or '0.00' ]] + [[ len(o['level'])<4 and removeParentNode('font') ]][[ formatLang(o['credit']) and '%.2f'%o['credit'] or '0.00' ]] + + - [[ o['tax_amount'] ]] + [[ len(o['level'])>3 and removeParentNode('font') ]][[ formatLang(o['tax_amount']) and '%.2f'%o['tax_amount'] or '0.00' ]] + [[ len(o['level'])<4 and removeParentNode('font') ]][[ formatLang(o['tax_amount']) and '%.2f'%o['tax_amount'] or '0.00' ]] + + diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index c8bda2a3045..6d7f7a9bf16 100755 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -79,6 +79,54 @@ class third_party_ledger(rml_parse.rml_parse): self.date_lst = return_array self.date_lst.sort() + def transform_both_into_date_array(self,data): + + if not data['form']['periods'][0][2] : + periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])]) + else: + periods_id = data['form']['periods'][0][2] + date_array = [] + for period_id in periods_id: + period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id) + date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop) + + period_start_date = date_array[0] + date_start_date = data['form']['date1'] + period_stop_date = date_array[-1] + date_stop_date = data['form']['date2'] + + if period_start_date @@ -53,43 +53,43 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + @@ -124,16 +124,16 @@ - + [[ data['form']['page_split'] == True or removeParentNode('para') ]] [[ repeatIn(objects, 'p') ]] [[ setLang(p.partner_id.lang) ]] - + - + Date @@ -147,7 +147,7 @@ Debit - + Credit @@ -183,7 +183,7 @@ [[ data['form']['page_split'] == False or removeParentNode('para') ]] [[ repeatIn(objects, 'p') ]] - + [[ p.ref ]] - [[ p.name ]] @@ -202,7 +202,7 @@ - + [[ repeatIn(lines(p,data), 'line') ]][[ line['date'] ]] @@ -211,10 +211,10 @@ [[ line['code'] ]] - [[ line['ref'] ]] + [[ line['ref'] ]] / [[ line['name'] ]] - [[ line['name'] ]] + [[ (line['debit']) or '' ]] @@ -227,13 +227,13 @@ - + - - - - + + + + - + \ No newline at end of file diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index 3860447ff9d..7f441b1b551 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -1,4 +1,4 @@ - + Finance / Invoice @@ -11,4 +11,29 @@ Finance / Manager + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 67bbe0f197e..18183dd0313 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -4,15 +4,17 @@ "access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0 "access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0 "access_account_account","account.account","model_account_account","account.group_account_user",1,0,0,0 +"access_account_account_partner_manager","account.account partner manager","model_account_account","base.group_user",1,0,0,0 "access_account_journal_view","account.journal.view","model_account_journal_view","account.group_account_user",1,0,0,0 "access_account_journal_column","account.journal.column","model_account_journal_column","account.group_account_user",1,0,0,0 "access_account_journal","account.journal","model_account_journal","account.group_account_user",1,0,0,0 "access_account_period","account.period","model_account_period","account.group_account_user",1,0,0,0 +"access_account_journal_period_manager","account.journal.period manager","model_account_journal_period","account.group_account_manager",1,1,1,1 "access_account_journal_period","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1 "access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1 "access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1 -"access_account_tax_code","account.tax.code","model_account_tax_code","account.group_account_user",1,0,0,0 -"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0 +"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0 +"access_account_tax","account.tax","model_account_tax",,1,0,0,0 "access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1 "access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1 "access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1 @@ -24,25 +26,22 @@ "access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1 "access_wizard_multi_charts_accounts","wizard.multi.charts.accounts","model_wizard_multi_charts_accounts","account.group_account_manager",1,1,1,1 "access_account_bank_accounts_wizard","account.bank.accounts.wizard","model_account_bank_accounts_wizard","account.group_account_manager",1,1,1,1 -"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1 +"access_account_move_line","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1 "access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,1,1,1 "access_account_bank_statement_reconcile","account.bank.statement.reconcile","model_account_bank_statement_reconcile","account.group_account_user",1,1,1,1 "access_account_bank_statement_reconcile_line","account.bank.statement.reconcile.line","model_account_bank_statement_reconcile_line","account.group_account_user",1,1,1,1 "access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,1,1,1 "access_account_analytic_line","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1 "access_report_hr_timesheet_invoice_journal","report.hr.timesheet.invoice.journal","model_report_hr_timesheet_invoice_journal","account.group_account_manager",1,0,0,0 -"access_account_invoice","account.invoice","model_account_invoice","account.group_account_user",1,0,0,0 -"access_account_invoice_line","account.invoice.line","model_account_invoice_line","account.group_account_user",1,0,0,0 -"access_account_invoice_tax","account.invoice.tax","model_account_invoice_tax","account.group_account_user",1,0,0,0 -"access_account_analytic_account","account.analytic.account","model_account_analytic_account","account.group_account_user",1,0,0,0 +"access_account_analytic_account","account.analytic.account","model_account_analytic_account","base.group_user",1,0,0,0 "access_account_analytic_journal","account.analytic.journal","model_account_analytic_journal","account.group_account_user",1,0,0,0 -"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_user",1,1,1,1 -"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_user",1,1,1,1 -"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_user",1,1,1,1 +"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_invoice",1,1,1,1 +"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_invoice",1,1,1,1 +"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_invoice",1,1,1,1 "access_account_analytic_line_uinvoice","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1 -"access_account_move_uinvoice","account.move","model_account_move","account.group_account_user",1,1,1,1 -"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1 -"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1 +"access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,1,1,1 +"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1 +"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_invoice",1,1,1,1 "access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1 "access_account_payment_term_line_manager","account.payment.term.line","model_account_payment_term_line","account.group_account_manager",1,1,1,1 "access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,1,1,1 @@ -51,9 +50,12 @@ "access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,1,1,1 "access_account_journal_column_manager","account.journal.column","model_account_journal_column","account.group_account_manager",1,1,1,1 "access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,1,1,1 +"access_account_journal_invoice","account.journal invoice","model_account_journal","account.group_account_invoice",1,0,0,0 "access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,1,1,1 +"access_account_period_invoice","account.period invoice","model_account_period","account.group_account_invoice",1,0,0,0 "access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1 "access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1 +"access_account_invoice_group_invoice","account.invoice group invoice","model_account_invoice","account.group_account_invoice",1,1,1,1 "access_account_invoice_manager","account.invoice","model_account_invoice","account.group_account_manager",1,1,1,1 "access_account_invoice_line_manager","account.invoice.line","model_account_invoice_line","account.group_account_manager",1,1,1,1 "access_account_invoice_tax_manager","account.invoice.tax","model_account_invoice_tax","account.group_account_manager",1,1,1,1 @@ -62,3 +64,18 @@ "access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1 "access_account_fiscalyear_user","account.fiscalyear.user","model_account_fiscalyear","account.group_account_user",1,0,0,0 "access_account_fiscalyear_invoice","account.fiscalyear.invoice","model_account_fiscalyear","account.group_account_invoice",1,0,0,0 +"access_res_currency_account_manager","res.currency account manager","base.model_res_currency","group_account_manager",1,1,1,1 +"access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1 +"access_account_config_wizard_account_manager","account.config.wizard account manager","model_account_config_wizard","group_account_manager",1,1,1,1 +"access_account_config_wizard_system_manager","account.config.wizard system manager","model_account_config_wizard","base.group_system",1,1,1,1 +"access_account_invoice_partner_manager","account.invoice partner manager","model_account_invoice","base.group_partner_manager",1,0,0,0 +"access_account_invoice_line_partner_manager","account.invoice.line partner manager","model_account_invoice_line","base.group_partner_manager",1,0,0,0 +"access_account_invoice_tax_partner_manager","account.invoice.tax partner manager","model_account_invoice_tax","base.group_partner_manager",1,0,0,0 +"access_account_payment_term_partner_manager","account.payment.term partner manager","model_account_payment_term","base.group_user",1,0,0,0 +"access_account_payment_term_line_partner_manager","account.payment.term.line partner manager","model_account_payment_term_line","base.group_user",1,0,0,0 +"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0 +"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0 +"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1 +"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,1,1,1 +"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0 +"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0 diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py index 431e183f156..3677f51f050 100644 --- a/addons/account/wizard/wizard_account_balance_report.py +++ b/addons/account/wizard/wizard_account_balance_report.py @@ -46,7 +46,7 @@ dates_form = ''' dates_fields = { 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')}, 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, - 'display_account':{'string':"Display accounts",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]} + 'display_account':{'string':"Filter on Accounts",'type':'selection','selection':[('bal_mouvement','With Entries'),('bal_all','All Accounts'),('bal_solde','With Balance Different Than 0')]} } @@ -61,8 +61,12 @@ period_form = ''' period_fields = { - 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear', - 'help': 'Keep empty for all open fiscal year'}, + 'fiscalyear': { + 'string':'Fiscal year', + 'type':'many2one', + 'relation':'account.fiscalyear', + 'help':'Keep empty for all open fiscal year' + }, 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}, 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]} } diff --git a/addons/account/wizard/wizard_aged_trial_balance.py b/addons/account/wizard/wizard_aged_trial_balance.py index ce95c2c8ab1..7e8bcc6048c 100755 --- a/addons/account/wizard/wizard_aged_trial_balance.py +++ b/addons/account/wizard/wizard_aged_trial_balance.py @@ -35,76 +35,84 @@ from mx.DateTime import * _aged_trial_form = """
- - - - - - - - + + + + + + + + """ _aged_trial_fields = { - 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True}, - 'period_length': {'string': 'Period length (days)', 'type': 'integer', 'required': True, 'default': lambda *a:30}, - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, - 'result_selection':{'string':"Display partner",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]}, - 'direction_selection':{'string':"Display aged balance of",'type':'selection','selection':[('past','Due amount'),('future','Not due amount')]}, - } + 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True}, + 'period_length': {'string': 'Period length (days)', 'type': 'integer', 'required': True, 'default': lambda *a:30}, + 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, + 'result_selection':{ + 'string':"Filter on Partners", + 'type':'selection', + 'selection':[('customer','Customer'),('supplier','Supplier'),('all','All')], + 'required':True, + 'default': lambda *a: 'customer', + }, + 'direction_selection':{ + 'string':"Analysis Direction", + 'type':'selection', + 'selection':[('past','Past'),('future','Future')], + 'required':True, + 'default': lambda *a: 'past', + }, +} def _calc_dates(self, cr, uid, data, context): - res = {} - period_length = data['form']['period_length'] - if period_length<=0: - raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !') - start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d"))) - start = DateTime(int(start.year),int(start.month),int(start.day)) - if data['form']['direction_selection'] == 'past': - for i in range(5)[::-1]: - stop = start - RelativeDateTime(days=period_length) - res[str(i)] = { - 'name' : str((5-(i+1))*period_length) + '-' + str((5-i)*period_length), - - 'stop': start.strftime('%Y-%m-%d'), - 'start' : stop.strftime('%Y-%m-%d'), - } - start = stop - RelativeDateTime(days=1) - else: - for i in range(5): - stop = start + RelativeDateTime(days=period_length) - res[str(5-(i+1))] = { - 'name' : str((i)*period_length)+'-'+str((i+1)*period_length), - 'start': start.strftime('%Y-%m-%d'), - 'stop' : stop.strftime('%Y-%m-%d'), - } - start = stop + RelativeDateTime(days=1) - return res + res = {} + period_length = data['form']['period_length'] + if period_length<=0: + raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !') + start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d"))) + start = DateTime(int(start.year),int(start.month),int(start.day)) + if data['form']['direction_selection'] == 'past': + for i in range(5)[::-1]: + stop = start - RelativeDateTime(days=period_length) + res[str(i)] = { + 'name' : str((5-(i+1))*period_length) + '-' + str((5-i)*period_length), + + 'stop': start.strftime('%Y-%m-%d'), + 'start' : stop.strftime('%Y-%m-%d'), + } + start = stop - RelativeDateTime(days=1) + else: + for i in range(5): + stop = start + RelativeDateTime(days=period_length) + res[str(5-(i+1))] = { + 'name' : str((i)*period_length)+'-'+str((i+1)*period_length), + 'start': start.strftime('%Y-%m-%d'), + 'stop' : stop.strftime('%Y-%m-%d'), + } + start = stop + RelativeDateTime(days=1) + return res class wizard_report(wizard.interface): - def _get_defaults(self, cr, uid, data, context): - fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') - data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid) - - user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) - if user.company_id: - company_id = user.company_id.id - else: - company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] - data['form']['company_id'] = company_id - - return data['form'] - - - states = { - 'init': { - 'actions': [_get_defaults], - 'result': {'type':'form', 'arch':_aged_trial_form, 'fields':_aged_trial_fields, 'state':[('end','Cancel'),('print','Print Aged Trial Balance')]}, - }, - 'print': { - 'actions': [_calc_dates], - 'result': {'type':'print', 'report':'account.aged_trial_balance', 'state':'end'}, - }, - } + def _get_defaults(self, cr, uid, data, context): + fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') + data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid) + user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) + if user.company_id: + company_id = user.company_id.id + else: + company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] + data['form']['company_id'] = company_id + return data['form'] + states = { + 'init': { + 'actions': [_get_defaults], + 'result': {'type':'form', 'arch':_aged_trial_form, 'fields':_aged_trial_fields, 'state':[('end','Cancel'),('print','Print Aged Trial Balance')]}, + }, + 'print': { + 'actions': [_calc_dates], + 'result': {'type':'print', 'report':'account.aged_trial_balance', 'state':'end'}, + }, + } wizard_report('account.aged.trial.balance') diff --git a/addons/account/wizard/wizard_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py index 08af6074215..5b28e10ceb9 100644 --- a/addons/account/wizard/wizard_partner_balance_report.py +++ b/addons/account/wizard/wizard_partner_balance_report.py @@ -29,78 +29,80 @@ import time import wizard import pooler -report_type = ''' -
-
''' - - -dates_form = ''' -
- - - - - - - -''' - -dates_fields = { - 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True}, - 'result_selection':{'string':"Display partner ",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]}, - 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'}, - 'date1': {'string':'Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -} - period_form = ''' -
- - - - - + + - + + +
diff --git a/addons/account_report/report/__init__.py b/addons/account_report/report/__init__.py index 3592ada3b0a..03cbac9c6d7 100644 --- a/addons/account_report/report/__init__.py +++ b/addons/account_report/report/__init__.py @@ -29,6 +29,7 @@ ############################################################################## import accounting_report +import print_indicator # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py new file mode 100644 index 00000000000..2fc73c68649 --- /dev/null +++ b/addons/account_report/report/print_indicator.py @@ -0,0 +1,266 @@ + +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved. +# +# $Id$ +# +# 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 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. +# +############################################################################## + +import pooler +import time +from report import report_sxw + +#from report.interface import report_int +#from reportlab.graphics.shapes import Drawing +#from reportlab.graphics.charts.barcharts import VerticalBarChart +#import reportlab.lib.colors as colors +#from reportlab.graphics.widgetbase import Widget, TypedPropertyCollection +#from reportlab.graphics.charts.textlabels import BarChartLabel +#from reportlab.graphics import renderPM +#from report.render import render +#from report.interface import report_int +from pychart import * +import StringIO +theme.use_color = 1 +theme.default_font_family = "Helvetica-Bold" +theme.default_font_size = 18 +theme.default_line_width = 1.0 +import tools + + +parents = { + 'tr':1, + 'li':1, + 'story': 0, + 'section': 0 +} + +class accounting_report_indicator(report_sxw.rml_parse): + + def __init__(self, cr, uid, name, context): + super(accounting_report_indicator, self).__init__(cr, uid, name, context) + self.ret_list = [] + self.localcontext.update({ + 'time': time, + 'test': self.test1, + 'lines':self.lines, + 'getarray':self.getarray, + }) + self.count=0 + self.list=[] + self.header_name=self.header_val=[] + + def repeatIn(self, lst, name, nodes_parent=False,td=False,width=[],value=[],type=[]): + self._node.data = '' + node = self._find_parent(self._node, nodes_parent or parents) + ns = node.nextSibling +#start + if not name=='array': + return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False) + + value=['Data'] + value.extend(self.header_name) + type=['string'].extend(['float']*len(self.header_name)) + width=[40]*(len(self.header_name)+1) + + if not lst: + lst.append(1) + for ns in node.childNodes : + if ns and ns.nodeName!='#text' and ns.tagName=='blockTable' and td : + width_str = ns._attrs['colWidths'].nodeValue + ns.removeAttribute('colWidths') + total_td = td * len(value) + + if not width: + for v in value: + width.append(30) + for v in range(len(value)): + width_str +=',%d'%width[v] + + ns.setAttribute('colWidths',width_str) + + child_list = ns.childNodes + check=0 + for child in child_list: + if child.nodeName=='tr': + lc = child.childNodes[1] +# for t in range(td): + i=0 + for v in value: + newnode = lc.cloneNode(1) + if check==1: + t1="[[ %s['%s'] ]]"%(name,v) + else: + t1="%s"%(v) + newnode.childNodes[1].lastChild.data = t1 + child.appendChild(newnode) + newnode=False + i+=1 + check=1 + + return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False) + + def lines(self,data): + res={} + result=[] + ind_ids=self.pool.get('account.report.report').search(self.cr,self.uid,[]) + obj_inds=self.pool.get('account.report.report').browse(self.cr,self.uid,ind_ids) + +# def find_child(obj): +# self.list.append(obj) +# if obj.child_ids: +# for child in obj.child_ids: +# find_child(child) +# return True +# +# find_child(obj_inds) + + for obj_ind in obj_inds: + res = { + 'id':obj_ind.id, + 'name':obj_ind.name, + 'code':obj_ind.code, + 'expression':obj_ind.expression, + 'disp_graph':obj_ind.disp_graph, + 'note':obj_ind.note, + 'type':obj_ind.type, + } + result.append(res) + return result + + def getarray(self,data,object): + res={} + result=[] + self.test1(data,object,intercall=True) + self.header_val=[str(x) for x in self.header_val] + temp_dict=zip(self.header_name,self.header_val) + res=dict(temp_dict) + res['Data']='Value' + result.append(res) + return result + + + def test1(self,data,object,intercall=False): + + obj_history=self.pool.get('account.report.history') + + if data['select_base']=='year': + tuple_search=('fiscalyear_id','in',data['base_selection'][0][2]) + base='year' + else: + tuple_search=('period_id','in',data['base_selection'][0][2]) + base='period' + + history_ids=obj_history.search(self.cr,self.uid,[('name','=',object['id']),tuple_search]) + history_ids.sort() + obj_his=obj_history.browse(self.cr,self.uid,history_ids) + + data_val=[] + data_period=[] + if base=='period': + for item in obj_his: + data_val.append(item.val) + data_period.append(item.period_id.name) + else: + for i in data['base_selection'][0][2]: + val_temp=[] + data_period.append(self.pool.get('account.fiscalyear').browse(self.cr,self.uid,i).name) + for item in obj_his: + if item.fiscalyear_id.id==i: + val_temp.append(item.val) + data_val.append(sum(val_temp)) + + self.header_name=data_period + self.header_val=data_val + + if intercall: + return True + self.count +=1 +# drawing = Drawing(400, 300) +# data = [ +# tuple(data_val), +# ] +# value_min=0.0 +# vmin=min(data_val) +# vmax=max(data_val) +# +# val_min=((vmin < 0.00 and vmin-2.00) or 0.00) +# # calculating maximum +# val_max=(vmax/(pow(10,len(str(int(vmax)))-2))+1)*pow(10,len(str(int(vmax)))-2) +# bc = VerticalBarChart() +# bc.x = 50 +# bc.y = 50 +# bc.height = 245 +# bc.width = 300 +# bc.data = data +# value_step=(abs(val_max)-abs(val_min))/5 +# +# bc.strokeColor = colors.black +# bc.valueAxis.valueMin = val_min +# bc.valueAxis.valueMax = val_max +# bc.valueAxis.valueStep = value_step +# +# bc.categoryAxis.labels.boxAnchor = 'ne' +# bc.categoryAxis.labels.dx = 8 +# +# bc.categoryAxis.labels.dy = -2 +# bc.categoryAxis.labels.angle = 30 +# bc.categoryAxis.categoryNames = data_period +# drawing.add(bc) +# drawing.save(formats=['png'],fnRoot=path+str(self.count),title="helo") +# renderPM.drawToFile(drawing1, 'example1.jpg','jpg') + import os + dirname ='Temp_images' + path=os.path.join(tools.config['root_path'],dirname,"Image") + + if not os.path.isdir(tools.config['root_path']+ "/"+dirname + '/'): + os.mkdir(tools.config['root_path'] +"/"+ dirname + '/') + os.path.join(tools.config['root_path'],dirname,"/") + can = canvas.init('Image'+str(self.count)+".png") +# can.clip(0,0,600,400) + + data=zip(self.header_name,self.header_val) + + ar = area.T(size = (650,450),x_coord = category_coord.T(data, 0), y_range = (None, None), + x_axis = axis.X(label="Period // Year",format="/a-30{}%s"), + y_axis = axis.Y(label="Value")) + + ar.add_plot(bar_plot.T(data = data,width=15, data_label_format="/o/15{}%s",label = "Value",fill_style=fill_style.red)) + ar.draw() + + can.close() + os.system('cp '+'Image'+str(self.count)+'.png ' +path+str(self.count)+'.png') + os.system('rm '+'Image'+str(self.count)+'.png') +# can.endclip() + return path+str(self.count)+'.png' + +report_sxw.report_sxw('report.print.indicators', 'account.report.history', + 'addons/account_report/report/print_indicator.rml', + parser=accounting_report_indicator, header=False) + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_report/report/print_indicator.rml b/addons/account_report/report/print_indicator.rml new file mode 100644 index 00000000000..7e66c37452c --- /dev/null +++ b/addons/account_report/report/print_indicator.rml @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Indicators + + + + + + + + + +[[ company.name ]] + + + + + + + +Currency: [[ company.currency_id.name]] + + + + + + + +Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + + + +Name + + +Code + + + + + + + +
+[[ repeatIn(lines(data['form']),'o')]] + + + +() [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]][[ o['name'] ]] + + +[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]][[ o['code'] ]] + + + + + + +[[ o['disp_graph'] and setTag('para','image',{'width':'450.00','height':'215.00','file':test(data['form'],o)}) or removeParentNode('para') ]] + + + +
+ [[ repeatIn(getarray(data['form'],o),'array',td=len(data['form']['base_selection'][0][2])) ]] + + + + + + + + + + + + +
+ + + + + + +Expression : [[ o['expression'] ]] + + + + + + + + + +Notes : [[ o['note'] ]] + + + + + + +
+
+
+ + diff --git a/addons/account_report/security/ir.model.access.csv b/addons/account_report/security/ir.model.access.csv index e74efd16f3b..ace4bc06db0 100644 --- a/addons/account_report/security/ir.model.access.csv +++ b/addons/account_report/security/ir.model.access.csv @@ -1,2 +1,3 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_account_report_report,account.report.report,model_account_report_report,base.group_user,1,0,0,0 +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_account_report_report","account.report.report","model_account_report_report","account.group_account_manager",1,0,0,0 +"access_account_report_history","account.report.history","model_account_report_history","account.group_account_manager",1,0,0,0 diff --git a/addons/account_report/wizard/wizard_print_indicators.py b/addons/account_report/wizard/wizard_print_indicators.py index 373b86fd914..b781073ddf4 100644 --- a/addons/account_report/wizard/wizard_print_indicators.py +++ b/addons/account_report/wizard/wizard_print_indicators.py @@ -33,12 +33,12 @@ import pooler form = '''
- +
+ @@ -200,10 +210,10 @@ [[ repeatIn(o.move_lines,'line') ]] - [[ '['+line.product_id.code +']' ]][[ line.product_id.name ]] + [[ '['+line.product_id.code +']' ]] [[ line.product_id.name ]] - [[ line.product_qty ]] [[line.product_uom.name]] + [[ '%.2f' % line.product_qty ]] [[line.product_uom.name]]
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index 7785ce8bcfa..c3bacf6e833 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -1,21 +1,32 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_mrp_workcenter,mrp.workcenter,model_mrp_workcenter,mrp.group_mrp_user,1,0,0,0 -access_mrp_property_group,mrp.property.group,model_mrp_property_group,mrp.group_mrp_user,1,0,0,0 -access_mrp_property,mrp.property,model_mrp_property,mrp.group_mrp_user,1,0,0,0 -access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0 -access_mrp_routing_workcenter,mrp.routing.workcenter,model_mrp_routing_workcenter,mrp.group_mrp_user,1,0,0,0 -access_mrp_bom,mrp.bom,model_mrp_bom,mrp.group_mrp_user,1,0,0,0 -access_mrp_bom_revision,mrp.bom.revision,model_mrp_bom_revision,mrp.group_mrp_user,1,0,0,0 -access_mrp_production,mrp.production,model_mrp_production,mrp.group_mrp_user,1,1,1,1 -access_mrp_production_workcenter_line,mrp.production.workcenter.line,model_mrp_production_workcenter_line,mrp.group_mrp_user,1,1,1,1 -access_mrp_production_product_line,mrp.production.product.line,model_mrp_production_product_line,mrp.group_mrp_user,1,1,1,1 -access_mrp_procurement,mrp.procurement,model_mrp_procurement,mrp.group_mrp_user,1,1,1,1 -access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,model_stock_warehouse_orderpoint,mrp.group_mrp_user,1,0,0,0 -access_stock_warehouse_orderpoint_manager,stock.warehouse.orderpoint.manager,model_stock_warehouse_orderpoint,mrp.group_mrp_user,1,1,1,1 -access_mrp_workcenter_manager,mrp.workcenter.manager,model_mrp_workcenter,mrp.group_mrp_user,1,1,1,1 -access_mrp_property_group_manager,mrp.property.group.manager,model_mrp_property_group,mrp.group_mrp_user,1,1,1,1 -access_mrp_property_manager,mrp.property.manager,model_mrp_property,mrp.group_mrp_user,1,1,1,1 -access_mrp_routing_manager,mrp.routing.manager,model_mrp_routing,mrp.group_mrp_user,1,1,1,1 -access_mrp_routing_workcenter_manager,mrp.routing.workcenter.manager,model_mrp_routing_workcenter,mrp.group_mrp_user,1,1,1,1 -access_mrp_bom_manager,mrp.bom.manager,model_mrp_bom,mrp.group_mrp_user,1,1,1,1 -access_mrp_bom_revision_manager,mrp.bom.revision.manager,model_mrp_bom_revision,mrp.group_mrp_user,1,1,1,1 +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_mrp_workcenter","mrp.workcenter","model_mrp_workcenter","mrp.group_mrp_user",1,0,0,0 +"access_mrp_property_group","mrp.property.group","model_mrp_property_group","mrp.group_mrp_user",1,0,0,0 +"access_mrp_property","mrp.property","model_mrp_property","mrp.group_mrp_user",1,0,0,0 +"access_mrp_routing","mrp.routing","model_mrp_routing","mrp.group_mrp_user",1,0,0,0 +"access_mrp_routing_workcenter","mrp.routing.workcenter","model_mrp_routing_workcenter","mrp.group_mrp_user",1,0,0,0 +"access_mrp_bom","mrp.bom","model_mrp_bom","mrp.group_mrp_user",1,0,0,0 +"access_mrp_bom_revision","mrp.bom.revision","model_mrp_bom_revision","mrp.group_mrp_user",1,0,0,0 +"access_mrp_production","mrp.production","model_mrp_production","mrp.group_mrp_user",1,1,1,1 +"access_mrp_production_workcenter_line","mrp.production.workcenter.line","model_mrp_production_workcenter_line","mrp.group_mrp_user",1,1,1,1 +"access_mrp_production_product_line","mrp.production.product.line","model_mrp_production_product_line","mrp.group_mrp_user",1,1,1,1 +"access_mrp_procurement","mrp.procurement","model_mrp_procurement","mrp.group_mrp_user",1,1,1,1 +"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint","mrp.group_mrp_user",1,0,0,0 +"access_stock_warehouse_orderpoint_manager","stock.warehouse.orderpoint.manager","model_stock_warehouse_orderpoint","mrp.group_mrp_manager",1,1,1,1 +"access_mrp_workcenter_manager","mrp.workcenter.manager","model_mrp_workcenter","mrp.group_mrp_user",1,1,1,1 +"access_mrp_property_group_manager","mrp.property.group.manager","model_mrp_property_group","mrp.group_mrp_user",1,1,1,1 +"access_mrp_property_manager","mrp.property.manager","model_mrp_property","mrp.group_mrp_user",1,1,1,1 +"access_mrp_routing_manager","mrp.routing.manager","model_mrp_routing","mrp.group_mrp_user",1,1,1,1 +"access_mrp_routing_workcenter_manager","mrp.routing.workcenter.manager","model_mrp_routing_workcenter","mrp.group_mrp_manager",1,1,1,1 +"access_mrp_bom_manager","mrp.bom.manager","model_mrp_bom","mrp.group_mrp_user",1,1,1,1 +"access_mrp_bom_revision_manager","mrp.bom.revision.manager","model_mrp_bom_revision","mrp.group_mrp_manager",1,1,1,1 +"access_stock_location_mrp_worker","stock.location mrp_worker","stock.model_stock_location","mrp.group_mrp_user",1,0,0,0 +"access_stock_move_mrp_worker","stock.move mrp_worker","stock.model_stock_move","mrp.group_mrp_user",1,1,1,1 +"access_stock_picking_mrp_worker","stock.picking mrp_worker","stock.model_stock_picking","mrp.group_mrp_user",1,1,1,1 +"access_stock_warehouse","stock.warehouse mrp_worker","stock.model_stock_warehouse","mrp.group_mrp_user",1,0,0,0 +"access_account_analytic_journal_mrp_worker","account.analytic.journal mrp_worker","account.model_account_analytic_journal","mrp.group_mrp_user",1,0,0,0 +"access_account_account","account.account mrp_worker","account.model_account_account","mrp.group_mrp_user",1,0,0,0 +"access_purchase_order_mrp_worker","purchase.order mrp_worker","purchase.model_purchase_order","mrp.group_mrp_user",1,0,0,0 +"access_purchase_order_line_mrp_worker","purchase.order.line mrp_worker","purchase.model_purchase_order_line","mrp.group_mrp_user",1,0,0,0 +"access_hr_timesheet_group_mrp_worker","hr.timesheet.group mrp_worker","hr.model_hr_timesheet_group","mrp.group_mrp_user",1,0,0,0 +"access_mrp_procurement_stock_worker","mrp.procurement stock_worker","model_mrp_procurement","stock.group_stock_user",1,0,0,0 +"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0 diff --git a/addons/mrp/security/mrp_security.xml b/addons/mrp/security/mrp_security.xml index 9118fe051ae..8cd84d7df6b 100644 --- a/addons/mrp/security/mrp_security.xml +++ b/addons/mrp/security/mrp_security.xml @@ -1,6 +1,6 @@ - + Manufacturing / Manager @@ -9,5 +9,12 @@ Manufacturing / Worker + + + + + + + diff --git a/addons/mrp_operations/i18n/fr_FR.po b/addons/mrp_operations/i18n/fr_FR.po old mode 100755 new mode 100644 index 25a483c9e4e..cbba5fd91e4 --- a/addons/mrp_operations/i18n/fr_FR.po +++ b/addons/mrp_operations/i18n/fr_FR.po @@ -4,32 +4,36 @@ # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 4.3.0" -"Report-Msgid-Bugs-To: support@openerp.com" -"POT-Creation-Date: 2008-09-11 15:41:43+0000" -"PO-Revision-Date: 2008-09-11 15:41:43+0000" -"Last-Translator: <>" -"Language-Team: " -"MIME-Version: 1.0" -"Content-Type: text/plain; charset=UTF-8" -"Content-Transfer-Encoding: " -"Plural-Forms: " +"Project-Id-Version: OpenERP Server 4.3.0\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2008-09-05 16:29+0000\n" +"PO-Revision-Date: 2008-10-13 13:44+0000\n" +"Last-Translator: Olivier Laurent \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2008-10-13 13:52+0000\n" +"X-Generator: Launchpad (build Unknown)\n" #. module: mrp_operations #: constraint:ir.model:0 -msgid "The Object name must start with x_ and not contain any special character !" +msgid "" +"The Object name must start with x_ and not contain any special character !" msgstr "" +"Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactères " +"spéciaux !" #. module: mrp_operations #: selection:mrp.production.workcenter.line,state:0 #: view:mrp.production.workcenter.line:0 msgid "Confirm" -msgstr "" +msgstr "Confirmer" #. module: mrp_operations #: selection:mrp_operations.operation.code,start_stop:0 msgid "Stop" -msgstr "" +msgstr "Arrêter" #. module: mrp_operations #: model:ir.model,name:mrp_operations.model_mrp_operations_operation_code @@ -39,27 +43,27 @@ msgstr "" #. module: mrp_operations #: selection:mrp_operations.operation.code,start_stop:0 msgid "Start" -msgstr "" +msgstr "Démarrer" #. module: mrp_operations #: field:mrp_operations.operation,production_id:0 msgid "Production" -msgstr "" +msgstr "Production" #. module: mrp_operations #: selection:mrp.production.workcenter.line,state:0 msgid "Draft" -msgstr "" +msgstr "Brouillon" #. module: mrp_operations #: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_confirm_action msgid "Production Orders to Do" -msgstr "" +msgstr "Ordres de Production à Faire" #. module: mrp_operations #: view:mrp.production.workcenter.line:0 msgid "Set Draft" -msgstr "" +msgstr "Mettre en brouillon" #. module: mrp_operations #: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_code_action @@ -70,89 +74,79 @@ msgstr "" #: field:mrp_operations.operation.code,start_stop:0 #: field:mrp.production.workcenter.line,state:0 msgid "Status" -msgstr "" +msgstr "État" #. module: mrp_operations #: rml:mrp.code.barcode:0 msgid ")" -msgstr "" +msgstr ")" #. module: mrp_operations #: rml:mrp.code.barcode:0 msgid "(" -msgstr "" +msgstr "(" #. module: mrp_operations #: model:ir.actions.report.xml,name:mrp_operations.report_wc_barcode msgid "Workcenters Barcode" -msgstr "" +msgstr "Code-barre des Centres de Travail" #. module: mrp_operations #: field:mrp.production.workcenter.line,delay:0 msgid "delay" -msgstr "" +msgstr "Délai" #. module: mrp_operations #: view:mrp_operations.operation:0 msgid "Production Operation" -msgstr "" +msgstr "Opération de Production" #. module: mrp_operations #: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_draft_action msgid "Waiting Production Orders" -msgstr "" +msgstr "Ordres de Production en attente" #. module: mrp_operations #: field:mrp_operations.operation.code,name:0 msgid "Operation Name" -msgstr "" - -#. module: mrp_operations -#: field:mrp.production.workcenter.line,date_finnished:0 -msgid "End Date" -msgstr "" - -#. module: mrp_operations -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "" - -#. module: mrp_operations -#: field:mrp_operations.operation,workcenter_id:0 -msgid "Workcenter" -msgstr "" +msgstr "Nom de l'Opération" #. module: mrp_operations #: view:mrp_operations.operation.code:0 msgid "Production Operation Code" -msgstr "" +msgstr "Code d'Opération de Production" + +#. module: mrp_operations +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML non valide pour l'architecture de la vue" + +#. module: mrp_operations +#: field:mrp_operations.operation,workcenter_id:0 +msgid "Workcenter" +msgstr "Centre de Travail" #. module: mrp_operations #: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_confirm_action msgid "Confirm Operations" -msgstr "" +msgstr "Confirmer les Opérations" #. module: mrp_operations #: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_draft_action msgid "Draft Operations" -msgstr "" - -#. module: mrp_operations -#: field:mrp.production.workcenter.line,date_start:0 -msgid "Start Date" -msgstr "" +msgstr "Opérations Brouillon" #. module: mrp_operations #: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action_form #: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_operation_action msgid "Operations" -msgstr "" +msgstr "Opérations" #. module: mrp_operations #: field:mrp_operations.operation.code,code:0 #: field:mrp_operations.operation,code_id:0 msgid "Code" -msgstr "" +msgstr "Code" #. module: mrp_operations #: model:ir.actions.report.xml,name:mrp_operations.report_code_barcode @@ -162,14 +156,14 @@ msgstr "" #. module: mrp_operations #: selection:mrp.production.workcenter.line,state:0 msgid "Canceled" -msgstr "" +msgstr "Annulé" #. module: mrp_operations #: selection:mrp_operations.operation.code,start_stop:0 #: selection:mrp.production.workcenter.line,state:0 #: view:mrp.production.workcenter.line:0 msgid "Done" -msgstr "" +msgstr "Terminé" #. module: mrp_operations #: model:ir.model,name:mrp_operations.model_mrp_operations_operation @@ -180,15 +174,14 @@ msgstr "" #: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action #: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_action msgid "All Operations" -msgstr "" +msgstr "Toutes les Opérations" #. module: mrp_operations #: view:mrp.production.workcenter.line:0 msgid "Cancel" -msgstr "" +msgstr "Annuler" #. module: mrp_operations #: model:ir.actions.act_window,name:mrp_operations.mrp_production_operation_action msgid "Operation" -msgstr "" - +msgstr "Opération" diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index d9063f6c2d1..a16808be3ac 100755 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -2,160 +2,160 @@ - - mrp.production.workcenter.line.inherit.tree - mrp.production.workcenter.line - - tree - - -