diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index abd3d1f459d5eb54e8bf95bc50d1d991e7c749fc..d4731fa0215529e90581ee4b58f68eb3b7568077 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -80,6 +80,8 @@ module named account_voucherss 'wizard/account_aged_trial_balance_view.xml', 'wizard/account_compare_account_balance_report_view.xml', 'wizard/account_third_party_ledger.xml', + 'wizard/account_reconcile_view.xml', + 'wizard/account_automatic_reconcile_view.xml', 'project/wizard/project_account_analytic_line_view.xml', 'account_end_fy.xml', 'account_invoice_view.xml', @@ -89,6 +91,13 @@ module named account_voucherss 'account_invoice_workflow.xml', 'project/project_view.xml', 'project/project_report.xml', + 'project/wizard/account_analytic_check_view.xml', + 'project/wizard/account_analytic_balance_report_view.xml', + 'project/wizard/account_analytic_cost_ledger_view.xml', + 'project/wizard/account_analytic_inverted_balance_report.xml', + 'project/wizard/account_analytic_journal_report_view.xml', + 'project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml', + 'project/wizard/account_analytic_chart_view.xml', 'product_view.xml', 'account_assert_test.xml', 'process/statement_process.xml', @@ -113,4 +122,4 @@ module named account_voucherss 'active': False, 'certificate': '0080331923549', } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/account.py b/addons/account/account.py index 0241cbe5ffa64543d1f7e5e08fb0c4a2f57190a7..969f843bec96c9d87b86964ca31df7f10d2f4558 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -887,7 +887,7 @@ class account_move(osv.osv): cr.execute('update account_move set state=%s where id =ANY(%s) ',('posted',ids,)) else: - raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !')) + raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !')) return True def button_validate(self, cursor, user, ids, context=None): diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index c42597e785d36a5ed2dc8eca2de04a871706ed4c..70a99adc18e9211582a55f7951a649ddfa653374 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -29,69 +29,15 @@ import tools from tools import config class account_analytic_line(osv.osv): - _name = 'account.analytic.line' + _inherit = 'account.analytic.line' _description = 'Analytic lines' - - def _amount_currency(self, cr, uid, ids, field_name, arg, context={}): - result = {} - for rec in self.browse(cr, uid, ids, context): - cmp_cur_id=rec.company_id.currency_id.id - aa_cur_id=rec.account_id.currency_id.id - # Always provide the amount in currency - if cmp_cur_id != aa_cur_id: - cur_obj = self.pool.get('res.currency') - ctx = {} - if rec.date and rec.amount: - ctx['date'] = rec.date - result[rec.id] = cur_obj.compute(cr, uid, rec.company_id.currency_id.id, - rec.account_id.currency_id.id, rec.amount, - context=ctx) - else: - result[rec.id]=rec.amount - return result - - def _get_account_currency(self, cr, uid, ids, field_name, arg, context={}): - result = {} - for rec in self.browse(cr, uid, ids, context): - # Always provide second currency - result[rec.id] = (rec.account_id.currency_id.id,rec.account_id.currency_id.code) - return result - - def _get_account_line(self, cr, uid, ids, context={}): - aac_ids = {} - for acc in self.pool.get('account.analytic.account').browse(cr, uid, ids): - aac_ids[acc.id] = True - aal_ids = [] - if aac_ids: - aal_ids = self.pool.get('account.analytic.line').search(cr, uid, [('account_id','in',aac_ids.keys())], context=context) - return aal_ids - _columns = { - 'name' : fields.char('Description', size=256, required=True), - 'date' : fields.date('Date', required=True), - 'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price.'), - 'unit_amount' : fields.float('Quantity', help='Specifies the amount of quantity to count.'), 'product_uom_id' : fields.many2one('product.uom', 'UoM'), 'product_id' : fields.many2one('product.product', 'Product'), - 'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True), 'general_account_id' : fields.many2one('account.account', 'General Account', required=True, ondelete='cascade'), 'move_id' : fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True), 'journal_id' : fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='cascade', select=True), 'code' : fields.char('Code', size=8), - 'user_id' : fields.many2one('res.users', 'User',), - 'currency_id': fields.function(_get_account_currency, method=True, type='many2one', relation='res.currency', string='Account currency', - store={ - 'account.analytic.account': (_get_account_line, ['company_id'], 50), - 'account.analytic.line': (lambda self,cr,uid,ids,c={}: ids, ['amount','unit_amount'],10), - }, - help="The related account currency if not equal to the company one."), - 'company_id': fields.many2one('res.company','Company',required=True), - 'amount_currency': fields.function(_amount_currency, method=True, digits_compute= dp.get_precision('Account'), string='Amount currency', - store={ - 'account.analytic.account': (_get_account_line, ['company_id'], 50), - 'account.analytic.line': (lambda self,cr,uid,ids,c={}: ids, ['amount','unit_amount'],10), - }, - help="The amount expressed in the related account currency if not equal to the company one."), 'ref': fields.char('Ref.', size=64), } _defaults = { diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 07d8e1a02acf50ecd184c4b30a22c3dd893a333c..b9aa089942e61879dfc3581a38a5ec7fb56f0f8e 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -922,10 +922,10 @@ class account_move_line(osv.osv): vals['analytic_lines'] = [(0,0, { 'name': vals['name'], 'date': vals.get('date', time.strftime('%Y-%m-%d')), - 'account_id': vals['analytic_account_id'], - 'unit_amount':'quantity' in vals and vals['quantity'] or 1.0, - 'amount': vals['debit'] or vals['credit'], - 'general_account_id': vals['account_id'], + 'account_id': vals.get('analytic_account_id', False), + 'unit_amount': vals.get('quantity', 1.0), + 'amount': vals.get('debit', 0.0) or vals.get('credit', 0.0), + 'general_account_id': vals.get('account_id', False), 'journal_id': journal.analytic_journal_id.id, 'ref': vals.get('ref', False), })] diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml index 93dba0e5249ee7fca5f8721ded94342a18dda9a4..8b093fb23100a16f7286fa483346de218e17a497 100644 --- a/addons/account/account_wizard.xml +++ b/addons/account/account_wizard.xml @@ -33,9 +33,9 @@ --> <!-- automatic reconcile --> - <wizard id="wizard_automatic_reconcile" menu="False" model="account.account" name="account.automatic.reconcile" string="Automatic reconciliation"/> <menuitem id="next_id_20" name="Reconciliation" parent="menu_finance_periodical_processing"/> - <menuitem action="wizard_automatic_reconcile" id="menu_automatic_reconcile" parent="next_id_20" type="wizard"/> + <!-- <wizard id="wizard_automatic_reconcile" menu="False" model="account.account" name="account.automatic.reconcile" string="Automatic reconciliation"/> + <menuitem action="wizard_automatic_reconcile" id="menu_automatic_reconcile" parent="next_id_20" type="wizard"/>--> <!-- Import entry in statement --> @@ -47,7 +47,7 @@ <!-- id="wizard_populate_statement_from_inv"/>--> <!-- manual reconcile --> - <wizard id="wizard_reconcile" model="account.move.line" name="account.move.line.reconcile" string="Reconcile Entries"/> +<!-- <wizard id="wizard_reconcile" model="account.move.line" name="account.move.line.reconcile" string="Reconcile Entries"/>--> <!-- <wizard id="wizard_reconcile_unreconcile" model="account.move.reconcile" name="account.reconcile.unreconcile" string="Unreconcile Entries"/>--> diff --git a/addons/account/i18n/it.po b/addons/account/i18n/it.po index 6007a539d217c5de0e979430554b7a2c19d7f8d4..d75b4f1ab4fb12ec141b9fd712f252eb51539c8d 100644 --- a/addons/account/i18n/it.po +++ b/addons/account/i18n/it.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-03-29 15:32+0000\n" -"Last-Translator: Carlo Vettore <Unknown>\n" +"PO-Revision-Date: 2010-04-26 07:46+0000\n" +"Last-Translator: eLBati - albatos.com <lorenzo.battistini@albatos.com>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n" +"X-Launchpad-Export-Date: 2010-04-28 03:44+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -1187,7 +1187,7 @@ msgstr "Report tassa" #: wizard_button:account.analytic.account.chart,init,open:0 #: wizard_button:account.chart,init,open:0 msgid "Open Charts" -msgstr "Conti aperti" +msgstr "Apri" #. module: account #: wizard_view:account.fiscalyear.close.state,init:0 @@ -2296,6 +2296,8 @@ msgstr "" #: wizard_view:account.chart,init:0 msgid "(If you do not select Fiscal year it will take all open fiscal years)" msgstr "" +"Se non si seleziona un anno fiscale, verranno visualizzati tutti gli anni " +"fiscali aperti" #. module: account #: help:account.invoice.tax,base_code_id:0 @@ -4424,7 +4426,7 @@ msgstr "" #. module: account #: wizard_view:account.wizard_paid_open,init:0 msgid "Open Invoice" -msgstr "Fattura aperta" +msgstr "Apri fattura" #. module: account #: model:process.node,note:account.process_node_draftstatement0 diff --git a/addons/account/i18n/pl.po b/addons/account/i18n/pl.po index 354d3ebaa83a6dda064d8c2b74ee3a68961f05e6..debbe6d48093c860eade238a5286c2b15361a9de 100644 --- a/addons/account/i18n/pl.po +++ b/addons/account/i18n/pl.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-04-25 17:34+0000\n" +"PO-Revision-Date: 2010-05-05 14:54+0000\n" "Last-Translator: Grzegorz Grzelak (Cirrus.pl) <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-26 03:42+0000\n" +"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -1591,7 +1591,7 @@ msgstr "" #: selection:account.tax,tax_group:0 #: selection:account.tax.template,tax_group:0 msgid "VAT" -msgstr "NIP" +msgstr "VAT" #. module: account #: rml:account.analytic.account.journal:0 @@ -2082,7 +2082,7 @@ msgstr "Wydatki" #. module: account #: field:account.journal,invoice_sequence_id:0 msgid "Invoice Sequence" -msgstr "Numeracja faktury" +msgstr "Numeracja faktur" #. module: account #: wizard_view:account.automatic.reconcile,init:0 @@ -2207,7 +2207,7 @@ msgstr "(pozostaw puste, aby stosować bieżący okres)" #: model:ir.actions.act_window,name:account.action_invoice_tree8 #: model:ir.ui.menu,name:account.menu_action_invoice_tree8 msgid "Draft Supplier Invoices" -msgstr "Projekt faktury dla klienta" +msgstr "Projekty faktur od dostawcy" #. module: account #: wizard_field:account.invoice.refund,init,period:0 @@ -2947,7 +2947,7 @@ msgstr "" #: model:ir.actions.act_window,name:account.action_invoice_tree12 #: model:ir.ui.menu,name:account.menu_action_invoice_tree12 msgid "Draft Supplier Refunds" -msgstr "Projekt korekty od dostawcy" +msgstr "Projekty korekt od dostawcy" #. module: account #: model:process.node,name:account.process_node_accountingstatemententries0 @@ -3034,7 +3034,7 @@ msgstr "Kurs dla op. wychodzacych" #: model:ir.actions.act_window,name:account.action_invoice_tree10 #: model:ir.ui.menu,name:account.menu_action_invoice_tree10 msgid "Draft Customer Refunds" -msgstr "Projekt korekty dla klienta" +msgstr "Projekty korekt dla klienta" #. module: account #: field:account.journal.column,readonly:0 @@ -5476,7 +5476,7 @@ msgstr "Zapisy subskrypcji" #: model:ir.actions.act_window,name:account.action_invoice_tree6 #: model:ir.ui.menu,name:account.menu_action_invoice_tree6 msgid "PRO-FORMA Customer Invoices" -msgstr "Faktura PRO-FORMA dla klienta" +msgstr "Fakturay PRO-FORMA dla klienta" #. module: account #: field:account.subscription,period_total:0 diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po index 5dfad6b78e068924837910695a5fe7e69934b512..89d27ba55267b1ea14b45bc9dc562176fa16c451 100644 --- a/addons/account/i18n/zh_CN.po +++ b/addons/account/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.6\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-03-29 00:34+0000\n" +"PO-Revision-Date: 2010-05-06 01:44+0000\n" "Last-Translator: digitalsatori <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n" +"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -40,7 +40,7 @@ msgstr "å‡è¯å½•å…¥" #. module: account #: model:ir.actions.todo,note:account.config_wizard_account_base_setup_form msgid "Specify The Message for the Overdue Payment Report." -msgstr "设定这逾期应付款表å•çš„消æ¯" +msgstr "设置过期支付的催款信æ¯" #. module: account #: model:process.transition,name:account.process_transition_confirmstatementfromdraft0 @@ -115,7 +115,7 @@ msgstr "上级科目" #. module: account #: selection:account.move,type:0 msgid "Journal Voucher" -msgstr "原始å‡è¯åˆ†ç±»å¸" +msgstr "日记账å‡è¯" #. module: account #: field:account.invoice,residual:0 diff --git a/addons/account/invoice.py b/addons/account/invoice.py index c66dda115b23df3fd9386424eb9c154f5c824831..14cd952aa69fc1518572ee9055c4a7630f8590c7 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -539,6 +539,16 @@ class account_invoice(osv.osv): wf_service.trg_create(uid, 'account.invoice', inv_id, cr) return True + def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines): + """finalize_invoice_move_lines(cr, uid, invoice, move_lines) -> move_lines + Hook method to be overridden in additional modules to verify and possibly alter the + move lines to be created by an invoice, for special cases. + :param invoice_browse: browsable record of the invoice that is generating the move lines + :param move_lines: list of dictionaries with the account.move.lines (as for create()) + :return: the (possibly updated) final move_lines to create for this invoice + """ + return move_lines + # Workflow stuff ################# @@ -816,6 +826,9 @@ class account_invoice(osv.osv): if journal.centralisation: raise osv.except_osv(_('UserError'), _('Cannot create invoice move on centralised journal')) + + line = self.finalize_invoice_move_lines(cr, uid, inv, line) + move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date} period_id=inv.period_id and inv.period_id.id or False if not period_id: diff --git a/addons/account/process/customer_invoice_process.xml b/addons/account/process/customer_invoice_process.xml old mode 100755 new mode 100644 diff --git a/addons/account/process/statement_process.xml b/addons/account/process/statement_process.xml old mode 100755 new mode 100644 diff --git a/addons/account/process/supplier_invoice_process.xml b/addons/account/process/supplier_invoice_process.xml old mode 100755 new mode 100644 diff --git a/addons/account/project/project_report.xml b/addons/account/project/project_report.xml index 0abfd6625f59266287e6292146de237da21f7da8..ae6aedeaab175227bc11cd5a96c62e5d590cc9fb 100644 --- a/addons/account/project/project_report.xml +++ b/addons/account/project/project_report.xml @@ -3,32 +3,32 @@ <data> <report auto="False" id="analytic_journal_print" menu="False" model="account.analytic.journal" name="account.analytic.account.journal" rml="account/project/report/analytic_journal.rml" string="Analytic Journal"/> - <wizard id="account_analytic_account_journal_report" keyword="client_print_multi" model="account.analytic.journal" name="account.analytic.account.journal.report" string="Analytic Journal"/> +<!-- <wizard id="account_analytic_account_journal_report" keyword="client_print_multi" model="account.analytic.journal" name="account.analytic.account.journal.report" string="Analytic Journal"/>--> <report auto="False" id="account_analytic_account_balance" menu="False" model="account.analytic.account" name="account.analytic.account.balance" rml="account/project/report/analytic_balance.rml" string="Analytic Balance"/> - <wizard id="account_analytic_account_balance_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.balance.report" string="Analytic Balance"/> + <!--<wizard id="account_analytic_account_balance_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.balance.report" string="Analytic Balance"/> --> <report auto="False" id="account_analytic_account_inverted_balance" menu="False" model="account.analytic.account" name="account.analytic.account.inverted.balance" rml="account/project/report/inverted_analytic_balance.rml" string="Inverted Analytic Balance"/> - <wizard id="account_analytic_account_inverted_balance_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.inverted.balance.report" string="Inverted Analytic Balance"/> +<!-- <wizard id="account_analytic_account_inverted_balance_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.inverted.balance.report" string="Inverted Analytic Balance"/>--> <report auto="False" id="account_analytic_account_cost_ledger" menu="False" model="account.analytic.account" name="account.analytic.account.cost_ledger" rml="account/project/report/cost_ledger.rml" string="Cost Ledger"/> - <wizard id="account_analytic_account_cost_ledger_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.cost_ledger.report" string="Cost Ledger"/> +<!-- <wizard id="account_analytic_account_cost_ledger_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.cost_ledger.report" string="Cost Ledger"/>--> <report auto="False" id="account_analytic_account_quantity_cost_ledger" menu="False" model="account.analytic.account" name="account.analytic.account.quantity_cost_ledger" rml="account/project/report/quantity_cost_ledger.rml" string="Cost Ledger (Only quantities)"/> - <wizard id="account_analytic_account_quantity_cost_ledger_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.quantity_cost_ledger.report" string="Cost Ledger (Only quantities)"/> +<!-- <wizard id="account_analytic_account_quantity_cost_ledger_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.quantity_cost_ledger.report" string="Cost Ledger (Only quantities)"/>--> <report auto="False" id="account_analytic_account_analytic_check" menu="False" model="account.account" name="account.analytic.account.analytic.check" rml="account/project/report/analytic_check.rml" string="Analytic Check"/> - <wizard id="account_analytic_account_analytic_check_report" keyword="client_print_multi" model="account.account" name="account.analytic.account.analytic.check.report" string="Analytic Check"/> +<!-- <wizard id="account_analytic_account_analytic_check_report" keyword="client_print_multi" model="account.account" name="account.analytic.account.analytic.check.report" string="Analytic Check"/>--> </data> </openerp> diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index e0854f8d65dea68fb538f52365ccd8455ed210a8..a97be959cd12a89c04f89c260079111178634126 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -127,8 +127,8 @@ parent="account_analytic_def_account"/> <!-- <menuitem action="action_account_analytic_account_tree2" id="account_analytic_chart" parent="account.menu_finance_charts"/>--> - <wizard id="wizard_analytic_account_chart" menu="False" model="account.analytic.account" name="account.analytic.account.chart" string="Analytic Chart of Accounts"/> - <menuitem icon="STOCK_INDENT" action="wizard_analytic_account_chart" id="menu_action_analytic_account_tree2" parent="account.menu_finance_charts" type="wizard"/> +<!-- <wizard id="wizard_analytic_account_chart" menu="False" model="account.analytic.account" name="account.analytic.account.chart" string="Analytic Chart of Accounts"/> + <menuitem icon="STOCK_INDENT" action="wizard_analytic_account_chart" id="menu_action_analytic_account_tree2" parent="account.menu_finance_charts" type="wizard"/>--> <menuitem id="next_id_40" name="Analytic" parent="account.menu_finance_generic_reporting" sequence="4"/> <menuitem action="action_account_analytic_account_tree2" id="account_analytic_chart_balance" parent="next_id_40"/> diff --git a/addons/account/project/report/analytic_check.py b/addons/account/project/report/analytic_check.py index 0469c3b691863c8b23180f7d3349861639f1b691..54fbaddc4d9a3cc33a2a52618773b324afbec797 100644 --- a/addons/account/project/report/analytic_check.py +++ b/addons/account/project/report/analytic_check.py @@ -18,9 +18,9 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## +import time import pooler -import time from report import report_sxw class account_analytic_analytic_check(report_sxw.rml_parse): @@ -132,5 +132,4 @@ class account_analytic_analytic_check(report_sxw.rml_parse): report_sxw.report_sxw('report.account.analytic.account.analytic.check', 'account.analytic.account', 'addons/account/project/report/analytic_check.rml',parser=account_analytic_analytic_check, header=False) - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/report/quantity_cost_ledger.py b/addons/account/project/report/quantity_cost_ledger.py index c841c2131abe7293fc254446d6102ad8251b3563..12bea390ebad2a7259bc108b02d3581bcabdcabe 100644 --- a/addons/account/project/report/quantity_cost_ledger.py +++ b/addons/account/project/report/quantity_cost_ledger.py @@ -18,9 +18,9 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## +import time import pooler -import time from report import report_sxw class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): @@ -35,7 +35,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): }) def _lines_g(self, account_id, date1, date2, journals): - if not journals or not journals[0][2]: + if not journals: self.cr.execute("SELECT sum(aal.unit_amount) AS quantity, \ aa.code AS code, aa.name AS name, aa.id AS id \ FROM account_account AS aa, account_analytic_line AS aal \ @@ -45,7 +45,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code", (account_id, date1, date2)) else: - journal_ids = journals[0][2] + journal_ids = journals self.cr.execute("SELECT sum(aal.unit_amount) AS quantity, \ aa.code AS code, aa.name AS name, aa.id AS id \ FROM account_account AS aa, account_analytic_line AS aal \ @@ -59,7 +59,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): return res def _lines_a(self, general_account_id, account_id, date1, date2, journals): - if not journals or not journals[0][2]: + if not journals: self.cr.execute("SELECT aal.name AS name, aal.code AS code, \ aal.unit_amount AS quantity, aal.date AS date, \ aaj.code AS cj \ @@ -71,7 +71,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): ORDER BY aal.date, aaj.code, aal.code", (general_account_id, account_id, date1, date2)) else: - journal_ids = journals[0][2] + journal_ids = journals self.cr.execute("SELECT aal.name AS name, aal.code AS code, \ aal.unit_amount AS quantity, aal.date AS date, \ aaj.code AS cj \ @@ -86,13 +86,13 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): return res def _account_sum_quantity(self, account_id, date1, date2, journals): - if not journals or not journals[0][2]: + if not journals: self.cr.execute("SELECT sum(unit_amount) \ FROM account_analytic_line \ WHERE account_id=%s AND date>=%s AND date<=%s", (account_id, date1, date2)) else: - journal_ids = journals[0][2] + journal_ids = journals self.cr.execute("SELECT sum(unit_amount) \ FROM account_analytic_line \ WHERE account_id = %s AND date >= %s AND date <= %s \ @@ -104,17 +104,17 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): ids = map(lambda x: x.id, accounts) if not len(ids): return 0.0 - if not journals or not journals[0][2]: + if not journals: self.cr.execute("SELECT sum(unit_amount) \ FROM account_analytic_line \ WHERE account_id =ANY(%s) AND date>=%s AND date<=%s", - (date1, date2,ids,)) + (ids, date1, date2,)) else: - journal_ids = journals[0][2] + journal_ids = journals self.cr.execute("SELECT sum(unit_amount) \ FROM account_analytic_line \ WHERE account_id =ANY(%s) AND date >= %s AND date <= %s \ - AND journal_id =ANY(%s)",(ids,date1, date2,journal_ids)) + AND journal_id =ANY(%s)",(ids, date1, date2, journal_ids)) return self.cr.fetchone()[0] or 0.0 report_sxw.report_sxw('report.account.analytic.account.quantity_cost_ledger', @@ -122,6 +122,4 @@ report_sxw.report_sxw('report.account.analytic.account.quantity_cost_ledger', 'addons/account/project/report/quantity_cost_ledger.rml', parser=account_analytic_quantity_cost_ledger, header=False) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/project/wizard/__init__.py b/addons/account/project/wizard/__init__.py index f11fa936960b02e9b3d704aee17e17b0c06133e0..60f591fcb550f7f2149236e02fbb0e48888156c9 100644 --- a/addons/account/project/wizard/__init__.py +++ b/addons/account/project/wizard/__init__.py @@ -19,14 +19,13 @@ # ############################################################################## -import wizard_account_analytic_journal_report -import wizard_account_analytic_balance_report -import wizard_account_analytic_inverted_balance_report -import wizard_account_analytic_cost_ledger_report -import wizard_account_analytic_cost_ledger_for_journal_report -import wizard_account_analytic_analytic_check +import account_analytic_journal_report +import account_analytic_balance_report +import account_analytic_inverted_balance_report +import account_analytic_cost_ledger_report +import account_analytic_cost_ledger_for_journal_report +import account_analytic_check import project_account_analytic_line -import wizard_analytic_account_chart - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +import account_analytic_chart +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_budget/wizard/wizard_crossovered_budget_summary_report.py b/addons/account/project/wizard/account_analytic_balance_report.py similarity index 50% rename from addons/account_budget/wizard/wizard_crossovered_budget_summary_report.py rename to addons/account/project/wizard/account_analytic_balance_report.py index 5580fea385f0545cb03898a302f312a54f53b615..b751808ffb968999ff97e99b6dcf341841d142f9 100644 --- a/addons/account_budget/wizard/wizard_crossovered_budget_summary_report.py +++ b/addons/account/project/wizard/account_analytic_balance_report.py @@ -18,37 +18,42 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - import time -import wizard - -dates_form = '''<?xml version="1.0"?> -<form string="Select Options"> - <field name="date_from"/> - <field name="date_to"/> -</form>''' - -dates_fields = { - 'date_from': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date_to': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -} - -class wizard_report_summary(wizard.interface): - - def _default(self, cr, uid, data, context): - data['form']['report']='analytic-one' - return data['form'] - - states = { - 'init': { - 'actions': [_default], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('report','Print', 'gtk-print', True)]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'crossovered.budget.report', 'state':'end'} + +from osv import osv, fields + +class account_analytic_balance(osv.osv_memory): + _name = 'account.analytic.balance' + _description = 'Account Analytic Balance' + + _columns = { + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True), + 'empty_acc': fields.boolean('Empty Accounts ? ', help='Check if you want to display Accounts with 0 balance too.'), } - } -wizard_report_summary('wizard.crossovered.budget.summary') + + _defaults = { + 'date1':time.strftime('%Y-01-01'), + 'date2':time.strftime('%Y-%m-%d') + } + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.analytic.account', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.analytic.account.balance', + 'datas': datas, + } + +account_analytic_balance() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/account_analytic_balance_report_view.xml b/addons/account/project/wizard/account_analytic_balance_report_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..5144ba8647afb688442a90cd6bbd192c6b00296d --- /dev/null +++ b/addons/account/project/wizard/account_analytic_balance_report_view.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_analytic_balance_view" model="ir.ui.view"> + <field name="name">Account Analytic Balance</field> + <field name="model">account.analytic.balance</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Period"> + <group colspan="4" col="6"> + <field name="date1"/> + <field name="date2"/> + <newline/> + <field name="empty_acc"/> + </group> + <separator colspan="4"/> + <group colspan="4" col="6"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print"/> + </group> + </form> + </field> + </record> + + <record id="action_account_analytic_balance" model="ir.actions.act_window"> + <field name="name">Analytic Balance</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.analytic.balance</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_analytic_balance_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_analytic_balance_values"> + <field name="model_id" ref="analytic.model_account_analytic_account" /> + <field name="object" eval="1" /> + <field name="name">Account Analytic Balance</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_balance'))" /> + <field name="key">action</field> + <field name="model">account.analytic.account</field> + </record> + + </data> +</openerp> + diff --git a/addons/account/project/wizard/account_analytic_chart.py b/addons/account/project/wizard/account_analytic_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..dc55d6c43e79a2ebfa6e0657e0d87634d2bc40d3 --- /dev/null +++ b/addons/account/project/wizard/account_analytic_chart.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +from osv import osv, fields + +class account_analytic_chart(osv.osv_memory): + _name = 'account.analytic.chart' + _description = 'Account Analytic Chart' + + _columns = { + 'from_date': fields.date('From'), + 'to_date': fields.date('To'), + } + + def analytic_account_chart_open_window(self, cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.model.data') + act_obj = self.pool.get('ir.actions.act_window') + result_context = {} + if context is None: + context = {} + result = mod_obj._get_id(cr, uid, 'account', 'action_account_analytic_account_tree2') + id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] + result = act_obj.read(cr, uid, [id], context=context)[0] + data = self.read(cr, uid, ids, [])[0] + if data['from_date']: + result_context.update({'from_date' : data['from_date']}) + if data['to_date']: + result_context.update({'to_date' : data['to_date']}) + result['context'] = str(result_context) + return result + +account_analytic_chart() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/project/wizard/account_analytic_chart_view.xml b/addons/account/project/wizard/account_analytic_chart_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..cac1839712d545e42ed3713ece49a9fc5a964bce --- /dev/null +++ b/addons/account/project/wizard/account_analytic_chart_view.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_analytic_chart_view" model="ir.ui.view"> + <field name="name">Account Analytic Chart</field> + <field name="model">account.analytic.chart</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Analytic Account Charts"> + <separator string="Select the Period for Analysis" colspan="4"/> + <field name="from_date"/> + <newline/> + <field name="to_date"/> + <newline/> + <label string="(Keep empty to open the current situation)" align="0.0" colspan="3"/> + <separator colspan="4"/> + <group colspan="4" col="6"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="analytic_account_chart_open_window" string="Open Charts" type="object" icon="gtk-ok"/> + </group> + </form> + </field> + </record> + + <record id="action_account_analytic_chart" model="ir.actions.act_window"> + <field name="name">Analytic Chart of Accounts</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.analytic.chart</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_analytic_chart_view"/> + <field name="target">new</field> + </record> + + <menuitem + name="Analytic Chart of Accounts" + parent="account.menu_finance_charts" + action="action_account_analytic_chart" + id="menu_action_analytic_account_tree2" + icon="STOCK_INDENT"/> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_budget/wizard/wizard_analytic_account_budget.py b/addons/account/project/wizard/account_analytic_check.py similarity index 53% rename from addons/account_budget/wizard/wizard_analytic_account_budget.py rename to addons/account/project/wizard/account_analytic_check.py index 16702f7633d15d241b40376e354636dd2f3757b3..48c89df8fc4b724654e9e23ca5002353f503c097 100644 --- a/addons/account_budget/wizard/wizard_analytic_account_budget.py +++ b/addons/account/project/wizard/account_analytic_check.py @@ -18,33 +18,40 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - import time -import wizard -dates_form = '''<?xml version="1.0"?> -<form string="Select Dates Period"> - <field name="date_from"/> - <field name="date_to"/> -</form>''' +from osv import osv, fields -dates_fields = { - 'date_from': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date_to': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')} -} +class account_analytic_check(osv.osv_memory): + _name = 'account.analytic.check' + _description = 'Account Analytic Check' -class wizard_report(wizard.interface): + _columns = { + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True), + } - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('report','Print', 'gtk-print', True)]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'account.analytic.account.budget', 'state':'end'} + _defaults = { + 'date1':time.strftime('%Y-01-01'), + 'date2':time.strftime('%Y-%m-%d') } - } -wizard_report('wizard.analytic.account.budget.report') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.account', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.analytic.account.analytic.check', + 'datas': datas, + } + +account_analytic_check() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/account_analytic_check_view.xml b/addons/account/project/wizard/account_analytic_check_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..d12acd214a4b7c32023aa60ec7f6bd5c54002200 --- /dev/null +++ b/addons/account/project/wizard/account_analytic_check_view.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_analytic_check_view" model="ir.ui.view"> + <field name="name">Account Analytic Check</field> + <field name="model">account.analytic.check</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Period"> + <group colspan="4" col="6"> + <field name="date1"/> + <field name="date2"/> + </group> + <separator colspan="4"/> + <group colspan="4" col="6"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print"/> + </group> + </form> + </field> + </record> + + <record id="action_account_analytic_check" model="ir.actions.act_window"> + <field name="name">Analytic Check</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.analytic.check</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_analytic_check_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_analytic_check_values"> + <field name="model_id" ref="account.model_account_account" /> + <field name="object" eval="1" /> + <field name="name">Account Analytic Check</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_check'))" /> + <field name="key">action</field> + <field name="model">account.account</field> + </record> + + </data> +</openerp> + diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py new file mode 100644 index 0000000000000000000000000000000000000000..73dd38533c42271c09c34c393f50ba49501e61bf --- /dev/null +++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time + +from osv import osv, fields + +class account_analytic_cost_ledger_journal_report(osv.osv_memory): + _name = 'account.analytic.cost.ledger.journal.report' + _description = 'Account Analytic Cost Ledger For Journal Report' + + _columns = { + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True), + 'journal': fields.many2many('account.analytic.journal', 'ledger_journal_rel','ledger_id', 'Journal_id','Journals'), + } + + _defaults = { + 'date1':time.strftime('%Y-01-01'), + 'date2':time.strftime('%Y-%m-%d') + } + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.analytic.account', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.analytic.account.quantity_cost_ledger', + 'datas': datas, + } + +account_analytic_cost_ledger_journal_report() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + +#import time +#import wizard +# +#_form = '''<?xml version="1.0"?> +#<form string="Select period"> +# <separator string="Cost Legder for period" colspan="4"/> +# <field name="date1"/> +# <field name="date2"/> +# <separator string="and Journals" colspan="4"/> +# <field name="journal" colspan="4"/> +#</form>''' +# +#_fields = { +# 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, +# 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, +# 'journal': {'string':'Journals','type':'many2many', 'relation':'account.analytic.journal'}, +#} +# +# +#class wizard_report(wizard.interface): +# states = { +# 'init': { +# 'actions': [], +# 'result': { +# 'type': 'form', +# 'arch': _form, +# 'fields': _fields, +# 'state': [ +# ('end','Cancel'), +# ('report','Print') +# ] +# } +# }, +# 'report': { +# 'actions': [], +# 'result': { +# 'type': 'print', +# 'report': 'account.analytic.account.quantity_cost_ledger', +# 'state': 'end' +# } +# }, +# } +# +#wizard_report('account.analytic.account.quantity_cost_ledger.report') +# +## vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..1ad974e86504bdfabb7d698d4629ffcfb0c525bb --- /dev/null +++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_analytic_cost_ledger_journal_view" model="ir.ui.view"> + <field name="name">Account Analytic Cost Ledger Journal</field> + <field name="model">account.analytic.cost.ledger.journal.report</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select period"> + <separator string="Cost Legder for period" colspan="4"/> + <field name="date1"/> + <field name="date2"/> + <separator string="and Journals" colspan="4"/> + <field name="journal" colspan="4"/> + <separator colspan="4"/> + <group colspan="4" col="6"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print"/> + </group> + </form> + </field> + </record> + + <record id="action_account_analytic_cost_ledger_journal" model="ir.actions.act_window"> + <field name="name">Cost Ledger (Only quantities)</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.analytic.cost.ledger.journal.report</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_analytic_cost_ledger_journal_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_analytic_cost_ledger_journal_values"> + <field name="model_id" ref="analytic.model_account_analytic_account" /> + <field name="object" eval="1" /> + <field name="name">Account Analytic Cost Ledger Journal</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_cost_ledger_journal'))" /> + <field name="key">action</field> + <field name="model">account.analytic.account</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account/project/wizard/wizard_account_analytic_inverted_balance_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_report.py similarity index 52% rename from addons/account/project/wizard/wizard_account_analytic_inverted_balance_report.py rename to addons/account/project/wizard/account_analytic_cost_ledger_report.py index 9219a8ea9ae374bc969d3ad2bd80740eaa20920c..96b480b4fb5ccfe51812bfa287eaf65abe587565 100644 --- a/addons/account/project/wizard/wizard_account_analytic_inverted_balance_report.py +++ b/addons/account/project/wizard/account_analytic_cost_ledger_report.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,38 +15,42 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - import time -import wizard -dates_form = '''<?xml version="1.0"?> -<form string="Select period"> - <field name="date1"/> - <field name="date2"/> -</form>''' +from osv import osv, fields -dates_fields = { - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -} +class account_analytic_cost_ledger(osv.osv_memory): + _name = 'account.analytic.cost.ledger' + _description = 'Account Analytic Cost Ledger' -class wizard_report(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'account.analytic.account.inverted.balance', 'state':'end'} + _columns = { + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True), } - } -wizard_report('account.analytic.account.inverted.balance.report') - + _defaults = { + 'date1':time.strftime('%Y-01-01'), + 'date2':time.strftime('%Y-%m-%d') + } + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.analytic.account', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.analytic.account.cost_ledger', + 'datas': datas, + } + +account_analytic_cost_ledger() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_view.xml b/addons/account/project/wizard/account_analytic_cost_ledger_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..a45eda32275773b1026896c1c05c79db482baf07 --- /dev/null +++ b/addons/account/project/wizard/account_analytic_cost_ledger_view.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_analytic_cost_view" model="ir.ui.view"> + <field name="name">Account Analytic Check</field> + <field name="model">account.analytic.cost.ledger</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Period"> + <group colspan="4" col="6"> + <field name="date1"/> + <field name="date2"/> + </group> + <separator colspan="4"/> + <group colspan="4" col="6"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print"/> + </group> + </form> + </field> + </record> + + <record id="action_account_analytic_cost" model="ir.actions.act_window"> + <field name="name">Cost Ledger</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.analytic.cost.ledger</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_analytic_cost_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_analytic_cost_values"> + <field name="model_id" ref="analytic.model_account_analytic_account" /> + <field name="object" eval="1" /> + <field name="name">Account Analytic Cost</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_cost'))" /> + <field name="key">action</field> + <field name="model">account.analytic.account</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.py b/addons/account/project/wizard/account_analytic_inverted_balance_report.py new file mode 100644 index 0000000000000000000000000000000000000000..52f7da936fe832f64b15cb80205ea40fb822128b --- /dev/null +++ b/addons/account/project/wizard/account_analytic_inverted_balance_report.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time + +from osv import osv, fields + +class account_analytic_inverted_balance(osv.osv_memory): + _name = 'account.analytic.inverted.balance' + _description = 'Account Analytic Inverted Balance' + + _columns = { + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True), + } + + _defaults = { + 'date1':time.strftime('%Y-01-01'), + 'date2':time.strftime('%Y-%m-%d') + } + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.analytic.account', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.analytic.account.inverted.balance', + 'datas': datas, + } + +account_analytic_inverted_balance() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.xml b/addons/account/project/wizard/account_analytic_inverted_balance_report.xml new file mode 100644 index 0000000000000000000000000000000000000000..e989f766d7b1de24912a3c0c3f8d35c94a7f7d75 --- /dev/null +++ b/addons/account/project/wizard/account_analytic_inverted_balance_report.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_analytic_invert_balance_view" model="ir.ui.view"> + <field name="name">Account Analytic Inverted Balance</field> + <field name="model">account.analytic.inverted.balance</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Period"> + <group colspan="4" col="6"> + <field name="date1"/> + <field name="date2"/> + </group> + <separator colspan="4"/> + <group colspan="4" col="6"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print"/> + </group> + </form> + </field> + </record> + + <record id="action_account_analytic_invert_balance" model="ir.actions.act_window"> + <field name="name">Inverted Analytic Balance</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.analytic.inverted.balance</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_analytic_invert_balance_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_analytic_invert_balance_values"> + <field name="model_id" ref="analytic.model_account_analytic_account" /> + <field name="object" eval="1" /> + <field name="name">Account Analytic Inverted Balance</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_invert_balance'))" /> + <field name="key">action</field> + <field name="model">account.analytic.account</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account/project/wizard/wizard_account_analytic_journal_report.py b/addons/account/project/wizard/account_analytic_journal_report.py similarity index 52% rename from addons/account/project/wizard/wizard_account_analytic_journal_report.py rename to addons/account/project/wizard/account_analytic_journal_report.py index 03be104469daa3b7895b6589d1d6fac2d4002d14..aef6a85149dd313329ae8df9e3733e1bb7383db3 100644 --- a/addons/account/project/wizard/wizard_account_analytic_journal_report.py +++ b/addons/account/project/wizard/account_analytic_journal_report.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,37 +15,42 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - import time -import wizard -dates_form = '''<?xml version="1.0"?> -<form string="Analytic Journal Report"> - <field name="date1"/> - <field name="date2"/> -</form>''' +from osv import osv, fields -dates_fields = { - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -} +class account_analytic_Journal_report(osv.osv_memory): + _name = 'account.analytic.Journal.report' + _description = 'Account Analytic Journal' -class wizard_report(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'account.analytic.journal', 'state':'end'} + _columns = { + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True), } - } -wizard_report('account.analytic.account.journal.report') + _defaults = { + 'date1':time.strftime('%Y-01-01'), + 'date2':time.strftime('%Y-%m-%d') + } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.analytic.journal', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.analytic.journal', + 'datas': datas, + } +account_analytic_Journal_report() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/project/wizard/account_analytic_journal_report_view.xml b/addons/account/project/wizard/account_analytic_journal_report_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..137920ee056df4bec05f0823b97ba3d74819d54b --- /dev/null +++ b/addons/account/project/wizard/account_analytic_journal_report_view.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_analytic_journal_view" model="ir.ui.view"> + <field name="name">Account Analytic Journal</field> + <field name="model">account.analytic.Journal.report</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Period"> + <group colspan="4" col="6"> + <field name="date1"/> + <field name="date2"/> + </group> + <separator colspan="4"/> + <group colspan="4" col="6"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print"/> + </group> + </form> + </field> + </record> + + <record id="action_account_analytic_journal" model="ir.actions.act_window"> + <field name="name">Analytic Journal</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.analytic.Journal.report</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_analytic_journal_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_analytic_journal_values"> + <field name="model_id" ref="account.model_account_analytic_journal" /> + <field name="object" eval="1" /> + <field name="name">Account Analytic Journal</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_journal'))" /> + <field name="key">action</field> + <field name="model">account.analytic.journal</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account/project/wizard/wizard_account_analytic_analytic_check.py b/addons/account/project/wizard/wizard_account_analytic_analytic_check.py deleted file mode 100644 index a1bbbc50b8c2655d06efa5f6d2161383af7ae59d..0000000000000000000000000000000000000000 --- a/addons/account/project/wizard/wizard_account_analytic_analytic_check.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import time -import wizard - -dates_form = '''<?xml version="1.0"?> -<form string="Select period"> - <field name="date1"/> - <field name="date2"/> -</form>''' - -dates_fields = { - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -} - -class wizard_report(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'account.analytic.account.analytic.check', 'state':'end'} - } - } -wizard_report('account.analytic.account.analytic.check.report') - - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account/project/wizard/wizard_account_analytic_balance_report.py b/addons/account/project/wizard/wizard_account_analytic_balance_report.py deleted file mode 100644 index 916a123d745e519cd2502890add8fa0a92faed19..0000000000000000000000000000000000000000 --- a/addons/account/project/wizard/wizard_account_analytic_balance_report.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import time -import wizard - -dates_form = '''<?xml version="1.0"?> -<form string="Select Period"> - <field name="date1"/> - <field name="date2"/> - <field name="empty_acc"/> -</form>''' - -dates_fields = { - 'date1': {'string':'Start of Period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of Period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, - 'empty_acc': {'string':'Empty Accounts ? ', 'type':'boolean', 'help':'Check if you want to display Accounts with 0 balance too.'}, -} - - -class wizard_report(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'account.analytic.account.balance', 'state':'end'} - } - } -wizard_report('account.analytic.account.balance.report') - - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account/project/wizard/wizard_account_analytic_cost_ledger_for_journal_report.py b/addons/account/project/wizard/wizard_account_analytic_cost_ledger_for_journal_report.py deleted file mode 100644 index feafab05a475e9a84faf45eba60e36b1c54e3f09..0000000000000000000000000000000000000000 --- a/addons/account/project/wizard/wizard_account_analytic_cost_ledger_for_journal_report.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import time -import wizard - -_form = '''<?xml version="1.0"?> -<form string="Select period"> - <separator string="Cost Legder for period" colspan="4"/> - <field name="date1"/> - <field name="date2"/> - <separator string="and Journals" colspan="4"/> - <field name="journal" colspan="4"/> -</form>''' - -_fields = { - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, - 'journal': {'string':'Journals','type':'many2many', 'relation':'account.analytic.journal'}, -} - - -class wizard_report(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': { - 'type': 'form', - 'arch': _form, - 'fields': _fields, - 'state': [ - ('end','Cancel'), - ('report','Print') - ] - } - }, - 'report': { - 'actions': [], - 'result': { - 'type': 'print', - 'report': 'account.analytic.account.quantity_cost_ledger', - 'state': 'end' - } - }, - } - -wizard_report('account.analytic.account.quantity_cost_ledger.report') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account/project/wizard/wizard_analytic_account_chart.py b/addons/account/project/wizard/wizard_analytic_account_chart.py deleted file mode 100644 index e011fad15bb02744c600bc35b74c8c665ba8f306..0000000000000000000000000000000000000000 --- a/addons/account/project/wizard/wizard_analytic_account_chart.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import pooler - -class wizard_analytic_account_chart(wizard.interface): - _account_chart_arch = '''<?xml version="1.0"?> - <form string="Analytic Account Charts"> - <separator string="Select the Period for Analysis" colspan="4"/> - <field name="from_date"/> - <newline/> - <field name="to_date"/> - <newline/> - <label string="(Keep empty to open the current situation)" align="0.0" colspan="3"/> - </form>''' - - _account_chart_fields = { - 'from_date': { - 'string': 'From', - 'type': 'date', - }, - 'to_date': { - 'string': 'To', - 'type': 'date', - }, - } - - - def _analytic_account_chart_open_window(self, cr, uid, data, context): - mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data') - act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window') - - result = mod_obj._get_id(cr, uid, 'account', 'action_account_analytic_account_tree2') - id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] - result = act_obj.read(cr, uid, [id], context=context)[0] - - result_context = {} - if data['form']['from_date']: - result_context.update({'from_date' : data['form']['from_date']}) - if data['form']['to_date']: - result_context.update({'to_date' : data['form']['to_date']}) - - result['context'] = str(result_context) - return result - - states = { - 'init': { - 'actions': [], - 'result': {'type': 'form', 'arch':_account_chart_arch, 'fields':_account_chart_fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('open', 'Open Charts', 'gtk-ok')]} - }, - 'open': { - 'actions': [], - 'result': {'type': 'action', 'action':_analytic_account_chart_open_window, 'state':'end'} - } - } -wizard_analytic_account_chart('account.analytic.account.chart') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 558ebc68380f2ae00b300ec4ed21e0d1cfd3184f..e4731e2c994b816ad12bade0481d1966ec7a249c 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -29,7 +29,6 @@ from report import report_sxw class account_balance(report_sxw.rml_parse): _name = 'report.account.account.balance' def __init__(self, cr, uid, name, context): - print " KKKKKKKKKKKKKKKKKKKKKKKK" super(account_balance, self).__init__(cr, uid, name, context=context) self.sum_debit = 0.00 self.sum_credit = 0.00 diff --git a/addons/account/report/account_balance_landscape.py b/addons/account/report/account_balance_landscape.py old mode 100755 new mode 100644 diff --git a/addons/account/report/compare_account_balance.py b/addons/account/report/compare_account_balance.py old mode 100755 new mode 100644 diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 1f29782b7ea02f57f5c37326a9bcf365058b61bc..6f1cac0510237aa80da46a8032683a445535b120 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -238,7 +238,7 @@ <tr> <td><para style="P8"><font color="white"> </font></para></td> <td> - <para style="terp_default_8">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="terp_default_8">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="terp_default_8">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para> <para style="terp_default_8">[[ o.address_invoice_id.street ]]</para> <para style="terp_default_8">[[ o.address_invoice_id.street2 or '' ]]</para> diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py old mode 100755 new mode 100644 diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index cd9727d59034a681d9732c287f54626cd61dc95a..beb3e4e8ebb01f3247305ef2b485ffed138d86d4 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -36,161 +36,88 @@ <field eval="[(6,0,[ref('group_account_user'), ref('group_account_manager')])]" name="groups_id"/> </record> - <record id="account_move_comp_rule_group" model="ir.rule.group"> + <record id="account_move_comp_rule" model="ir.rule"> <field name="name">Account Entry</field> <field ref="model_account_move" name="model_id"/> <field eval="True" name="global"/> + <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record id="account_move_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.move'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> - <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="account_move_comp_rule_group"/> - </record> - - <record id="account_move_line_comp_rule_group" model="ir.rule.group"> - <field name="name">Entry lines</field> + <record id="account_move_line_comp_rule" model="ir.rule"> + <field name="name">Entry lines</field> <field model="ir.model" name="model_id" ref="model_account_move_line"/> <field eval="True" name="global"/> - </record> - - <record id="account_move_line_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.move.line'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="account_move_line_comp_rule_group"/> </record> - <record id="journal_period_comp_rule_group" model="ir.rule.group"> - <field name="name">Journal Period</field> + + <record id="journal_period_comp_rule" model="ir.rule"> + <field name="name">Journal Period</field> <field model="ir.model" name="model_id" ref="model_account_journal_period"/> <field eval="True" name="global"/> - </record> - <record id="journal_period_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.journal.period'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="journal_period_comp_rule_group"/> </record> - <record id="journal_comp_rule_group" model="ir.rule.group"> - <field name="name">Journal multi-company</field> + <record id="journal_comp_rule" model="ir.rule"> + <field name="name">Journal multi-company</field> <field model="ir.model" name="model_id" ref="model_account_journal"/> <field eval="True" name="global"/> - </record> - <record id="journal_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.journal'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="journal_comp_rule_group"/> </record> - <record id="analytic_journal_comp_rule_group" model="ir.rule.group"> - <field name="name">Analytic journal multi-company</field> + + <record id="analytic_journal_comp_rule" model="ir.rule"> + <field name="name">Analytic journal multi-company</field> <field model="ir.model" name="model_id" ref="model_account_analytic_journal"/> <field eval="True" name="global"/> - </record> - <record id="analytic_journal_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.analytic.journal'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="analytic_journal_comp_rule_group"/> </record> - <record id="analytic_journal_comp_rule_group1" model="ir.rule.group"> - <field name="name">Analytic journal multi-company</field> + + <record id="analytic_journal_comp_rule_false" model="ir.rule"> + <field name="name">Analytic journal multi-company</field> <field model="ir.model" name="model_id" ref="model_account_analytic_journal"/> <field eval="True" name="global"/> - </record> - - <record id="analytic_journal_comp_rule_false" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.analytic.journal'),('name','=','company_id')]"/> - <field name="operator">=</field> - <field name="operand">False</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="analytic_journal_comp_rule_group1"/> </record> - - <record id="period_comp_rule_group" model="ir.rule.group"> - <field name="name">Period multi-company</field> + + <record id="period_comp_rule" model="ir.rule"> + <field name="name">Period multi-company</field> <field model="ir.model" name="model_id" ref="model_account_period"/> <field eval="True" name="global"/> - </record> - <record id="period_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.period'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="period_comp_rule_group"/> </record> - - - <record id="fiscal_year_comp_rule_group" model="ir.rule.group"> - <field name="name">Fiscal year multi-company</field> + + <record id="fiscal_year_comp_rule" model="ir.rule"> + <field name="name">Fiscal year multi-company</field> <field model="ir.model" name="model_id" ref="model_account_fiscalyear"/> <field eval="True" name="global"/> - </record> - <record id="fiscal_year_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.fiscalyear'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="fiscal_year_comp_rule_group"/> </record> - - <record id="account_comp_rule_group" model="ir.rule.group"> - <field name="name">Account multi-company</field> + + <record id="account_comp_rule" model="ir.rule"> + <field name="name">Account multi-company</field> <field model="ir.model" name="model_id" ref="model_account_account"/> <field eval="True" name="global"/> - </record> - <record id="account_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.account'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="account_comp_rule_group"/> </record> - - <record id="tax_comp_rule_group" model="ir.rule.group"> - <field name="name">Tax multi-company</field> + + <record id="tax_comp_rule" model="ir.rule"> + <field name="name">Tax multi-company</field> <field model="ir.model" name="model_id" ref="model_account_tax"/> <field eval="True" name="global"/> - </record> - <record id="tax_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.tax'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="tax_comp_rule_group"/> </record> - - <record id="tax_code_comp_rule_group" model="ir.rule.group"> - <field name="name">Tax code multi-company</field> + + <record id="tax_code_comp_rule" model="ir.rule"> + <field name="name">Tax code multi-company</field> <field model="ir.model" name="model_id" ref="model_account_tax_code"/> <field eval="True" name="global"/> - </record> - <record id="tax_code_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.tax.code'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="tax_code_comp_rule_group"/> </record> - - <record id="invoice_comp_rule_group" model="ir.rule.group"> - <field name="name">Invoice multi-company</field> + + <record id="invoice_comp_rule" model="ir.rule"> + <field name="name">Invoice multi-company</field> <field model="ir.model" name="model_id" ref="model_account_invoice"/> <field eval="True" name="global"/> - </record> - <record id="invoice_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.invoice'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="invoice_comp_rule_group"/> </record> </data></openerp> diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py index 91fb10e5205b14c1e1b783122357c5041ca1ee0c..39971f5c11a364f9e34d83c7b1765f802aeb0eab 100644 --- a/addons/account/wizard/__init__.py +++ b/addons/account/wizard/__init__.py @@ -19,10 +19,10 @@ # ############################################################################## -import wizard_automatic_reconcile +import account_automatic_reconcile import account_move_line_reconcile_select import account_move_line_unreconcile_select -import wizard_reconcile +import account_reconcile import account_unreconcile import account_invoice_refund import account_pay_invoice diff --git a/addons/account/wizard/account_aged_trial_balance.py b/addons/account/wizard/account_aged_trial_balance.py old mode 100755 new mode 100644 index bdcb8af735a4507491f5ea849bc126cb20683de4..dee5e20e0864af0247b71f9c9fdb449ea5fddda6 --- a/addons/account/wizard/account_aged_trial_balance.py +++ b/addons/account/wizard/account_aged_trial_balance.py @@ -43,7 +43,7 @@ class account_aged_trial_balance(osv.osv_memory): 'Analysis Direction', required=True), } - def _get_company(self, cr, uid, ids, context=None): + def _get_company(self, cr, uid, context=None): user_obj = self.pool.get('res.users') company_obj = self.pool.get('res.company') if context is None: @@ -55,11 +55,11 @@ class account_aged_trial_balance(osv.osv_memory): return company_obj.search(cr, uid, [('parent_id', '=', False)])[0] _defaults = { - 'company_id' : _get_company, - 'period_length' : 30, + 'company_id': _get_company, + 'period_length': 30, 'date1' : time.strftime('%Y-%m-%d'), - 'result_selection' : 'all', - 'direction_selection' : 'past', + 'result_selection': 'all', + 'direction_selection': 'past', } def calc_dates(self, cr, uid, ids, context=None): @@ -103,4 +103,5 @@ class account_aged_trial_balance(osv.osv_memory): } account_aged_trial_balance() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py new file mode 100644 index 0000000000000000000000000000000000000000..2370c6dbe13f17fced9e240f56f9a231505c9d3a --- /dev/null +++ b/addons/account/wizard/account_automatic_reconcile.py @@ -0,0 +1,243 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time + +import netsvc +from osv import osv, fields +from tools.translate import _ + +class account_automatic_reconcile(osv.osv_memory): + _name = 'account.automatic.reconcile' + _description = 'Automatic Reconcile' + + _columns = { + 'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Account to reconcile', domain = [('reconcile','=',1)], \ + help = 'If no account is specified, the reconciliation will be made using every accounts that can be reconcilied'), + 'writeoff_acc_id': fields.many2one('account.account', 'Account', required=True), + 'journal_id': fields.many2one('account.journal', 'Journal', required=True), + 'period_id': fields.many2one('account.period', 'Period', required=True), + 'max_amount': fields.float('Maximum write-off amount'), + 'power': fields.selection([(p, str(p)) for p in range(2, 10)], 'Power', required=True), + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True), + 'reconciled': fields.integer('Reconciled transactions', readonly=True), + 'unreconciled': fields.integer('Not reconciled transactions', readonly=True), + } + + def _get_reconciled(self, cr, uid, context={}): + return context.get('reconciled', 0) + + def _get_unreconciled(self, cr, uid, context={}): + return context.get('unreconciled', 0) + + _defaults = { + 'date1': time.strftime('%Y-01-01'), + 'date2': time.strftime('%Y-%m-%d'), + 'reconciled': _get_reconciled, + 'unreconciled': _get_unreconciled, + } + + #TODO: cleanup and comment this code... For now, it is awfulllll + # (way too complex, and really slow)... + def do_reconcile(self, cr, uid, credits, debits, max_amount, power, writeoff_acc_id, period_id, journal_id, context=None): + # for one value of a credit, check all debits, and combination of them + # depending on the power. It starts with a power of one and goes up + # to the max power allowed + move_line_obj = self.pool.get('account.move.line') + if context is None: + context = {} + def check2(value, move_list, power): + def check(value, move_list, power): + for i in range(len(move_list)): + move = move_list[i] + if power == 1: + if abs(value - move[1]) <= max_amount + 0.00001: + return [move[0]] + else: + del move_list[i] + res = check(value - move[1], move_list, power-1) + move_list[i:i] = [move] + if res: + res.append(move[0]) + return res + return False + + for p in range(1, power+1): + res = check(value, move_list, p) + if res: + return res + return False + + # for a list of credit and debit and a given power, check if there + # are matching tuples of credit and debits, check all debits, and combination of them + # depending on the power. It starts with a power of one and goes up + # to the max power allowed + def check4(list1, list2, power): + def check3(value, list1, list2, list1power, power): + for i in range(len(list1)): + move = list1[i] + if list1power == 1: + res = check2(value + move[1], list2, power - 1) + if res: + return ([move[0]], res) + else: + del list1[i] + res = check3(value + move[1], list1, list2, list1power-1, power-1) + list1[i:i] = [move] + if res: + x, y = res + x.append(move[0]) + return (x, y) + return False + + for p in range(1, power): + res = check3(0, list1, list2, p, power) + if res: + return res + return False + + def check5(list1, list2, max_power): + for p in range(2, max_power+1): + res = check4(list1, list2, p) + if res: + return res + + ok = True + reconciled = 0 + while credits and debits and ok: + res = check5(credits, debits, power) + if res: + move_line_obj.reconcile(cr, uid, res[0] + res[1], 'auto', writeoff_acc_id, period_id, journal_id, context) + reconciled += len(res[0]) + len(res[1]) + credits = [(id, credit) for (id, credit) in credits if id not in res[0]] + debits = [(id, debit) for (id, debit) in debits if id not in res[1]] + else: + ok = False + return (reconciled, len(credits)+len(debits)) + + def reconcile(self, cr, uid, ids, context=None): + service = netsvc.LocalService("object_proxy") + move_line_obj = self.pool.get('account.move.line') + obj_model = self.pool.get('ir.model.data') + if context is None: + context = {} + form = self.read(cr, uid, ids, [])[0] + max_amount = form.get('max_amount', 0.0) + power = form['power'] + reconciled = unreconciled = 0 + if not form['account_ids']: + raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile')) + for account_id in form['account_ids']: + # reconcile automatically all transactions from partners whose balance is 0 + cr.execute( + "SELECT partner_id " \ + "FROM account_move_line " \ + "WHERE account_id=%s " \ + "AND reconcile_id IS NULL " \ + "AND state <> 'draft' " \ + "GROUP BY partner_id " \ + "HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0", + (account_id, max_amount or 0.0)) + partner_ids = [id for (id,) in cr.fetchall()] + for partner_id in partner_ids: + cr.execute( + "SELECT id " \ + "FROM account_move_line " \ + "WHERE account_id=%s " \ + "AND partner_id=%s " \ + "AND state <> 'draft' " \ + "AND reconcile_id IS NULL", + (account_id, partner_id)) + line_ids = [id for (id,) in cr.fetchall()] + if len(line_ids): + move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context) + reconciled += len(line_ids) + + # get the list of partners who have more than one unreconciled transaction + cr.execute( + "SELECT partner_id " \ + "FROM account_move_line " \ + "WHERE account_id=%s " \ + "AND reconcile_id IS NULL " \ + "AND state <> 'draft' " \ + "AND partner_id IS NOT NULL " \ + "GROUP BY partner_id " \ + "HAVING count(*)>1", + (account_id,)) + partner_ids = [id for (id,) in cr.fetchall()] + #filter? + for partner_id in partner_ids: + # get the list of unreconciled 'debit transactions' for this partner + cr.execute( + "SELECT id, debit " \ + "FROM account_move_line " \ + "WHERE account_id=%s " \ + "AND partner_id=%s " \ + "AND reconcile_id IS NULL " \ + "AND state <> 'draft' " \ + "AND debit > 0", + (account_id, partner_id)) + debits = cr.fetchall() + + # get the list of unreconciled 'credit transactions' for this partner + cr.execute( + "SELECT id, credit " \ + "FROM account_move_line " \ + "WHERE account_id=%s " \ + "AND partner_id=%s " \ + "AND reconcile_id IS NULL " \ + "AND state <> 'draft' " \ + "AND credit > 0", + (account_id, partner_id)) + credits = cr.fetchall() + + (rec, unrec) = self.do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context) + reconciled += rec + unreconciled += unrec + + # add the number of transactions for partners who have only one + # unreconciled transactions to the unreconciled count + partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or '' + cr.execute( + "SELECT count(*) " \ + "FROM account_move_line " \ + "WHERE account_id=%s " \ + "AND reconcile_id IS NULL " \ + "AND state <> 'draft' " + partner_filter, + (account_id,)) + additional_unrec = cr.fetchone()[0] + context.update({'reconciled': reconciled, 'unreconciled': unreconciled + additional_unrec}) + model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_automatic_reconcile_view1')]) + resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id'] + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'account.automatic.reconcile', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + 'context': context, + 'nodestroy':True, + } + +account_automatic_reconcile() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_automatic_reconcile_view.xml b/addons/account/wizard/account_automatic_reconcile_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..9711fc9b9412cf8cf575713091e10a99d2fda33e --- /dev/null +++ b/addons/account/wizard/account_automatic_reconcile_view.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_automatic_reconcile_view" model="ir.ui.view"> + <field name="name">Account Automatic Reconcile</field> + <field name="model">account.automatic.reconcile</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Reconciliation"> + <separator string="Options" colspan="4"/> + <field name="account_ids" colspan="4" domain="[('reconcile','=',1)]"/> + <field name="date1"/> + <field name="date2"/> + <field name="power"/> + <separator string="Write-Off Move" colspan="4"/> + <field name="max_amount"/> + <field name="writeoff_acc_id"/> + <field name="journal_id"/> + <field name="period_id"/> + <separator string ="" colspan="4"/> + <group colspan="2" col="4"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="reconcile" string="Reconcile" type="object" icon="gtk-ok"/> + </group> + </form> + </field> + </record> + + <record id="action_account_automatic_reconcile" model="ir.actions.act_window"> + <field name="name">Account Automatic Reconcile</field> + <field name="res_model">account.automatic.reconcile</field> + <field name="type">ir.actions.act_window</field> + <field name="view_type">form</field> + <field name="view_mode">tree,form</field> + <field name="view_id" ref="account_automatic_reconcile_view"/> + <field name="context">{'record_id':active_id}</field> + <field name="target">new</field> + </record> + + <menuitem + icon="STOCK_EXECUTE" + name="Automatic reconciliation" + action="action_account_automatic_reconcile" + id="menu_automatic_reconcile" + parent="next_id_20"/> + + <record id="account_automatic_reconcile_view1" model="ir.ui.view"> + <field name="name">Automatic reconcile unreconcile</field> + <field name="model">account.automatic.reconcile</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Reconciliation result"> + <field name="reconciled"/> + <newline/> + <field name="unreconciled"/> + <group colspan="4" col="6"> + <separator colspan="6"/> + <button special="cancel" string="Ok" icon="gtk-ok" default_focus="1"/> + </group> + </form> + </field> + </record> + + </data> +</openerp> + diff --git a/addons/account/wizard/account_balance_report.py b/addons/account/wizard/account_balance_report.py index 2873f479629b56a7d2388cc966cc0b63c441e24a..b131ff3123a708d5d11a5f79b6b30dbef57ba29e 100644 --- a/addons/account/wizard/account_balance_report.py +++ b/addons/account/wizard/account_balance_report.py @@ -50,7 +50,7 @@ class account_balance_report(osv.osv_memory): 'date_to': fields.date('End date', required=True), } - def _get_company(self, cr, uid, ids, context=None): + def _get_company(self, cr, uid, context=None): user_obj = self.pool.get('res.users') company_obj = self.pool.get('res.company') user = user_obj.browse(cr, uid, uid, context=context) @@ -109,6 +109,7 @@ class account_balance_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data, + 'nodestroy':True, } def _check_date(self, cr, uid, data, context=None): @@ -127,6 +128,7 @@ class account_balance_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data, + 'nodestroy':True, } else: raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) diff --git a/addons/account/wizard/account_central_journal.py b/addons/account/wizard/account_central_journal.py index 08fe881c81adc03cb7e405e60829a57518dade51..b1a0f3c28492e5f0ac200a8fbf52ef2b4f572d60 100644 --- a/addons/account/wizard/account_central_journal.py +++ b/addons/account/wizard/account_central_journal.py @@ -18,7 +18,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - from osv import osv, fields from tools.translate import _ @@ -40,7 +39,7 @@ class account_central_journal(osv.osv_memory): period_id = datas['form']['period_id'] journal_id = datas['form']['journal_id'] - if type(period_id)==type([]): + if isinstance(period_id, list): ids_final = [] for journal in journal_id: for period in period_id: @@ -53,10 +52,9 @@ class account_central_journal(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.central.journal', 'datas': datas, + 'nodestroy':True, } account_central_journal() -#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - - +#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_change_currency.py b/addons/account/wizard/account_change_currency.py index 707a182a2aa2e24d9d73461538c5048be54919b8..1e23b793d2702b488264b89b633728e986b2dd03 100644 --- a/addons/account/wizard/account_change_currency.py +++ b/addons/account/wizard/account_change_currency.py @@ -71,4 +71,4 @@ class account_change_currency(osv.osv_memory): account_change_currency() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_chart.py b/addons/account/wizard/account_chart.py index 38f471144909f88ecd4acee2a3c6726711ee8d9d..ba94bbfb37c527dc920c1c284b4df550c405a77e 100644 --- a/addons/account/wizard/account_chart.py +++ b/addons/account/wizard/account_chart.py @@ -18,7 +18,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - from osv import fields, osv from tools.translate import _ @@ -30,44 +29,42 @@ class account_chart(osv.osv_memory): _description = "chart" _columns = { 'fiscalyear': fields.many2one('account.fiscalyear', \ - 'Fiscal year', \ - help = 'Keep empty for all open fiscal years'), - 'target_move': fields.selection([ - ('all', 'All Entries'), - ('posted', 'All Posted Entries'), - ], 'Target Moves', required = True), - + 'Fiscal year', \ + help = 'Keep empty for all open fiscal years'), + 'target_move': fields.selection([('all', 'All Entries'), + ('posted', 'All Posted Entries')], 'Target Moves', required = True), } - def _get_defaults(self, cr, uid, context={}): - """Return default Fiscalyear value""" - fiscalyear_obj = self.pool.get('account.fiscalyear') - fiscalyear = fiscalyear_obj.find(cr, uid) - return fiscalyear - def account_chart_open_window(self, cr, uid, ids, context={}): - """ - Opens chart of Accounts - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of account chart’s IDs - @return: dictionary of Open account chart window on given fiscalyear and all Entries or posted entries - """ - mod_obj = self.pool.get('ir.model.data') - act_obj = self.pool.get('ir.actions.act_window') - for data in self.read(cr, uid, ids,context=context): - result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree') - id = mod_obj.read(cr, uid, [result], ['res_id'],context=context)[0]['res_id'] - result = act_obj.read(cr, uid, [id], context=context)[0] - result['context'] = str({'fiscalyear': data['fiscalyear'], \ - 'state': data['target_move']}) - if data['fiscalyear']: - result['name'] += ':' + self.pool.get('account.fiscalyear').read(cr, uid, [data['fiscalyear']],context=context)[0]['code'] - return result + def _get_fiscalyear(self, cr, uid, context=None): + """Return default Fiscalyear value""" + fiscalyear_obj = self.pool.get('account.fiscalyear') + fiscalyear = fiscalyear_obj.find(cr, uid) + return fiscalyear + def account_chart_open_window(self, cr, uid, ids, context={}): + """ + Opens chart of Accounts + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of account chart’s IDs + @return: dictionary of Open account chart window on given fiscalyear and all Entries or posted entries + """ + mod_obj = self.pool.get('ir.model.data') + act_obj = self.pool.get('ir.actions.act_window') + data = self.read(cr, uid, ids, [], context=context)[0] + result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree') + id = mod_obj.read(cr, uid, [result], ['res_id'],context=context)[0]['res_id'] + result = act_obj.read(cr, uid, [id], context=context)[0] + result['context'] = str({'fiscalyear': data['fiscalyear'], \ + 'state': data['target_move']}) + if data['fiscalyear']: + result['name'] += ':' + self.pool.get('account.fiscalyear').read(cr, uid, [data['fiscalyear']],context=context)[0]['code'] + return result _defaults = { - 'fiscalyear': _get_defaults, - 'target_move': lambda * a: 'all' + 'fiscalyear': _get_fiscalyear, + 'target_move': 'all' } account_chart() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_compare_account_balance_report.py b/addons/account/wizard/account_compare_account_balance_report.py old mode 100755 new mode 100644 index fd1d4d55ada2f65a8b7b95a9468ae5390b88ea27..af844854271c170501ea4051f083ed010e42abdb --- a/addons/account/wizard/account_compare_account_balance_report.py +++ b/addons/account/wizard/account_compare_account_balance_report.py @@ -74,12 +74,14 @@ class account_compare_account_balance_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance.landscape', 'datas': data, + 'nodestroy':True, } else: return { 'type': 'ir.actions.report.xml', 'report_name': 'account.balance.account.balance', 'datas': data, + 'nodestroy':True, } if data['form']['format_perc']==1: if len(data['form']['fiscalyear'])<=2: @@ -88,12 +90,14 @@ class account_compare_account_balance_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance.landscape', 'datas': data, + 'nodestroy':True, } else: return { 'type': 'ir.actions.report.xml', 'report_name': 'account.balance.account.balance', 'datas': data, + 'nodestroy':True, } else: if len(data['form']['fiscalyear'])==3: @@ -102,6 +106,7 @@ class account_compare_account_balance_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance.landscape', 'datas': data, + 'nodestroy':True, } else: raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.')) @@ -114,6 +119,7 @@ class account_compare_account_balance_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance.landscape', 'datas': data, + 'nodestroy':True, } else: raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.')) @@ -123,14 +129,15 @@ class account_compare_account_balance_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance.landscape', 'datas': data, + 'nodestroy':True, } else: return { 'type': 'ir.actions.report.xml', 'report_name': 'account.balance.account.balance', 'datas': data, + 'nodestroy':True, } account_compare_account_balance_report() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_compare_account_balance_report_view.xml b/addons/account/wizard/account_compare_account_balance_report_view.xml index e153d11bfaa0af9ff52a7ce6b6ca5e30ad0be5a5..2467928a584d0cf8dd0ea34cdb0d0b5584fa1f3a 100644 --- a/addons/account/wizard/account_compare_account_balance_report_view.xml +++ b/addons/account/wizard/account_compare_account_balance_report_view.xml @@ -44,7 +44,7 @@ src_model="account.account" view_mode="form" target="new" - key2="client_action_multi" + key2="client_print_multi" id="action_view_account_compare_account_balance_report"/> </data> diff --git a/addons/account/wizard/account_fiscalyear_close_state.py b/addons/account/wizard/account_fiscalyear_close_state.py index eeb202a0c82c2da17f448a5a55c6ff99a330b49c..f42857eb13c28dc6b379c20179dcbc560df93f51 100644 --- a/addons/account/wizard/account_fiscalyear_close_state.py +++ b/addons/account/wizard/account_fiscalyear_close_state.py @@ -35,7 +35,7 @@ class account_fiscalyear_close_state(osv.osv_memory): 'sure': fields.boolean('Check this box', required=False) } - def data_save(self, cr, uid, ids, context={}): + def data_save(self, cr, uid, ids, context=None): """ This function close account fiscalyear @param cr: the current row, from the database cursor, diff --git a/addons/account/wizard/account_general_journal.py b/addons/account/wizard/account_general_journal.py index 56ad7375acf78d311e676d0c0f5c941eabf9ef80..8bd2913ae628d5aa4e224e3fc4300ab76cf3b894 100644 --- a/addons/account/wizard/account_general_journal.py +++ b/addons/account/wizard/account_general_journal.py @@ -18,7 +18,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - from osv import osv, fields from tools.translate import _ @@ -31,7 +30,7 @@ class account_general_journal(osv.osv_memory): 'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True), } - def check_data(self, cr, uid, ids, context={}): + def check_data(self, cr, uid, ids, context=None): obj_jperiod = self.pool.get('account.journal.period') datas = {} datas['ids'] = [] @@ -53,8 +52,8 @@ class account_general_journal(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.general.journal', 'datas': datas, + 'nodestroy':True, } account_general_journal() - -#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_general_ledger_report.py b/addons/account/wizard/account_general_ledger_report.py index 6292709e29dd86aa4eab4eba5c199a813ea87dbc..9809f4aad893b35134f12478ba349682b42396a8 100644 --- a/addons/account/wizard/account_general_ledger_report.py +++ b/addons/account/wizard/account_general_ledger_report.py @@ -50,7 +50,7 @@ class account_general_ledger_report(osv.osv_memory): 'date_to': fields.date("End date", required=True) } - def _get_company(self, cr, uid, ids, context=None): + def _get_company(self, cr, uid, context=None): user_obj = self.pool.get('res.users') company_obj = self.pool.get('res.company') if context is None: @@ -63,8 +63,8 @@ class account_general_ledger_report(osv.osv_memory): _defaults = { 'state' : 'none', - 'date_from' : lambda *a: time.strftime('%Y-01-01'), - 'date_to' : lambda *a: time.strftime('%Y-%m-%d'), + 'date_from' : time.strftime('%Y-01-01'), + 'date_to' : time.strftime('%Y-%m-%d'), 'company_id' : _get_company, 'display_account' : 'bal_all', 'sortbydate' : 'sort_date', @@ -107,12 +107,14 @@ class account_general_ledger_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger_landscape', 'datas': data, + 'nodestroy':True, } else: return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger', 'datas': data, + 'nodestroy':True, } else: raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) @@ -139,12 +141,14 @@ class account_general_ledger_report(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger_landscape', 'datas': data, + 'nodestroy':True, } else: return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger', 'datas': data, + 'nodestroy':True, } account_general_ledger_report() diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 1942fd56e60b3ae75ad2723faefb6de2b2b1ef94..f7e9d79b27adfebbd1b7b485b94b970a5dd0dddc 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -34,7 +34,7 @@ class account_invoice_refund(osv.osv_memory): 'description': fields.char('Description', size=150, required=True), } - def compute_refund(self, cr, uid, ids, mode, context={}): + def compute_refund(self, cr, uid, ids, mode, context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @@ -46,7 +46,11 @@ class account_invoice_refund(osv.osv_memory): account_m_line_obj = self.pool.get('account.move.line') mod_obj = self.pool.get('ir.model.data') act_obj = self.pool.get('ir.actions.act_window') - for form in self.read(cr, uid, ids,context=context): + + if context is None: + context = {} + + for form in self.read(cr, uid, ids, context=context): created_inv = [] date = False period = False @@ -171,7 +175,6 @@ class account_invoice_refund(osv.osv_memory): id = mod_obj.read(cr, uid, result, ['res_id'],context=context)['res_id'] result = act_obj.read(cr, uid, id,context=context) result['res_id'] = created_inv - return result def invoice_refund(self, cr, uid, ids, context={}): diff --git a/addons/account/wizard/account_invoice_state.py b/addons/account/wizard/account_invoice_state.py index 6b1a41f49af9de3cfed35d7f2ed0992efee241fb..c3934e38db064668a6586f7742fce26a7ebeab6d 100644 --- a/addons/account/wizard/account_invoice_state.py +++ b/addons/account/wizard/account_invoice_state.py @@ -21,6 +21,7 @@ from osv import fields, osv from tools.translate import _ import netsvc +import pooler class account_invoice_confirm(osv.osv_memory): """ @@ -34,7 +35,12 @@ class account_invoice_confirm(osv.osv_memory): wf_service = netsvc.LocalService('workflow') if context is None: context = {} - for id in context['active_ids']: + pool_obj = pooler.get_pool(cr.dbname) + data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context) + + for record in data_inv: + if record['state'] not in ('draft','proforma','proforma2'): + raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be confirmed as they are not in 'Draft' or 'Pro-Forma' state!")) wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr) return {} @@ -47,14 +53,19 @@ class account_invoice_cancel(osv.osv_memory): """ _name = "account.invoice.cancel" - _description = "Cancel the selected invoices" + _description = "Cancel the Selected Invoices" def invoice_cancel(self, cr, uid, ids, context=None): - wf_service = netsvc.LocalService('workflow') if context is None: context = {} - for id in context['active_ids']: - wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr) + wf_service = netsvc.LocalService('workflow') + pool_obj = pooler.get_pool(cr.dbname) + data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context) + + for record in data_inv: + if record['state'] in ('cancel','paid'): + raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be cancelled as they are already in 'Cancelled' or 'Done' state!")) + wf_service.trg_validate(uid, 'account.invoice', record['id'], 'invoice_cancel', cr) return {} account_invoice_cancel() diff --git a/addons/account/wizard/account_invoice_state_view.xml b/addons/account/wizard/account_invoice_state_view.xml index 8748edbb688bf0a778605d3ec5be0134d1543b46..d83c0c6f2dca1cfd5b4beb09991a83d68943a999 100644 --- a/addons/account/wizard/account_invoice_state_view.xml +++ b/addons/account/wizard/account_invoice_state_view.xml @@ -6,10 +6,10 @@ <field name="model">account.invoice.confirm</field> <field name="type">form</field> <field name="arch" type="xml"> - <form string="Confirm draft invoices"> - <separator string="Confirm draft invoices" colspan="4"/> + <form string="Confirm Draft Invoices"> + <separator string="Confirm Draft Invoices" colspan="4"/> <group colspan="4" col="6"> - <button icon="gtk-cancel" special="cancel" string="Cancel"/> + <button icon="gtk-cancel" special="cancel" string="Close"/> <button icon="gtk-execute" string="Confirm Invoices" name="invoice_confirm" type="object" default_focus="1"/> </group> </form> @@ -17,7 +17,7 @@ </record> <record id="action_account_invoice_confirm" model="ir.actions.act_window"> - <field name="name">Confirm draft invoices</field> + <field name="name">Confirm Draft Invoices</field> <field name="res_model">account.invoice.confirm</field> <field name="view_type">form</field> <field name="view_mode">form</field> @@ -28,7 +28,7 @@ <record model="ir.values" id="action_account_invoice_confirm_values"> <field name="model_id" ref="account.model_account_invoice" /> <field name="object" eval="1" /> - <field name="name">Confirm draft invoices</field> + <field name="name">Confirm Draft Invoices</field> <field name="key2">client_action_multi</field> <field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_invoice_confirm'))" /> <field name="key">action</field> @@ -40,18 +40,18 @@ <field name="model">account.invoice.cancel</field> <field name="type">form</field> <field name="arch" type="xml"> - <form string="Cancel selected invoices"> - <separator string="Cancel selected invoices" colspan="4"/> + <form string="Cancel Selected Invoices"> + <separator string="Cancel Selected Invoices" colspan="4"/> <group colspan="4" col="6"> - <button icon="gtk-cancel" special="cancel" string="Cancel"/> - <button icon="gtk-execute" string="Cancel selected invoices" name="invoice_cancel" type="object" default_focus="1"/> + <button icon="gtk-cancel" special="cancel" string="Close"/> + <button icon="gtk-execute" string="Cancel Invoices" name="invoice_cancel" type="object" default_focus="1"/> </group> </form> </field> </record> <record id="action_account_invoice_cancel" model="ir.actions.act_window"> - <field name="name">Cancel selected invoices</field> + <field name="name">Cancel Selected Invoices</field> <field name="res_model">account.invoice.cancel</field> <field name="view_type">form</field> <field name="view_mode">form</field> @@ -62,7 +62,7 @@ <record model="ir.values" id="action_account_invoice_cancel_values"> <field name="model_id" ref="account.model_account_invoice" /> <field name="object" eval="1" /> - <field name="name">Cancel selected invoices</field> + <field name="name">Cancel Selected Invoices</field> <field name="key2">client_action_multi</field> <field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_invoice_cancel'))" /> <field name="key">action</field> diff --git a/addons/account/wizard/account_move_bank_reconcile.py b/addons/account/wizard/account_move_bank_reconcile.py index e2329bf09d9949c4fdb6707ac9f1f1bbad9f8250..c339ed18831de1260807357e39cb1b49b0c4464c 100644 --- a/addons/account/wizard/account_move_bank_reconcile.py +++ b/addons/account/wizard/account_move_bank_reconcile.py @@ -34,29 +34,29 @@ class account_move_bank_reconcile(osv.osv_memory): } def action_open_window(self, cr, uid, ids, context={}): - """ - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: account move bank reconcile’s ID or list of IDs - @return: dictionary of Open account move line on given journal_id. - """ - for data in self.read(cr, uid, ids,context=context): - cr.execute('select default_credit_account_id \ - from account_journal where id=%s', (data['journal_id'],)) - account_id = cr.fetchone()[0] - if not account_id: - raise osv.except_osv(_('Error'), _('You have to define \ + """ + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: account move bank reconcile’s ID or list of IDs + @return: dictionary of Open account move line on given journal_id. + """ + data = self.read(cr, uid, ids,context=context)[0] + cr.execute('select default_credit_account_id \ + from account_journal where id=%s', (data['journal_id'],)) + account_id = cr.fetchone()[0] + if not account_id: + raise osv.except_osv(_('Error'), _('You have to define \ the bank account\nin the journal definition for reconciliation.')) - return { - 'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data['journal_id'], account_id), - 'name': _('Standard Encoding'), - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'account.move.line', - 'view_id': False, - 'context': "{'journal_id': %d}" % (data['journal_id'],), - 'type': 'ir.actions.act_window' - } + return { + 'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data['journal_id'], account_id), + 'name': _('Standard Encoding'), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'account.move.line', + 'view_id': False, + 'context': "{'journal_id': %d}" % (data['journal_id'],), + 'type': 'ir.actions.act_window' + } account_move_bank_reconcile() diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index df6e41da56655aa0d242ee42d1fc1035e72a72a1..142ade01737e75e4935ccca7a4a0b391db63ec94 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -26,13 +26,11 @@ import tools class account_move_journal(osv.osv_memory): _name = "account.move.journal" _description = "Move journal" - _columns = { 'journal_id': fields.many2one('account.journal', 'Journal', required=True), 'period_id': fields.many2one('account.period', 'Period', required=True), } - def _get_period(self, cr, uid, context={}): """Return default account period value""" ids = self.pool.get('account.period').find(cr, uid, context=context) @@ -41,7 +39,11 @@ class account_move_journal(osv.osv_memory): period_id = ids[0] return period_id - def action_open_window(self, cr, uid, ids, context={}): + _defaults = { + 'period_id': _get_period + } + + def action_open_window(self, cr, uid, ids, context=None): """ This function Open action move line window on given period and Journal/Payment Mode @param cr: the current row, from the database cursor, @@ -52,46 +54,43 @@ class account_move_journal(osv.osv_memory): """ jp = self.pool.get('account.journal.period') mod_obj = self.pool.get('ir.model.data') - for data in self.read(cr, uid, ids, ['journal_id', 'period_id'],context=context): - cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form')) - view_res = cr.fetchone() - journal_id = data['journal_id'] - period_id = data['period_id'] - - ids = jp.search(cr, uid, [('journal_id', '=', journal_id), \ - ('period_id', '=', period_id)],context=context) - - if not len(ids): - name = self.pool.get('account.journal').read(cr, uid, [journal_id])[0]['name'] - state = self.pool.get('account.period').read(cr, uid, [period_id])[0]['state'] - if state == 'done': - raise osv.except_osv(_('UserError'), _('This period is already closed !')) - company = self.pool.get('account.period').read(cr, uid, [period_id])[0]['company_id'][0] - jp.create(cr, uid, {'name': name, 'period_id': period_id, 'journal_id': journal_id, 'company_id': company},context=context) - - ids = jp.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context) - jp = jp.browse(cr, uid, ids, context=context)[0] - name = (jp.journal_id.code or '') + ':' + (jp.period_id.code or '') - - result = mod_obj._get_id(cr, uid, 'account', 'view_account_move_line_filter') - res = mod_obj.read(cr, uid, result, ['res_id'],context=context) - - return { - 'domain': "[('journal_id','=',%d), ('period_id','=',%d)]" % (journal_id, period_id), - 'name': name, - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'account.move.line', - 'view_id': view_res, - 'context': "{'journal_id': %d, 'period_id': %d}" % (journal_id, period_id), - 'type': 'ir.actions.act_window', - 'search_view_id': res['res_id'] - } - - - _defaults = { - 'period_id': _get_period - } + if context is None: + context = {} + data = self.read(cr, uid, ids, ['journal_id', 'period_id'], context=context)[0] + cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form')) + view_res = cr.fetchone() + journal_id = data['journal_id'] + period_id = data['period_id'] + + ids = jp.search(cr, uid, [('journal_id', '=', journal_id), \ + ('period_id', '=', period_id)],context=context) + + if not len(ids): + name = self.pool.get('account.journal').read(cr, uid, [journal_id])[0]['name'] + state = self.pool.get('account.period').read(cr, uid, [period_id])[0]['state'] + if state == 'done': + raise osv.except_osv(_('UserError'), _('This period is already closed !')) + company = self.pool.get('account.period').read(cr, uid, [period_id])[0]['company_id'][0] + jp.create(cr, uid, {'name': name, 'period_id': period_id, 'journal_id': journal_id, 'company_id': company},context=context) + + ids = jp.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context) + jp = jp.browse(cr, uid, ids, context=context)[0] + name = (jp.journal_id.code or '') + ':' + (jp.period_id.code or '') + + result = mod_obj._get_id(cr, uid, 'account', 'view_account_move_line_filter') + res = mod_obj.read(cr, uid, result, ['res_id'],context=context) + + return { + 'domain': "[('journal_id','=',%d), ('period_id','=',%d)]" % (journal_id, period_id), + 'name': name, + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'account.move.line', + 'view_id': view_res, + 'context': "{'journal_id': %d, 'period_id': %d}" % (journal_id, period_id), + 'type': 'ir.actions.act_window', + 'search_view_id': res['res_id'] + } account_move_journal() diff --git a/addons/account/wizard/account_move_line_select.py b/addons/account/wizard/account_move_line_select.py index 474018e2fde6a5abe18d18433c4e7c8e89e1d808..8b3388f7f96144ba00bdef5d1760ccc0faf15302 100644 --- a/addons/account/wizard/account_move_line_select.py +++ b/addons/account/wizard/account_move_line_select.py @@ -71,5 +71,4 @@ class account_move_line_select(osv.osv_memory): account_move_line_select() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_move_line_unreconcile_select.py b/addons/account/wizard/account_move_line_unreconcile_select.py index 1c44e8548bddcab29dd0c8bbb74fb5c259df2203..35d442001c7754822807e988070ef5f5dfa0d04e 100644 --- a/addons/account/wizard/account_move_line_unreconcile_select.py +++ b/addons/account/wizard/account_move_line_unreconcile_select.py @@ -23,15 +23,12 @@ from osv import fields, osv from tools.translate import _ import tools - class account_move_line_unreconcile_select(osv.osv_memory): - _name = "account.move.line.unreconcile.select" _description = "Unreconciliation" _columns ={ 'account_id': fields.many2one('account.account','Account',required=True), } - def action_open_window(self, cr, uid, ids, context={}): data = self.read(cr, uid, ids, context=context)[0] return { @@ -46,6 +43,4 @@ class account_move_line_unreconcile_select(osv.osv_memory): account_move_line_unreconcile_select() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_open_closed_fiscalyear.py b/addons/account/wizard/account_open_closed_fiscalyear.py index b4f0f12b4b8f518e52c037c60bd9ffdf99733208..552e630125db7a47fe54b7e0109921910c7fff24 100644 --- a/addons/account/wizard/account_open_closed_fiscalyear.py +++ b/addons/account/wizard/account_open_closed_fiscalyear.py @@ -18,12 +18,10 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - from osv import fields, osv from tools.translate import _ class account_open_closed_fiscalyear(osv.osv_memory): - _name = "account.open.closed.fiscalyear" _description = "Choose Fiscal Year" _columns = { diff --git a/addons/account/wizard/account_partner_balance_report.py b/addons/account/wizard/account_partner_balance_report.py index b1b283feef60100ffdb5ccb263284515366f9912..0c330ed6d1e1279357234f0c2a20fe880bb9a342 100644 --- a/addons/account/wizard/account_partner_balance_report.py +++ b/addons/account/wizard/account_partner_balance_report.py @@ -18,7 +18,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - import time from tools.translate import _ @@ -48,7 +47,7 @@ class account_partner_balance(osv.osv_memory): 'date2': fields.date('End date', required=True), } - def _get_company(self, cr, uid, ids, context=None): + def _get_company(self, cr, uid, context=None): user_obj = self.pool.get('res.users') company_obj = self.pool.get('res.company') user = user_obj.browse(cr, uid, uid, context=context) @@ -58,13 +57,13 @@ class account_partner_balance(osv.osv_memory): return company_obj.search(cr, uid, [('parent_id', '=', False)])[0] _defaults={ - 'state' : 'none', - 'date1' : lambda *a: time.strftime('%Y-01-01'), - 'date2' : lambda *a: time.strftime('%Y-%m-%d'), - 'result_selection' : lambda *a: 'all', - 'soldeinit' : True, - 'company_id' : _get_company, - 'fiscalyear' : False, + 'state' : 'none', + 'date1' : time.strftime('%Y-01-01'), + 'date2' : time.strftime('%Y-%m-%d'), + 'result_selection' : 'all', + 'soldeinit' : True, + 'company_id' : _get_company, + 'fiscalyear' : False, } def check_state(self, cr, uid, ids, context=None): @@ -84,6 +83,7 @@ class account_partner_balance(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.partner.balance', 'datas': data, + 'nodestroy':True, } def _check_date(self, cr, uid, data, context): @@ -99,6 +99,7 @@ class account_partner_balance(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.partner.balance', 'datas': data, + 'nodestroy':True, } else: raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) diff --git a/addons/account/wizard/account_period_close.py b/addons/account/wizard/account_period_close.py index 6e71b079dc00980f3a02636f5fb4131821d0a6fe..f0f050e953c5230d77044efdc7209c3e042274c0 100644 --- a/addons/account/wizard/account_period_close.py +++ b/addons/account/wizard/account_period_close.py @@ -32,7 +32,7 @@ class account_period_close(osv.osv_memory): 'sure': fields.boolean('Check this box'), } - def data_save(self, cr, uid, ids, context={}): + def data_save(self, cr, uid, ids, context=None): """ This function close period @param cr: the current row, from the database cursor, @@ -41,7 +41,7 @@ class account_period_close(osv.osv_memory): """ mode = 'done' - for form in self.read(cr, uid, ids,context=context): + for form in self.read(cr, uid, ids, context=context): if form['sure']: for id in context['active_ids']: cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id)) diff --git a/addons/account/wizard/account_print_journal.py b/addons/account/wizard/account_print_journal.py index 89de9a643f9a8d77a73c6f081cb2d32c036fbd62..f40efe3eb995be1f8c58f35a76f54cdcdd854bb7 100644 --- a/addons/account/wizard/account_print_journal.py +++ b/addons/account/wizard/account_print_journal.py @@ -34,10 +34,10 @@ class account_print_journal(osv.osv_memory): } _defaults = { - 'sort_selection': lambda *a: 'date', - } + 'sort_selection': lambda *a: 'date', + } - def check_data(self, cr, uid, ids, context={}): + def check_data(self, cr, uid, ids, context=None): obj_jperiod = self.pool.get('account.journal.period') datas = {} datas['ids'] = [] @@ -59,8 +59,9 @@ class account_print_journal(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.journal.period.print', 'datas': datas, + 'nodestroy':True, } account_print_journal() -#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py new file mode 100644 index 0000000000000000000000000000000000000000..1f745419c5a307f5965a568266b8004ee59995b6 --- /dev/null +++ b/addons/account/wizard/account_reconcile.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time +import datetime + +from osv import fields, osv +from tools.translate import _ + +class account_move_line_reconcile_prompt(osv.osv_memory): + """ + Asks user he wants to reconcile entries or not. + """ + _name = 'account.move.line.reconcile.prompt' + _description = 'Account move line reconcile' + _columns = { + } + + def ask_reconcilation(self, cr, uid, ids, context): + return self.pool.get('account.move.line.reconcile').partial_check(cr, uid, ids, context) + +account_move_line_reconcile_prompt() + +class account_move_line_reconcile(osv.osv_memory): + """ + Account move line reconcile wizard, it checks for the write off the reconcile entry or directly reconcile. + """ + _name = 'account.move.line.reconcile' + _description = 'Account move line reconcile' + _columns = { + 'trans_nbr': fields.integer('# of Transaction', readonly=True), + 'credit': fields.float('Credit amount',readonly=True), + 'debit': fields.float('Debit amount',readonly=True), + 'writeoff': fields.float('Write-Off amount',readonly=True), + } + + def default_get(self, cr, uid, fields, context=None): + res = super(account_move_line_reconcile, self).default_get(cr, uid, fields, context=context) + data = self.trans_rec_get(cr, uid, context['active_ids'], context) + if 'trans_nbr' in fields: + res.update({'trans_nbr':data['trans_nbr']}) + if 'credit' in fields: + res.update({'trans_nbr':data['credit']}) + if 'debit' in fields: + res.update({'trans_nbr':data['debit']}) + if 'writeoff' in fields: + res.update({'trans_nbr':data['writeoff']}) + return res + + def partial_check(self, cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.model.data') + data = self.trans_rec_get(cr, uid, ids, context) + if context is None: + context = {} + if data['writeoff'] == 0: + model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_move_line_reconcile_full')], context=context) + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] + return { + 'name': _('Reconcile'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'account.move.line.reconcile', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } + else : + model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_move_line_reconcile_partial')], context=context) + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] + return { + 'name': _('Reconcile'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'account.move.line.reconcile', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } + + def trans_rec_get(self, cr, uid, ids, context=None): + account_move_line_obj = self.pool.get('account.move.line') + if context is None: + context = {} + credit = debit = 0 + account_id = False + count = 0 + for line in account_move_line_obj.browse(cr, uid, context['active_ids'], context=context): + if not line.reconcile_id and not line.reconcile_id.id: + count += 1 + credit += line.credit + debit += line.debit + account_id = line.account_id.id + return {'trans_nbr': count, 'account_id': account_id, 'credit': credit, 'debit': debit, 'writeoff': debit - credit} + + def trans_rec_addendum_writeoff(self, cr, uid, ids, context=None): + return self.pool.get('account.move.line.reconcile.writeoff').trans_rec_addendum(cr, uid, ids, context) + + def trans_rec_reconcile_partial_reconcile(self, cr, uid, ids, context=None): + return self.pool.get('account.move.line.reconcile.writeoff').trans_rec_reconcile_partial(cr, uid, ids, context) + + def trans_rec_reconcile_full(self, cr, uid, ids, context=None): + account_move_line_obj = self.pool.get('account.move.line') + date = False + period_id = False + journal_id= False + account_id = False + + if context is None: + context = {} + + data = self.read(cr, uid, ids, context=context) + date = time.strftime('%Y-%m-%d') + ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context) + if len(ids): + period_id = ids[0] + account_move_line_obj.reconcile(cr, uid, context['active_ids'], 'manual', account_id, + period_id, journal_id, context=context) + return {} + +account_move_line_reconcile() + +class account_move_line_reconcile_writeoff(osv.osv_memory): + """ + It opens the write off wizard form, in that user can define the journal, account, analytic account for reconcile + """ + _name = 'account.move.line.reconcile.writeoff' + _description = 'Account move line reconcile' + _columns = { + 'journal_id': fields.many2one('account.journal','Write-Off Journal', required=True), + 'writeoff_acc_id': fields.many2one('account.account','Write-Off account', required=True), + 'date_p': fields.date('Date'), + 'comment': fields.char('Comment', size= 64, required=True), + 'analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), + } + _defaults = { + 'date_p': time.strftime('%Y-%m-%d'), + 'comment': 'Write-off', + } + + def trans_rec_addendum(self, cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.model.data') + if context is None: + context = {} + model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','account_move_line_reconcile_writeoff')], context=context) + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] + return { + 'name': _('Reconcile Writeoff'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'account.move.line.reconcile.writeoff', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } + + def trans_rec_reconcile_partial(self, cr, uid, ids, context=None): + account_move_line_obj = self.pool.get('account.move.line') + if context is None: + context = {} + account_move_line_obj.reconcile_partial(cr, uid, context['active_ids'], 'manual', context=context) + return {} + + def trans_rec_reconcile(self, cr, uid, ids, context=None): + account_move_line_obj = self.pool.get('account.move.line') + if context is None: + context = {} + data = self.read(cr, uid, ids,context=context)[0] + account_id = data['writeoff_acc_id'] + context['date_p'] = data['date_p'] + journal_id = data['journal_id'] + context['comment'] = data['comment'] + if data['analytic_id']: + context['analytic_id'] = data['analytic_id'] + if context['date_p']: + date = context['date_p'] + + ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context) + if len(ids): + period_id = ids[0] + + account_move_line_obj.reconcile(cr, uid, context['active_ids'], 'manual', account_id, + period_id, journal_id, context=context) + return {} + +account_move_line_reconcile_writeoff() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_reconcile_view.xml b/addons/account/wizard/account_reconcile_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..0f92376e045e8e0a61051aa8032c2210c56001da --- /dev/null +++ b/addons/account/wizard/account_reconcile_view.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="view_account_move_line_reconcile_prompt" model="ir.ui.view"> + <field name="name">account.move.line.reconcile.prompt.form</field> + <field name="model">account.move.line.reconcile.prompt</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Reconciliation"> + <separator string="Are you sure you want to reconcile entries?" colspan="4"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + + <button icon="gtk-cancel" special="cancel" string="Cancel"/> + <button icon="gtk-ok" string="Ok" name="ask_reconcilation" type="object" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_view_account_move_line_reconcile_prompt" model="ir.actions.act_window"> + <field name="name">Reconcile Entries</field> + <field name="res_model">account.move.line.reconcile.prompt</field> + <field name="view_type">form</field> + <field name="view_mode">tree,form</field> + <field name="view_id" ref="view_account_move_line_reconcile_prompt"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="action_account_move_line_reconcile_prompt_values"> + <field name="model_id" ref="account.model_account_move_line" /> + <field name="object" eval="1" /> + <field name="name">Reconcile Entries</field> + <field name="key2">client_action_multi</field> + <field name="value" eval="'ir.actions.act_window,' +str(ref('action_view_account_move_line_reconcile_prompt'))" /> + <field name="key">action</field> + <field name="model">account.move.line</field> + </record> + + <record id="view_account_move_line_reconcile_full" model="ir.ui.view"> + <field name="name">account.move.line.reconcile.full.form</field> + <field name="model">account.move.line.reconcile</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Reconciliation"> + <separator string="Reconciliation transactions" colspan="4"/> + <field name="trans_nbr"/> + <newline/> + <field name="credit"/> + <field name="debit"/> + <separator string="Write-Off" colspan="4"/> + <field name="writeoff"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button icon="gtk-cancel" special="cancel" string="Cancel"/> + <button icon="gtk-ok" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="view_account_move_line_reconcile_partial" model="ir.ui.view"> + <field name="name">account.move.line.reconcile.partial.form</field> + <field name="model">account.move.line.reconcile</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Reconciliation"> + <separator string="Reconciliation transactions" colspan="4"/> + <field name="trans_nbr"/> + <newline/> + <field name="credit"/> + <field name="debit"/> + <separator string="Write-Off" colspan="4"/> + <field name="writeoff"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button icon="gtk-cancel" special="cancel" string="Cancel"/> + <button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" default_focus="1"/> + <button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object"/> + </group> + </form> + </field> + </record> + + <record id="account_move_line_reconcile_writeoff" model="ir.ui.view"> + <field name="name">account.move.line.reconcile.writeoff.form</field> + <field name="model">account.move.line.reconcile.writeoff</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Information addendum"> + <separator string="Write-Off Move" colspan="4"/> + <field name="journal_id"/> + <field name="writeoff_acc_id" domain="[('type', '<>', 'view')]"/> + <field name="date_p"/> + <field name="comment"/> + <separator string="Analytic" colspan="4"/> + <field name="analytic_id"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button icon="gtk-cancel" special="cancel" string="Cancel"/> + <button icon="gtk-ok" string="Reconcile" name="trans_rec_reconcile" type="object" default_focus="1"/> + </group> + </form> + </field> + </record> + </data> +</openerp> diff --git a/addons/account/wizard/account_third_party_ledger.py b/addons/account/wizard/account_third_party_ledger.py old mode 100755 new mode 100644 index a40c469a1845bfd25cc071d801184f899821dc23..7a6514e17c2806d96135c8e27d7c27aaff3d4a12 --- a/addons/account/wizard/account_third_party_ledger.py +++ b/addons/account/wizard/account_third_party_ledger.py @@ -49,7 +49,7 @@ class account_partner_ledger(osv.osv_memory): 'date2': fields.date('End date', required=True), } - def _get_company(self, cr, uid, ids, context=None): + def _get_company(self, cr, uid, context=None): user_obj = self.pool.get('res.users') company_obj = self.pool.get('res.company') if context is None: @@ -97,12 +97,14 @@ class account_partner_ledger(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.third_party_ledger', 'datas': data, + 'nodestroy':True, } else: return { 'type': 'ir.actions.report.xml', 'report_name': 'account.third_party_ledger_other', 'datas': data, + 'nodestroy':True, } def _check_date(self, cr, uid, data, context=None): @@ -120,6 +122,7 @@ class account_partner_ledger(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.third_party_ledger', 'datas': data, + 'nodestroy':True, } else: raise osv.except_osv(_('UserError'),_('Date not in a defined fiscal year')) diff --git a/addons/account/wizard/account_use_model_view.xml b/addons/account/wizard/account_use_model_view.xml index 877a83dbb009771ad43c5d39e47154056d84875e..fec632c2e594e678aa94b3e477263066a00884f0 100644 --- a/addons/account/wizard/account_use_model_view.xml +++ b/addons/account/wizard/account_use_model_view.xml @@ -12,7 +12,6 @@ <field name="model"/> </group> <group colspan="4" col="6"> - <label string ="" colspan="2"/> <button icon="gtk-cancel" special="cancel" string="Cancel"/> <button icon="gtk-execute" string="Create Entries" name="create_entries" type="object"/> </group> @@ -53,7 +52,7 @@ <label string = "Entry Lines Created." colspan="2"/> <newline/> <button icon="gtk-ok" special="cancel" string="Ok"/> - <button icon="gtk-execute" string="Open" name="open_moves" type="object"/> + <button icon="gtk-execute" string="Open" name="open_moves" type="object" default_focus='1'/> </group> </form> </field> @@ -69,7 +68,7 @@ <label string = "Are you sure you want to create entries?" colspan="2"/> <newline/> <button icon="gtk-ok" special="cancel" string="Cancel"/> - <button icon="gtk-execute" string="Ok" name="create_entries" type="object"/> + <button icon="gtk-execute" string="Ok" name="create_entries" type="object" default_focus='1'/> </group> </form> </field> diff --git a/addons/account/wizard/account_vat.py b/addons/account/wizard/account_vat.py old mode 100755 new mode 100644 index 7e641628daf1cbb3671fb5f4ae6a19b95f0324c5..15c5a55203a6d46b9e18a010a57319babe64f6bb --- a/addons/account/wizard/account_vat.py +++ b/addons/account/wizard/account_vat.py @@ -33,7 +33,7 @@ class account_vat_declaration(osv.osv_memory): 'periods': fields.many2many('account.period', 'vat_period_rel', 'vat_id', 'period_id', 'Periods', help="All periods if empty"), } - def _get_company(self, cr, uid, ids, context={}): + def _get_company(self, cr, uid, context={}): user_obj = self.pool.get('res.users') company_obj = self.pool.get('res.company') user = user_obj.browse(cr, uid, uid, context=context) @@ -43,7 +43,7 @@ class account_vat_declaration(osv.osv_memory): return company_obj.search(cr, uid, [('parent_id', '=', False)])[0] _defaults = { - 'based_on': lambda *a: 'invoices', + 'based_on': 'invoices', 'company_id': _get_company } @@ -57,6 +57,7 @@ class account_vat_declaration(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.vat.declaration', 'datas': datas, + 'nodestroy':True, } account_vat_declaration() diff --git a/addons/account/wizard/wizard_automatic_reconcile.py b/addons/account/wizard/wizard_automatic_reconcile.py deleted file mode 100644 index ac26b6c44febcf2967819fd4f469a8856135837f..0000000000000000000000000000000000000000 --- a/addons/account/wizard/wizard_automatic_reconcile.py +++ /dev/null @@ -1,322 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import netsvc -import pooler -import time -from tools.translate import _ - -#TODO: - -# a rajouter comme questions ds le wizard: -# - account_id (et mettre wizard ds le menu et pas sur client_action_multi) -# - journal -# - compte d'ajustement -# - montant max (0,03) - # <field name="max_amount"/> -# - libelle write-off -# - devise principale ou secondaire - # devise secondaire = amount_currency - # si devise: pas prendre ceux avec montant_devise = 0 - -# a demander à fabien: -# - checkbox (comme ds sage) "lettrage rapide des comptes soldés"? - -# pr creer ecriture: creer move.line avec period et journal dans le contexte -# faire methode sur period: get_current_period - -_reconcile_form = '''<?xml version="1.0"?> -<form string="Reconciliation"> - <separator string="Options" colspan="4"/> - <field name="account_ids" colspan="4" domain="[('reconcile','=',1)]" views="account.view_account_list"> - </field> - <field name="date1"/> - <field name="date2"/> - <field name="power"/> - <separator string="Write-Off Move" colspan="4"/> - <field name="max_amount"/> - <field name="writeoff_acc_id"/> - <field name="journal_id"/> - <field name="period_id"/> -</form>''' - -_reconcile_fields = { - 'account_ids': { - 'string': 'Account to reconcile', - 'type': 'many2many', - 'relation': 'account.account', - 'domain': [('reconcile','=',1)], - 'help': 'If no account is specified, the reconciliation will be made using every accounts that can be reconcilied', - }, - 'writeoff_acc_id': { - 'string': 'Account', - 'type': 'many2one', - 'relation': 'account.account', - 'required': True - }, - 'journal_id': { - 'string': 'Journal', - 'type': 'many2one', - 'relation': 'account.journal', - 'required': True - }, - 'period_id': { - 'string': 'Period', - 'type': 'many2one', - 'relation': 'account.period', - 'required': True - }, - 'max_amount': { - 'string': 'Maximum write-off amount', - 'type': 'float', - }, - #'currency': { - # 'string': 'Reconcile in', - # 'type': 'selection', - # 'selection': [('current','current currency'), ('secondary','secondary currency')], - # 'required': True - #}, - 'power': { - 'string': 'Power', - 'type': 'selection', - 'selection': [(p,str(p)) for p in range(2, 10)], - 'required': True - }, - 'date1': { - 'string': 'Start of period', - 'type': 'date', - 'required': True, - 'default': lambda *a: time.strftime('%Y-01-01') - }, - 'date2': { - 'string': 'End of period', - 'type': 'date', - 'required': True, - 'default': lambda *a: time.strftime('%Y-%m-%d') - }, -} - -_result_form = '''<?xml version="1.0"?> -<form string="Reconciliation result"> - <field name="reconciled"/> - <newline/> - <field name="unreconciled"/> -</form>''' - -_result_fields = { - 'reconciled': { - 'string': 'Reconciled transactions', - 'type': 'integer', - 'readonly': True - }, - 'unreconciled': { - 'string': 'Not reconciled transactions', - 'type': 'integer', - 'readonly': True - }, -} - -#TODO: cleanup and comment this code... For now, it is awfulllll -# (way too complex, and really slow)... -def do_reconcile(cr, uid, credits, debits, max_amount, power, writeoff_acc_id, period_id, journal_id, context={}): - # for one value of a credit, check all debits, and combination of them - # depending on the power. It starts with a power of one and goes up - # to the max power allowed - def check2(value, move_list, power): - def check(value, move_list, power): - for i in range(len(move_list)): - move = move_list[i] - if power == 1: - if abs(value - move[1]) <= max_amount + 0.00001: - return [move[0]] - else: - del move_list[i] - res = check(value - move[1], move_list, power-1) - move_list[i:i] = [move] - if res: - res.append(move[0]) - return res - return False - - for p in range(1, power+1): - res = check(value, move_list, p) - if res: - return res - return False - - # for a list of credit and debit and a given power, check if there - # are matching tuples of credit and debits, check all debits, and combination of them - # depending on the power. It starts with a power of one and goes up - # to the max power allowed - def check4(list1, list2, power): - def check3(value, list1, list2, list1power, power): - for i in range(len(list1)): - move = list1[i] - if list1power == 1: - res = check2(value + move[1], list2, power - 1) - if res: - return ([move[0]], res) - else: - del list1[i] - res = check3(value + move[1], list1, list2, list1power-1, power-1) - list1[i:i] = [move] - if res: - x, y = res - x.append(move[0]) - return (x, y) - return False - - for p in range(1, power): - res = check3(0, list1, list2, p, power) - if res: - return res - return False - - def check5(list1, list2, max_power): - for p in range(2, max_power+1): - res = check4(list1, list2, p) - if res: - return res - - ok = True - reconciled = 0 - move_line_obj = pooler.get_pool(cr.dbname).get('account.move.line') - while credits and debits and ok: - res = check5(credits, debits, power) - if res: - move_line_obj.reconcile(cr, uid, res[0] + res[1], 'auto', writeoff_acc_id, period_id, journal_id, context) - reconciled += len(res[0]) + len(res[1]) - credits = [(id, credit) for (id, credit) in credits if id not in res[0]] - debits = [(id, debit) for (id, debit) in debits if id not in res[1]] - else: - ok = False - return (reconciled, len(credits)+len(debits)) - -def _reconcile(self, cr, uid, data, context): - service = netsvc.LocalService("object_proxy") - move_line_obj = pooler.get_pool(cr.dbname).get('account.move.line') - form = data['form'] - max_amount = form.get('max_amount', 0.0) - power = form['power'] - reconciled = unreconciled = 0 - if not form['account_ids'][0][2]: - raise wizard.except_wizard(_('UserError'), _('You must select accounts to reconcile')) - for account_id in form['account_ids'][0][2]: - - # reconcile automatically all transactions from partners whose balance is 0 - cr.execute( - "SELECT partner_id " \ - "FROM account_move_line " \ - "WHERE account_id=%s " \ - "AND reconcile_id IS NULL " \ - "AND state <> 'draft' " \ - "GROUP BY partner_id " \ - "HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0", - (account_id, max_amount or 0.0)) - partner_ids = [id for (id,) in cr.fetchall()] - - for partner_id in partner_ids: - cr.execute( - "SELECT id " \ - "FROM account_move_line " \ - "WHERE account_id=%s " \ - "AND partner_id=%s " \ - "AND state <> 'draft' " \ - "AND reconcile_id IS NULL", - (account_id, partner_id)) - line_ids = [id for (id,) in cr.fetchall()] - - if len(line_ids): - move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context) - reconciled += len(line_ids) - - # get the list of partners who have more than one unreconciled transaction - cr.execute( - "SELECT partner_id " \ - "FROM account_move_line " \ - "WHERE account_id=%s " \ - "AND reconcile_id IS NULL " \ - "AND state <> 'draft' " \ - "AND partner_id IS NOT NULL " \ - "GROUP BY partner_id " \ - "HAVING count(*)>1", - (account_id,)) - partner_ids = [id for (id,) in cr.fetchall()] - #filter? - for partner_id in partner_ids: - # get the list of unreconciled 'debit transactions' for this partner - cr.execute( - "SELECT id, debit " \ - "FROM account_move_line " \ - "WHERE account_id=%s " \ - "AND partner_id=%s " \ - "AND reconcile_id IS NULL " \ - "AND state <> 'draft' " \ - "AND debit > 0", - (account_id, partner_id)) - debits = cr.fetchall() - - # get the list of unreconciled 'credit transactions' for this partner - cr.execute( - "SELECT id, credit " \ - "FROM account_move_line " \ - "WHERE account_id=%s " \ - "AND partner_id=%s " \ - "AND reconcile_id IS NULL " \ - "AND state <> 'draft' " \ - "AND credit > 0", - (account_id, partner_id)) - credits = cr.fetchall() - - (rec, unrec) = do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context) - reconciled += rec - unreconciled += unrec - - # add the number of transactions for partners who have only one - # unreconciled transactions to the unreconciled count - partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or '' - cr.execute( - "SELECT count(*) " \ - "FROM account_move_line " \ - "WHERE account_id=%s " \ - "AND reconcile_id IS NULL " \ - "AND state <> 'draft' " + partner_filter, - (account_id,)) - additional_unrec = cr.fetchone()[0] - return {'reconciled':reconciled, 'unreconciled':unreconciled+additional_unrec} - -class wiz_reconcile(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':_reconcile_form, 'fields':_reconcile_fields, 'state':[('end','Cancel', 'gtk-cancel'),('reconcile','Reconcile', 'gtk-ok')]} - }, - 'reconcile': { - 'actions': [_reconcile], - 'result': {'type':'form', 'arch':_result_form, 'fields':_result_fields, 'state':[('end','OK', 'gtk-cancel')]} - } - } -wiz_reconcile('account.automatic.reconcile') - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account/wizard/wizard_reconcile.py b/addons/account/wizard/wizard_reconcile.py deleted file mode 100644 index ba7cf7eaef068e9849805f3e491bc1cefaaa441a..0000000000000000000000000000000000000000 --- a/addons/account/wizard/wizard_reconcile.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import netsvc -import time -import osv -import pooler -from datetime import datetime -from tools.translate import _ - -_transaction_form = '''<?xml version="1.0"?> -<form string="Reconciliation"> - <separator string="Reconciliation transactions" colspan="4"/> - <field name="trans_nbr"/> - <newline/> - <field name="credit"/> - <field name="debit"/> - <separator string="Write-Off" colspan="4"/> - <field name="writeoff"/> -</form>''' - -_transaction_fields = { - 'trans_nbr': {'string':'# of Transaction', 'type':'integer', 'readonly':True}, - 'credit': {'string':'Credit amount', 'type':'float', 'readonly':True}, - 'debit': {'string':'Debit amount', 'type':'float', 'readonly':True}, - 'writeoff': {'string':'Write-Off amount', 'type':'float', 'readonly':True}, -} - -def _trans_rec_get(self, cr, uid, data, context=None): - pool = pooler.get_pool(cr.dbname) - account_move_line_obj = pool.get('account.move.line') - credit = debit = 0 - account_id = False - count = 0 - for line in account_move_line_obj.browse(cr, uid, data['ids'], context=context): - if not line.reconcile_id and not line.reconcile_id.id: - count += 1 - credit += line.credit - debit += line.debit - account_id = line.account_id.id - return {'trans_nbr': count, 'account_id': account_id, 'credit': credit, 'debit': debit, 'writeoff': debit - credit} - -def _trans_rec_reconcile_partial(self, cr, uid, data, context=None): - pool = pooler.get_pool(cr.dbname) - account_move_line_obj = pool.get('account.move.line') - account_move_line_obj.reconcile_partial(cr, uid, data['ids'], 'manual', context=context) - return {} - -def _trans_rec_reconcile(self, cr, uid, data, context=None): - pool = pooler.get_pool(cr.dbname) - account_move_line_obj = pool.get('account.move.line') - - form = data['form'] - account_id = form.get('writeoff_acc_id', False) - context['date_p'] = form.get('date_p', False) - date = False - if context['date_p']: - date = datetime.strptime(context['date_p'], '%Y-%m-%d') - ids = pool.get('account.period').find(cr, uid, dt=date, context=context) - period_id = False - if len(ids): - period_id = ids[0] - - journal_id = form.get('journal_id', False) - context['comment'] = form.get('comment', False) - context['analytic_id'] = form.get('analytic_id', False) - account_move_line_obj.reconcile(cr, uid, data['ids'], 'manual', account_id, - period_id, journal_id, context=context) - return {} - -def _partial_check(self, cr, uid, data, context): - if _trans_rec_get(self,cr,uid, data, context)['writeoff'] == 0: - return 'init_full' - return 'init_partial' - -_transaction_add_form = '''<?xml version="1.0"?> -<form string="Information addendum"> - <separator string="Write-Off Move" colspan="4"/> - <field name="journal_id"/> - <field name="writeoff_acc_id" domain="[('type', '<>', 'view')]"/> - <field name="date_p"/> - <field name="comment"/> - <separator string="Analytic" colspan="4"/> - <field name="analytic_id"/> -</form>''' - -_transaction_add_fields = { - 'journal_id': {'string': 'Write-Off Journal', 'type': 'many2one', 'relation':'account.journal', 'required':True}, - 'writeoff_acc_id': {'string':'Write-Off account', 'type':'many2one', 'relation':'account.account', 'required':True}, - 'date_p': {'string':'Date','type':'date'}, - 'comment': {'string':'Comment','type':'char', 'size': 64, 'required':True}, - 'analytic_id': {'string':'Analytic Account', 'type': 'many2one', 'relation':'account.analytic.account'}, -} - -def _trans_rec_addendum(self, cr, uid, data, context={}): - date_p = time.strftime('%Y-%m-%d') - return {'date_p':date_p, 'comment': _('Write-Off')} - - -class wiz_reconcile(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type': 'choice', 'next_state': _partial_check} - }, - 'init_full': { - 'actions': [_trans_rec_get], - 'result': {'type': 'form', 'arch':_transaction_form, 'fields':_transaction_fields, 'state':[('end','Cancel', 'gtk-cancel'),('reconcile','Reconcile', 'gtk-ok')]} - }, - 'init_partial': { - 'actions': [_trans_rec_get], - 'result': {'type': 'form', 'arch':_transaction_form, 'fields':_transaction_fields, 'state':[('end','Cancel', 'gtk-cancel'),('addendum','Reconcile With Write-Off', 'gtk-ok'),('partial','Partial Reconcile', 'gtk-ok')]} - }, - 'addendum': { - 'actions': [_trans_rec_addendum], - 'result': {'type': 'form', 'arch':_transaction_add_form, 'fields':_transaction_add_fields, 'state':[('end','Cancel', 'gtk-cancel'),('reconcile','Reconcile', 'gtk-ok')]} - }, - 'reconcile': { - 'actions': [_trans_rec_reconcile], - 'result': {'type': 'state', 'state':'end'} - }, - 'partial': { - 'actions': [_trans_rec_reconcile_partial], - 'result': {'type': 'state', 'state':'end'} - } - } -wiz_reconcile('account.move.line.reconcile') - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account_analytic_plans/__openerp__.py b/addons/account_analytic_plans/__openerp__.py index b3067358a624d2a1c7b495d2a19e15a50755ed1f..0f23bc379bed102764415b3f045ed94c6c386cd6 100644 --- a/addons/account_analytic_plans/__openerp__.py +++ b/addons/account_analytic_plans/__openerp__.py @@ -60,9 +60,10 @@ of distribution models. 'init_xml': [], 'update_xml': [ 'security/ir.model.access.csv', - 'model_wizard.xml', 'account_analytic_plans_view.xml', - 'account_analytic_plans_report.xml' + 'account_analytic_plans_report.xml', + 'wizard/analytic_plan_create_model_view.xml', + 'wizard/account_crossovered_analytic_view.xml' ], 'demo_xml': [], 'installable': True, diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index ea3dbdd0475f622b918bb555a57c1dfb71ea17cc..57acdb6dee53ce5c833ca05d0d4ea3b4d10fb88f 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -145,7 +145,7 @@ class account_analytic_plan_instance(osv.osv): return self.name_get(cr, uid, ids, context or {}) def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - wiz_id = self.pool.get('ir.actions.wizard').search(cr, uid, [("wiz_name","=","create.model")]) + wiz_id = self.pool.get('ir.actions.act_window').search(cr, uid, [("name","=","analytic.plan.create.model.action")]) res = super(account_analytic_plan_instance,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) if (res['type']=='form'): diff --git a/addons/account_analytic_plans/account_analytic_plans_report.xml b/addons/account_analytic_plans/account_analytic_plans_report.xml index 8bed6104b00ccb7eb57a2e3f2e8b99b80bc2d662..ee2bb1e2a87a1afa2f58a0bae305a6d8755c84c6 100644 --- a/addons/account_analytic_plans/account_analytic_plans_report.xml +++ b/addons/account_analytic_plans/account_analytic_plans_report.xml @@ -11,12 +11,12 @@ auto="False" menu="False"/> - <wizard + <!--<wizard id="account_analytic_account_inverted_balance_report" string="Crossovered Analytic" model="account.analytic.account" name="wizard.crossovered.analytic" - keyword="client_print_multi"/> + keyword="client_print_multi"/>--> </data> </openerp> diff --git a/addons/account_analytic_plans/i18n/it.po b/addons/account_analytic_plans/i18n/it.po index fc9266c93970e795d4106a5f7695863b9af9fe86..41882762d6fa330be8e49754f72bbccb47f5eb4b 100644 --- a/addons/account_analytic_plans/i18n/it.po +++ b/addons/account_analytic_plans/i18n/it.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-09-08 16:37+0000\n" -"Last-Translator: paola <pcaffaro@tiscali.it>\n" +"PO-Revision-Date: 2010-05-03 16:30+0000\n" +"Last-Translator: eLBati - albatos.com <lorenzo.battistini@albatos.com>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:48+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_analytic_plans @@ -38,12 +38,12 @@ msgstr "" #. module: account_analytic_plans #: field:account.analytic.plan.instance,account5_ids:0 msgid "Account5 Id" -msgstr "" +msgstr "Identificativo di Account5" #. module: account_analytic_plans #: wizard_field:wizard.crossovered.analytic,init,date2:0 msgid "End Date" -msgstr "" +msgstr "Data fine" #. module: account_analytic_plans #: field:account.analytic.plan.instance.line,rate:0 @@ -57,7 +57,7 @@ msgstr "Tasso (%)" #: model:ir.actions.act_window,name:account_analytic_plans.account_analytic_plan_form_action #: model:ir.ui.menu,name:account_analytic_plans.menu_account_analytic_plan_action msgid "Analytic Plan" -msgstr "Pianificazione analitica" +msgstr "Piano analitico" #. module: account_analytic_plans #: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_instance_line @@ -67,7 +67,7 @@ msgstr "" #. module: account_analytic_plans #: view:account.analytic.plan.instance.line:0 msgid "Analytic Distribution Lines" -msgstr "" +msgstr "Righe della distribuzione analitica" #. module: account_analytic_plans #: wizard_button:wizard.crossovered.analytic,init,print:0 @@ -77,17 +77,17 @@ msgstr "Stampa" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "To Date" -msgstr "" +msgstr "Alla data" #. module: account_analytic_plans #: field:account.analytic.plan.instance.line,plan_id:0 msgid "Plan Id" -msgstr "" +msgstr "Identificativo del piano" #. module: account_analytic_plans #: model:ir.actions.act_window,name:account_analytic_plans.account_analytic_plan_instance_action msgid "Analytic Distribution's Models" -msgstr "" +msgstr "Modelli di distribuzione analitica" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 @@ -97,27 +97,27 @@ msgstr "Nome conto" #. module: account_analytic_plans #: view:account.analytic.plan.instance.line:0 msgid "Analytic Distribution Line" -msgstr "" +msgstr "Riga distribuzione analitica" #. module: account_analytic_plans #: field:account.analytic.plan.instance,code:0 msgid "Distribution Code" -msgstr "" +msgstr "Codice di distribuzione" #. module: account_analytic_plans #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "" +msgstr "Nome del modello non valido nella definizione dell'azione." #. module: account_analytic_plans #: field:account.analytic.plan.line,name:0 msgid "Plan Name" -msgstr "" +msgstr "Nome del piano" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "Printing date" -msgstr "" +msgstr "Data di stampa" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 @@ -127,58 +127,58 @@ msgstr "Percentuale" #. module: account_analytic_plans #: wizard_field:wizard.crossovered.analytic,init,empty_line:0 msgid "Dont show empty lines" -msgstr "" +msgstr "Non mostrare le righe vuote" #. module: account_analytic_plans #: wizard_view:wizard.crossovered.analytic,init:0 msgid "Select Information" -msgstr "" +msgstr "Scegli l'informazione" #. module: account_analytic_plans #: field:account.analytic.plan.instance,account3_ids:0 msgid "Account3 Id" -msgstr "" +msgstr "Identificativo di Account3" #. module: account_analytic_plans #: field:account.analytic.plan.instance,journal_id:0 #: wizard_field:wizard.crossovered.analytic,init,journal_ids:0 msgid "Analytic Journal" -msgstr "" +msgstr "Libro Giornale analitico" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "100.00%" -msgstr "" +msgstr "100%" #. module: account_analytic_plans #: wizard_field:wizard.crossovered.analytic,init,ref:0 msgid "Analytic Account Ref." -msgstr "" +msgstr "Riferimento conto analitico" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "Analytic Account :" -msgstr "" +msgstr "Conto analitico :" #. module: account_analytic_plans #: view:account.analytic.plan.line:0 msgid "Analytic Plan Line" -msgstr "" +msgstr "Riga piano analitico" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "Analytic Account Reference:" -msgstr "" +msgstr "Riferimento conto analitico" #. module: account_analytic_plans #: model:ir.actions.wizard,name:account_analytic_plans.create_model msgid "Create Model" -msgstr "" +msgstr "Crea un modello" #. module: account_analytic_plans #: field:account.analytic.plan,default_instance_id:0 msgid "Default Entries" -msgstr "" +msgstr "Valori di default" #. module: account_analytic_plans #: view:account.analytic.plan:0 @@ -186,32 +186,32 @@ msgstr "" #: field:account.journal,plan_id:0 #: model:ir.model,name:account_analytic_plans.model_account_analytic_plan msgid "Analytic Plans" -msgstr "" +msgstr "Piani analitici" #. module: account_analytic_plans #: field:account.analytic.plan.line,min_required:0 msgid "Minimum Allowed (%)" -msgstr "" +msgstr "Minimo consentito (%)" #. module: account_analytic_plans #: field:account.analytic.plan.instance,account1_ids:0 msgid "Account1 Id" -msgstr "" +msgstr "Identificativo di Account1" #. module: account_analytic_plans #: field:account.analytic.plan.line,max_required:0 msgid "Maximum Allowed (%)" -msgstr "" +msgstr "Massimo consentito (%)" #. module: account_analytic_plans #: wizard_view:create.model,info:0 msgid "Distribution Model Saved" -msgstr "" +msgstr "Modello di distribuzione salvato" #. module: account_analytic_plans #: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_instance msgid "Analytic Plan Instance" -msgstr "" +msgstr "Istanza del piano analitico" #. module: account_analytic_plans #: constraint:ir.ui.view:0 @@ -221,7 +221,7 @@ msgstr "XML non valido per Visualizzazione Architettura!" #. module: account_analytic_plans #: model:ir.actions.act_window,name:account_analytic_plans.account_analytic_instance_model_open msgid "Distribution Models" -msgstr "" +msgstr "Modelli di distribuzione" #. module: account_analytic_plans #: model:ir.module.module,description:account_analytic_plans.module_meta_information @@ -261,13 +261,13 @@ msgstr "" #. module: account_analytic_plans #: model:ir.module.module,shortdesc:account_analytic_plans.module_meta_information msgid "Multiple-plans management in Analytic Accounting" -msgstr "" +msgstr "Gestione multi-piano in contabilità analitica" #. module: account_analytic_plans #: view:account.analytic.plan.line:0 #: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_line msgid "Analytic Plan Lines" -msgstr "" +msgstr "Righe del piano analitico" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 @@ -277,68 +277,70 @@ msgstr "" #. module: account_analytic_plans #: field:account.analytic.plan.instance,plan_id:0 msgid "Model's Plan" -msgstr "" +msgstr "Piano del modello" #. module: account_analytic_plans #: field:account.analytic.plan.instance,account2_ids:0 msgid "Account2 Id" -msgstr "" +msgstr "Identificativo di Account2" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "Amount" -msgstr "" +msgstr "Quantità " #. module: account_analytic_plans #: help:account.analytic.plan.line,root_analytic_id:0 msgid "Root account of this plan." -msgstr "" +msgstr "Conto base di questo piano" #. module: account_analytic_plans #: field:account.analytic.plan.instance,account6_ids:0 msgid "Account6 Id" -msgstr "" +msgstr "Identificativo di Account6" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "Quantity" -msgstr "" +msgstr "Quantità " #. module: account_analytic_plans #: field:account.analytic.plan.instance,account_ids:0 msgid "Account Id" -msgstr "" +msgstr "Identificativo del conto" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "Code" -msgstr "" +msgstr "Codice" #. module: account_analytic_plans #: wizard_button:create.model,info,end:0 msgid "OK" -msgstr "" +msgstr "OK" #. module: account_analytic_plans #: field:account.analytic.plan.line,root_analytic_id:0 msgid "Root Account" -msgstr "" +msgstr "Conto base" #. module: account_analytic_plans #: wizard_view:create.model,info:0 msgid "" "This distribution model has been saved. You will be able to reuse it later." msgstr "" +"Questo modello di distribuzione è stato salvato. Lo potrai usare di nuovo in " +"seguito." #. module: account_analytic_plans #: field:account.analytic.plan.line,sequence:0 msgid "Sequence" -msgstr "" +msgstr "Sequenza" #. module: account_analytic_plans #: field:account.analytic.plan.instance.line,analytic_account_id:0 msgid "Analytic Account" -msgstr "" +msgstr "Conto Analitico" #. module: account_analytic_plans #: field:account.analytic.default,analytics_id:0 @@ -347,22 +349,22 @@ msgstr "" #: field:account.invoice.line,analytics_id:0 #: field:account.move.line,analytics_id:0 msgid "Analytic Distribution" -msgstr "" +msgstr "Distribuzione analitica" #. module: account_analytic_plans #: model:ir.ui.menu,name:account_analytic_plans.menu_account_analytic_plan_instance_action msgid "Analytic Distribution's models" -msgstr "" +msgstr "Modelli della distribuzione analitica" #. module: account_analytic_plans #: wizard_button:wizard.crossovered.analytic,init,end:0 msgid "Cancel" -msgstr "" +msgstr "Annulla" #. module: account_analytic_plans #: wizard_field:wizard.crossovered.analytic,init,date1:0 msgid "Start Date" -msgstr "" +msgstr "Data di inizio" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 @@ -372,4 +374,4 @@ msgstr "" #. module: account_analytic_plans #: rml:account.analytic.account.crossovered.analytic:0 msgid "From Date" -msgstr "" +msgstr "Dalla data" diff --git a/addons/account_analytic_plans/model_wizard.xml b/addons/account_analytic_plans/model_wizard.xml deleted file mode 100644 index 9dc545b90a5a2d3e774985e0dddcb350b32b184e..0000000000000000000000000000000000000000 --- a/addons/account_analytic_plans/model_wizard.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0"?> -<openerp> - <data> - <wizard - string="Create Model" - model="account.analytic.plan.instance" - name="create.model" id="create_model" - menu="False"/> - </data> -</openerp> - diff --git a/addons/account_analytic_plans/wizard/__init__.py b/addons/account_analytic_plans/wizard/__init__.py index 4b47827094bce00491ccebba0c5632b80b6c2332..c91a0251b3351bdad044aabd7f379d0cbc9f25c8 100644 --- a/addons/account_analytic_plans/wizard/__init__.py +++ b/addons/account_analytic_plans/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,11 +15,11 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import create_model -import wizard_crossovered_analytic +import analytic_plan_create_model +import account_crossovered_analytic # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py new file mode 100644 index 0000000000000000000000000000000000000000..825ab26aaf991224e18f6b896c0308a6b32e6705 --- /dev/null +++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time + +from osv import osv, fields +from tools.translate import _ + +class account_crossovered_analytic(osv.osv_memory): + _name = 'account.crossovered.analytic' + _description = 'Print Crossovered Analytic' + _columns = { + 'date1': fields.date('Start Date', required=True), + 'date2': fields.date('End Date', required=True), + 'journal_ids': fields.many2many('account.analytic.journal', 'crossovered_journal_rel', 'crossover_id', 'journal_id', 'Analytic Journal'), + 'ref': fields.many2one('account.analytic.account', 'Analytic Account Reference', required=True), + 'empty_line': fields.boolean('Dont show empty lines'), + } + _defaults = { + 'date1': lambda *a: time.strftime('%Y-01-01'), + 'date2': lambda *a: time.strftime('%Y-%m-%d'), + } + + def print_report(self, cr, uid, ids, context=None): + cr.execute('select account_id from account_analytic_line') + res = cr.fetchall() + acc_ids = [x[0] for x in res] + + data = self.read(cr, uid, ids, [], context=context)[0] + + obj_acc = self.pool.get('account.analytic.account').browse(cr, uid, data['ref']) + name = obj_acc.name + + account_ids = self.pool.get('account.analytic.account').search(cr, uid, [('parent_id', 'child_of', [data['ref']])]) + + flag = True + for acc in account_ids: + if acc in acc_ids: + flag = False + break + if flag: + raise osv.except_osv(_('User Error'),_('There are no Analytic lines related to Account %s' % name)) + + datas = { + 'ids': [], + 'model': 'account.analytic.account', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.analytic.account.crossovered.analytic', + 'datas': datas, + 'nodestroy': True + } + +account_crossovered_analytic() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml b/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..8c860169f56423adbd89906eb0fa26fd9a5e738a --- /dev/null +++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="view_account_crossovered_analytic" model="ir.ui.view"> + <field name="name">account.crossovered.analytic.form</field> + <field name="model">account.crossovered.analytic</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Crossovered Analytic"> + <group col="4" colspan="6"> + <field name="date1"/> + <field name="date2"/> + <field name="ref" colspan="4"/> + <field name="journal_ids" colspan="4"/> + <field name="empty_line"/> + </group> + <separator colspan="4"/> + <group col="2" colspan="4"> + <button special="cancel" string="Cancel" icon='gtk-cancel'/> + <button name="print_report" string="Print" colspan="1" type="object" icon="gtk-print"/> + </group> + </form> + </field> + </record> + + <record id="action_account_crossovered_analytic" model="ir.actions.act_window"> + <field name="name">Crossovered Analytic</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.crossovered.analytic</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_crossovered_analytic_values"> + <field name="model_id" ref="analytic.model_account_analytic_account" /> + <field name="object" eval="1" /> + <field name="name">Crossovered Analytic</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_crossovered_analytic'))" /> + <field name="key">action</field> + <field name="model">account.analytic.account</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_analytic_plans/wizard/analytic_plan_create_model.py b/addons/account_analytic_plans/wizard/analytic_plan_create_model.py new file mode 100644 index 0000000000000000000000000000000000000000..aafaf986b516cb0a9811b0fcd740155951d803d9 --- /dev/null +++ b/addons/account_analytic_plans/wizard/analytic_plan_create_model.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +from osv import osv +from tools.translate import _ + +class analytic_plan_create_model(osv.osv_memory): + _name = 'analytic.plan.create.model' + _description = 'analytic.plan.create.model' + + def activate(self, cr, uid, ids, context=None): + plan_obj = self.pool.get('account.analytic.plan.instance') + mod_obj = self.pool.get('ir.model.data') + if 'active_id' in context and context['active_id']: + plan = plan_obj.browse(cr, uid, context['active_id'], context=context) + if (not plan.name) or (not plan.code): + raise osv.except_osv(_('Error'), _('Please put a name and a code before saving the model !')) + pids = self.pool.get('account.analytic.plan').search(cr, uid, [], context=context) + if (not pids): + raise osv.except_osv(_('Error'), _('No analytic plan defined !')) + plan_obj.write(cr, uid, [context['active_id']], {'plan_id':pids[0]}) + + model_data_ids = mod_obj.search(cr,uid,[('model', '=', 'ir.ui.view'),('name', '=', 'view_analytic_plan_create_model')], context=context) + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] + return { + 'name': _('Distribution Model Saved'), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'analytic.plan.create.model', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } + else: + return {} + +analytic_plan_create_model() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_analytic_plans/wizard/analytic_plan_create_model_view.xml b/addons/account_analytic_plans/wizard/analytic_plan_create_model_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..75ef07e00981b51e9ab15cf0a46cd4d7673acdac --- /dev/null +++ b/addons/account_analytic_plans/wizard/analytic_plan_create_model_view.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + <record id="view_analytic_plan_create_model_msg" model="ir.ui.view"> + <field name="name">analytic.plan.create.model.msg.form</field> + <field name="model">analytic.plan.create.model</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Distribution Model Saved"> + <group col="4" colspan="6"> + <label string="Save This Distribution as a Model"/> + <newline/> + </group> + <separator colspan="4"/> + <group col="2" colspan="4"> + <button special="cancel" string="Cancel" icon='gtk-ok' /> + <button string="Ok" icon='gtk-execute' type="object" name="activate" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="view_analytic_plan_create_model" model="ir.ui.view"> + <field name="name">analytic.plan.create.model.form</field> + <field name="model">analytic.plan.create.model</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Distribution Model Saved"> + <group col="4" colspan="6"> + <label string="This distribution model has been saved.You will be able to reuse it later."/> + <newline/> + </group> + <separator colspan="4"/> + <group col="2" colspan="4"> + <button special="cancel" string="Ok" icon='gtk-ok'/> + </group> + </form> + </field> + </record> + + + <record id="action_analytic_plan_create_model" model="ir.actions.act_window"> + <field name="name">analytic.plan.create.model.action</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">analytic.plan.create.model</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + <field name="view_id" ref="view_analytic_plan_create_model_msg"/> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_analytic_plans/wizard/create_model.py b/addons/account_analytic_plans/wizard/create_model.py deleted file mode 100644 index 4c6ecce38c3537db60c034c89f5f019bc0d93d90..0000000000000000000000000000000000000000 --- a/addons/account_analytic_plans/wizard/create_model.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import time -import netsvc -import pooler -from tools.translate import _ - -info = '''<?xml version="1.0"?> -<form string="Distribution Model Saved"> - <label string="This distribution model has been saved.\nYou will be able to reuse it later."/> -</form>''' - - -def activate(self, cr, uid, data, context): - plan_obj = pooler.get_pool(cr.dbname).get('account.analytic.plan.instance') - if data['id']: - plan = plan_obj.browse(cr, uid, data['id'], context) - if (not plan.name) or (not plan.code): - raise wizard.except_wizard(_('Error'), _('Please put a name and a code before saving the model !')) - pids = pooler.get_pool(cr.dbname).get('account.analytic.plan').search(cr, uid, [], context=context) - if (not pids): - raise wizard.except_wizard(_('Error'), _('No analytic plan defined !')) - plan_obj.write(cr,uid,[data['id']],{'plan_id':pids[0]}) - return 'info' - else: - return 'endit' - -def _do_nothing(self, cr, uid, data, context): - return 1 - -class create_model(wizard.interface): - - states = { - 'init': { - 'actions': [], - 'result': {'type':'choice','next_state':activate} - }, - 'info': { - 'actions': [], - 'result': {'type':'form', 'arch':info, 'fields':{}, 'state':[('end','OK')]} - }, - 'endit': { - 'actions': [], - 'result': {'type':'action','action':_do_nothing , 'state':'end'} #FIXME: check - }, - } -create_model('create.model') - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py b/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py deleted file mode 100644 index 64da1b73b1d557abe535f573ad5889dd89d253d7..0000000000000000000000000000000000000000 --- a/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import time -import datetime -import pooler -from tools.translate import _ - -form = """<?xml version="1.0"?> -<form string="Select Information"> - <field name="date1"/> - <field name="date2"/> - <field name="ref" colspan="4"/> - <field name="journal_ids" colspan="4"/> - <field name="empty_line"/> -</form>""" - -fields = { - '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')}, - 'journal_ids': {'string':'Analytic Journal', 'type':'many2many', 'relation':'account.analytic.journal'}, - 'ref' :{'string':'Analytic Account Reference', 'type':'many2one', 'relation':'account.analytic.account','required':True}, - 'empty_line': {'string':'Dont show empty lines', 'type':'boolean', 'default': lambda *a:False}, -} - -class wizard_crossovered_analytic(wizard.interface): - def _checklines(self, cr, uid, data, context): - cr.execute('select account_id from account_analytic_line') - res=cr.fetchall() - acc_ids=[x[0] for x in res] - - obj_acc = pooler.get_pool(cr.dbname).get('account.analytic.account').browse(cr,uid,data['form']['ref']) - name=obj_acc.name - - account_ids = pooler.get_pool(cr.dbname).get('account.analytic.account').search(cr, uid, [('parent_id', 'child_of', [data['form']['ref']])]) - - flag = True - for acc in account_ids: - if acc in acc_ids: - flag = False - break - - if flag: - raise wizard.except_wizard(_('User Error'),_('There are no Analytic lines related to Account %s' % name)) - return {} - - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('print','Print')]}, - }, - 'print': { - 'actions': [_checklines], - 'result': {'type':'print', 'report':'account.analytic.account.crossovered.analytic', 'state':'end'}, - }, - } - -wizard_crossovered_analytic('wizard.crossovered.analytic') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account_budget/__openerp__.py b/addons/account_budget/__openerp__.py index 7a5e9b74ce4f17dae9bca2df1b190e03e458a05d..36f0bc1aa4ba55ef7e3c237b647e78e202e42ed2 100644 --- a/addons/account_budget/__openerp__.py +++ b/addons/account_budget/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -51,9 +51,15 @@ Three reports are available: 'security/ir.model.access.csv', 'security/account_budget_security.xml', 'account_budget_wizard.xml', + 'wizard/account_budget_spread_view.xml', 'crossovered_budget_view.xml', 'crossovered_budget_report.xml', - 'crossovered_budget_workflow.xml' + 'crossovered_budget_workflow.xml', + 'wizard/account_budget_analytic_view.xml', + 'wizard/account_budget_report_view.xml', + 'wizard/account_budget_spread_view.xml', + 'wizard/account_budget_crossovered_summary_report_view.xml', + 'wizard/account_budget_crossovered_report_view.xml', ], 'demo_xml': ['crossovered_budget_demo.xml'], 'installable': True, diff --git a/addons/account_budget/account_budget_wizard.xml b/addons/account_budget/account_budget_wizard.xml index c45957da787b697b86ceebdb1d9aae3362724e33..e153200b6a5fb4c55e722a019cc553083309a658 100644 --- a/addons/account_budget/account_budget_wizard.xml +++ b/addons/account_budget/account_budget_wizard.xml @@ -1,9 +1,9 @@ <?xml version="1.0"?> <openerp> <data> - <wizard id="wizard_budget_spread" menu="False" model="account.budget.post" name="account.budget.spread" string="Spread amount"/> +<!-- <wizard id="wizard_budget_spread" menu="False" model="account.budget.post" name="account.budget.spread" string="Spread amount"/>--> - <wizard id="wizard_budget_report" keyword="client_print_multi" model="account.budget.post" name="account.budget.report" string="Budget"/> +<!-- <wizard id="wizard_budget_report" keyword="client_print_multi" model="account.budget.post" name="account.budget.report" string="Budget"/>--> </data> </openerp> diff --git a/addons/account_budget/crossovered_budget_report.xml b/addons/account_budget/crossovered_budget_report.xml index 98b0521e9287047717ce7015d6e84ca9519d4c0a..0e3fcad2fc7f6692531416023b57601c8f7bf46b 100644 --- a/addons/account_budget/crossovered_budget_report.xml +++ b/addons/account_budget/crossovered_budget_report.xml @@ -11,35 +11,35 @@ auto="False" menu="False" /> - <wizard - string="Print Budgets" - model="crossovered.budget" - name="wizard.crossovered.budget" - id="wizard_crossovered_budget_menu" - keyword="client_print_multi" /> +<!-- <wizard--> +<!-- string="Print Budgets"--> +<!-- model="crossovered.budget"--> +<!-- name="wizard.crossovered.budget"--> +<!-- id="wizard_crossovered_budget_menu"--> +<!-- keyword="client_print_multi" />--> - <wizard - string="Print Summary of Budgets" - model="crossovered.budget" - name="wizard.crossovered.budget.summary" - id="wizard_crossovered_budget_menu_1" - keyword="client_print_multi" /> +<!-- <wizard--> +<!-- string="Print Summary of Budgets"--> +<!-- model="crossovered.budget"--> +<!-- name="wizard.crossovered.budget.summary"--> +<!-- id="wizard_crossovered_budget_menu_1"--> +<!-- keyword="client_print_multi" />--> <!-- Reports on account.analytic.account --> - <wizard - id="account_analytic_account_budget_report" - string="Print Budgets" - model="account.analytic.account" - name="wizard.analytic.account.budget.report" - keyword="client_print_multi"/> - - <report id="account_analytic_account_budget" - string="Print Budgets" - model="account.analytic.account" - name="account.analytic.account.budget" - rml="account_budget/report/analytic_account_budget_report.rml" - auto="False" - menu="False"/> +<!-- <wizard--> +<!-- id="account_analytic_account_budget_report"--> +<!-- string="Print Budgets"--> +<!-- model="account.analytic.account"--> +<!-- name="wizard.analytic.account.budget.report"--> +<!-- keyword="client_print_multi"/>--> +<!----> +<!-- <report id="account_analytic_account_budget"--> +<!-- string="Print Budgets"--> +<!-- model="account.analytic.account"--> +<!-- name="account.analytic.account.budget"--> +<!-- rml="account_budget/report/analytic_account_budget_report.rml"--> +<!-- auto="False"--> +<!-- menu="False"/>--> <!-- moved from account module --> <report auto="False" diff --git a/addons/account_budget/crossovered_budget_view.xml b/addons/account_budget/crossovered_budget_view.xml index 56008013075e7f9a1aa58bbb1180f0f8b3384e15..00dec853486c9cedb9f09dd29e42fedff3370ced 100644 --- a/addons/account_budget/crossovered_budget_view.xml +++ b/addons/account_budget/crossovered_budget_view.xml @@ -76,7 +76,7 @@ <field name="account_ids" colspan="4" nolabel="1"/> </page> <page string="Dotations"> - <button string="Spread" name="%(wizard_budget_spread)d" type="action" icon="gtk-fullscreen"/> + <button string="Spread" name="%(action_account_budget_spread)d" type="action" icon="gtk-fullscreen"/> <field name="dotation_ids" colspan="4" nolabel="1"/> </page> diff --git a/addons/account_budget/security/account_budget_security.xml b/addons/account_budget/security/account_budget_security.xml index 3dc66ec4a069a069972b04fcdb7117277718ac6a..13ad6b3428977938fc15ee771cc8f232c02a3705 100644 --- a/addons/account_budget/security/account_budget_security.xml +++ b/addons/account_budget/security/account_budget_security.xml @@ -1,19 +1,10 @@ <?xml version="1.0" encoding="utf-8"?><openerp><data noupdate="0"> - <record id="budget_post_comp_rule_group" model="ir.rule.group"> - <field name="name">Budget post multi-company</field> + + <record id="budget_post_comp_rule" model="ir.rule"> + <field name="name">Budget post multi-company</field> <field name="model_id" ref="model_account_budget_post"/> <field eval="True" name="global"/> + <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record id="budget_post_comp_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.budget.post'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> - <field name="rule_group" ref="budget_post_comp_rule_group"/> - </record> - <record id="budget_post_comp_rule_false" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','account.budget.post'),('name','=','company_id')]"/> - <field name="operator">=</field> - <field name="operand">False</field> - <field name="rule_group" ref="budget_post_comp_rule_group"/> - </record> + </data></openerp> diff --git a/addons/account_budget/wizard/__init__.py b/addons/account_budget/wizard/__init__.py index e174db2695c432c91f731f72d659243d2f4d769e..56faa0af5245ce23ea84cba60493323795048906 100644 --- a/addons/account_budget/wizard/__init__.py +++ b/addons/account_budget/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,15 +15,15 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import wizard_crossovered_budget_report -import wizard_analytic_account_budget -import wizard_crossovered_budget_summary_report +import account_budget_crossovered_report +import account_budget_analytic +import account_budget_crossovered_summary_report -import wizard_budget_spread -import wizard_budget_report +import account_budget_spread +import account_budget_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/wizard_account_analytic_cost_ledger_report.py b/addons/account_budget/wizard/account_budget_analytic.py similarity index 51% rename from addons/account/project/wizard/wizard_account_analytic_cost_ledger_report.py rename to addons/account_budget/wizard/account_budget_analytic.py index 2469f7f5c0c6693c312805afa23cd0af413ac486..62553520cbd218a1bb12fd0a349776b9a2680d3b 100644 --- a/addons/account/project/wizard/wizard_account_analytic_cost_ledger_report.py +++ b/addons/account_budget/wizard/account_budget_analytic.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,38 +15,43 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - import time -import wizard -dates_form = '''<?xml version="1.0"?> -<form string="Select period"> - <field name="date1"/> - <field name="date2"/> -</form>''' +from osv import fields, osv -dates_fields = { - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -} +class account_budget_analytic(osv.osv_memory): -class wizard_report(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('report','Print')]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'account.analytic.account.cost_ledger', 'state':'end'} + _name = 'account.budget.analytic' + _description = 'Account Budget report for analytic account' + _columns = { + 'date_from': fields.date('Start of period', required=True), + 'date_to': fields.date('End of period', required=True), + } + _defaults= { + 'date_from': time.strftime('%Y-01-01'), + 'date_to': time.strftime('%Y-%m-%d'), } - } -wizard_report('account.analytic.account.cost_ledger.report') - + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.analytic.account', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.analytic.account.budget', + 'datas': datas, + } + +account_budget_analytic() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_budget/wizard/account_budget_analytic_view.xml b/addons/account_budget/wizard/account_budget_analytic_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..fd6886040a03b017f9565517adda96a5b6a447ba --- /dev/null +++ b/addons/account_budget/wizard/account_budget_analytic_view.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_budget_analytic_view" model="ir.ui.view"> + <field name="name">account.budget.analytic.form</field> + <field name="model">account.budget.analytic</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Dates Period"> + <field name="date_from"/> + <field name="date_to"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_account_budget_analytic" model="ir.actions.act_window"> + <field name="name">Print Budgets</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.budget.analytic</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_budget_analytic_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_budget_analytic_values"> + <field name="model_id" ref="analytic.model_account_analytic_account" /> + <field name="object" eval="1" /> + <field name="name">Print Budgets</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_analytic'))" /> + <field name="key">action</field> + <field name="model">account.analytic.account</field> + </record> + + </data> +</openerp> diff --git a/addons/account_budget/wizard/wizard_crossovered_budget_report.py b/addons/account_budget/wizard/account_budget_crossovered_report.py similarity index 51% rename from addons/account_budget/wizard/wizard_crossovered_budget_report.py rename to addons/account_budget/wizard/account_budget_crossovered_report.py index a13579741260b3ab536a3e679a40c8b24502d557..9a700e90ebbe11b91982c1c83dbc9f21025b1ebb 100644 --- a/addons/account_budget/wizard/wizard_crossovered_budget_report.py +++ b/addons/account_budget/wizard/account_budget_crossovered_report.py @@ -18,38 +18,41 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - import time -import wizard - -dates_form = '''<?xml version="1.0"?> -<form string="Select Options"> - <field name="date_from"/> - <field name="date_to"/> -</form>''' -dates_fields = { - 'date_from': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date_to': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, +from osv import fields, osv -} +class account_budget_crossvered_report(osv.osv_memory): -class wizard_report(wizard.interface): + _name = 'account.budget.crossvered.report' + _description = 'Account Budget crossvered report' + _columns = { + 'date_from': fields.date('Start of period', required=True), + 'date_to': fields.date('End of period', required=True), + } + _defaults= { + 'date_from': time.strftime('%Y-01-01'), + 'date_to': time.strftime('%Y-%m-%d'), + } - def _default(self, cr, uid, data, context): - data['form']['report']='analytic-full' - return data['form'] + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'crossovered.budge', + 'form': data + } + datas['form']['report']='analytic-full' + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'crossovered.budget.report', + 'datas': datas, + } + +account_budget_crossvered_report() - states = { - 'init': { - 'actions': [_default], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('report','Print', 'gtk-print', True)]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'crossovered.budget.report', 'state':'end'} - } - } -wizard_report('wizard.crossovered.budget') # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_budget/wizard/account_budget_crossovered_report_view.xml b/addons/account_budget/wizard/account_budget_crossovered_report_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..494c9af31ab3d383769127609cca9db2e84c4e49 --- /dev/null +++ b/addons/account_budget/wizard/account_budget_crossovered_report_view.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_budget_crossvered_report_view" model="ir.ui.view"> + <field name="name">account.budget.crossvered.report.form</field> + <field name="model">account.budget.crossvered.report</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Dates Period"> + <field name="date_from"/> + <field name="date_to"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_account_budget_crossvered_report" model="ir.actions.act_window"> + <field name="name">Print Budgets</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.budget.crossvered.report</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_budget_crossvered_report_view"/> + <field name="target">new</field> + </record> + <record model="ir.values" id="account_budget_crossvered_report_values"> + <field name="model_id" ref="account_budget.model_crossovered_budget" /> + <field name="object" eval="1" /> + <field name="name">Print Budgets</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_crossvered_report'))" /> + <field name="key">action</field> + <field name="model">crossovered.budget</field> + </record> + </data> +</openerp> diff --git a/addons/account_budget/wizard/account_budget_crossovered_summary_report.py b/addons/account_budget/wizard/account_budget_crossovered_summary_report.py new file mode 100644 index 0000000000000000000000000000000000000000..9581546ca1002d05292d246b3af01f1a052ba02d --- /dev/null +++ b/addons/account_budget/wizard/account_budget_crossovered_summary_report.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time + +from osv import fields, osv + +class account_budget_crossvered_summary_report(osv.osv_memory): + """ + This wizard provides the crossovered budget summary report' + """ + _name = 'account.budget.crossvered.summary.report' + _description = 'Account Budget crossvered summary report' + _columns = { + 'date_from': fields.date('Start of period', required=True), + 'date_to': fields.date('End of period', required=True), + } + _defaults= { + 'date_from': time.strftime('%Y-01-01'), + 'date_to': time.strftime('%Y-%m-%d'), + } + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'crossovered.budge', + 'form': data + } + datas['form']['report']='analytic-one' + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'crossovered.budget.report', + 'datas': datas, + } + return {} + +account_budget_crossvered_summary_report() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_budget/wizard/account_budget_crossovered_summary_report_view.xml b/addons/account_budget/wizard/account_budget_crossovered_summary_report_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb6c162fd570ca92483e4a659d4199d61a6231e9 --- /dev/null +++ b/addons/account_budget/wizard/account_budget_crossovered_summary_report_view.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_budget_crossvered_summary_report_view" model="ir.ui.view"> + <field name="name">account.budget.crossvered.summary.report.form</field> + <field name="model">account.budget.crossvered.summary.report</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Dates Period"> + <field name="date_from"/> + <field name="date_to"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_account_budget_crossvered_summary_report" model="ir.actions.act_window"> + <field name="name">Print Summary of Budgets</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.budget.crossvered.summary.report</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_budget_crossvered_summary_report_view"/> + <field name="target">new</field> + </record> + <record model="ir.values" id="account_budget_crossvered_summary_report_values"> + <field name="model_id" ref="account_budget.model_crossovered_budget" /> + <field name="object" eval="1" /> + <field name="name">Print Summary of Budgets</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_crossvered_summary_report'))" /> + <field name="key">action</field> + <field name="model">crossovered.budget</field> + </record> + </data> +</openerp> diff --git a/addons/account_budget/wizard/account_budget_report.py b/addons/account_budget/wizard/account_budget_report.py new file mode 100644 index 0000000000000000000000000000000000000000..8ebb0f7368b8123460e1ae5fda8f6725a8a5dfe3 --- /dev/null +++ b/addons/account_budget/wizard/account_budget_report.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time + +from osv import fields, osv +from tools.translate import _ + +class account_budget_report(osv.osv_memory): + + _name = 'account.budget.report' + _description = 'Account Budget report for analytic account' + _columns = { + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True), + } + _defaults= { + 'date1': time.strftime('%Y-01-01'), + 'date2': time.strftime('%Y-%m-%d'), + } + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.budget.post', + 'form': data + } + + data_model = self.pool.get(datas['model']).browse(cr,uid,context['active_id']) + if not data_model.dotation_ids: + raise osv.except_osv(_('Insufficient Data!'),_('No Depreciation or Master Budget Expenses Found on Budget %s!') % data_model.name) + + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.budget', + 'datas': datas, + } +account_budget_report() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_budget/wizard/account_budget_report_view.xml b/addons/account_budget/wizard/account_budget_report_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..3587a20dcbad176302552302ca4ff3118b48e5d4 --- /dev/null +++ b/addons/account_budget/wizard/account_budget_report_view.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_budget_report_view" model="ir.ui.view"> + <field name="name">account.budget.report.form</field> + <field name="model">account.budget.report</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Dates Period"> + <field name="date1"/> + <field name="date2"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_account_budget_report" model="ir.actions.act_window"> + <field name="name">Budgets</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.budget.report</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_budget_report_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_budget_report_values"> + <field name="model_id" ref="account_budget.model_account_budget_post" /> + <field name="object" eval="1" /> + <field name="name">Budgets</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_report'))" /> + <field name="key">action</field> + <field name="model">account.budget.post</field> + </record> + + </data> +</openerp> diff --git a/addons/account_budget/wizard/wizard_budget_spread.py b/addons/account_budget/wizard/account_budget_spread.py similarity index 57% rename from addons/account_budget/wizard/wizard_budget_spread.py rename to addons/account_budget/wizard/account_budget_spread.py index a4885df2324295b4fdeb7f6994575c3a1a0dff9e..ab2eb3d0bf64355e75b5bca502c245ade80db84d 100644 --- a/addons/account_budget/wizard/wizard_budget_spread.py +++ b/addons/account_budget/wizard/account_budget_spread.py @@ -18,40 +18,27 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - -import wizard import netsvc +from osv import fields, osv +import decimal_precision as dp -_spread_form = '''<?xml version="1.0"?> -<form string="Spread"> - <field name="fiscalyear"/> - <field name="amount"/> -</form>''' +class account_budget_spread(osv.osv_memory): -_spread_fields = { - 'fiscalyear': {'string':'Fiscal Year', 'type':'many2one', 'relation':'account.fiscalyear', 'required':True}, - 'amount': {'string':'Amount', 'type':'float', 'digits':(16,2)}, -} + _name = 'account.budget.spread' + _description = 'Account Budget spread ' + _columns = { + 'fiscalyear': fields.many2one('account.fiscalyear','Fiscal Year', required=True), + 'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')), + } -class wizard_budget_spread(wizard.interface): - def _spread(self, cr, uid, data, context): + def check_spread(self, cr, uid, ids, context=None): service = netsvc.LocalService("object_proxy") - form = data['form'] - res = service.execute(cr.dbname, uid, 'account.budget.post', 'spread', data['ids'], form['fiscalyear'], form['amount']) + if context is None: + context = {} + data = self.read(cr, uid, ids, [])[0] + res = service.execute(cr.dbname, uid, 'account.budget.post', 'spread', context['active_ids'], data['fiscalyear'], data['amount']) return {} - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':_spread_form, 'fields':_spread_fields, 'state':[('end','Cancel'),('spread','Spread','',True)]} - }, - 'spread': { - 'actions': [_spread], - 'result': {'type':'state', 'state':'end'} - } - } -wizard_budget_spread('account.budget.spread') - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +account_budget_spread() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_budget/wizard/account_budget_spread_view.xml b/addons/account_budget/wizard/account_budget_spread_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..10ac28566f7e77dd1466d6f89299ffc6ecd20a7e --- /dev/null +++ b/addons/account_budget/wizard/account_budget_spread_view.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_budget_spread_view" model="ir.ui.view"> + <field name="name">account.budget.spread.form</field> + <field name="model">account.budget.spread</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Dates Period"> + <field name="fiscalyear"/> + <field name="amount"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_spread" string="Ok" type="object" icon="gtk-ok" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_account_budget_spread" model="ir.actions.act_window"> + <field name="name">Spread</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.budget.spread</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_budget_spread_view"/> + <field name="target">new</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_budget/wizard/wizard_budget_report.py b/addons/account_budget/wizard/wizard_budget_report.py deleted file mode 100644 index 72f251445ba8216fc1933b31b16a84b14df422a1..0000000000000000000000000000000000000000 --- a/addons/account_budget/wizard/wizard_budget_report.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import time -import wizard -import datetime -import pooler -from tools.translate import _ - -dates_form = '''<?xml version="1.0"?> -<form string="Select period"> - <field name="date1"/> - <field name="date2"/> -</form>''' - -dates_fields = { - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -} - -class wizard_report(wizard.interface): - def _default(self, cr, uid, data, context): - pool_obj = pooler.get_pool(cr.dbname) - data_model = pool_obj.get(data['model']).browse(cr,uid,data['id']) - if not data_model.dotation_ids: - raise wizard.except_wizard(_('Insufficient Data!'),_('No Depreciation or Master Budget Expenses Found on Budget %s!') % data_model.name) - return data['form'] - - states = { - 'init': { - 'actions': [_default], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel', 'gtk-cancel'),('report','Print', 'gtk-print', True)]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'account.budget', 'state':'end'} - } - } -wizard_report('account.budget.report') - - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account_followup/__openerp__.py b/addons/account_followup/__openerp__.py index 652c94a49a8be1d0fd19527f89d9007201fd18dd..2fc950d9e0cfc53911315e4bd2b84bd2259f087f 100644 --- a/addons/account_followup/__openerp__.py +++ b/addons/account_followup/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -49,7 +49,7 @@ 'init_xml': [], 'update_xml': [ 'security/ir.model.access.csv', - 'wizard/wizard_view.xml', + 'wizard/account_followup_print_view.xml', 'followup_report_view.xml', 'followup_view.xml', 'followup_data.xml' diff --git a/addons/account_followup/report/report_followup_print.py b/addons/account_followup/report/report_followup_print.py index 28ec97f51facb609cd6ea1f702d18e66c81612a7..4f1df09c30248352057d7297a38b38c3147ae02c 100644 --- a/addons/account_followup/report/report_followup_print.py +++ b/addons/account_followup/report/report_followup_print.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -41,7 +41,7 @@ class report_rappel(report_sxw.rml_parse): pool = pooler.get_pool(self.cr.dbname) all_partners = [] for partner in partners_ids: - partners = pool.get('account_followup.stat').browse(self.cr, self.uid, partner[2]) + partners = pool.get('account_followup.stat').browse(self.cr, self.uid, [partner]) for par in partners: all_partners.append(par.name) return all_partners @@ -88,6 +88,7 @@ class report_rappel(report_sxw.rml_parse): 'company_name': fp_obj.browse(self.cr, self.uid, followup_id).company_id.name, 'user_signature': pooler.get_pool(self.cr.dbname).get('res.users').browse(self.cr, self.uid, self.uid, context).signature, } + return text diff --git a/addons/account_followup/wizard/__init__.py b/addons/account_followup/wizard/__init__.py index fd936d6faa78124e0b9a2d62699601ebce9ac8cd..aea714d2a865d9ff17ea3388cb77397266a8060b 100644 --- a/addons/account_followup/wizard/__init__.py +++ b/addons/account_followup/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,11 +15,10 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import wizard_followup_print - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +import account_followup_print +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/account_followup_print.py similarity index 53% rename from addons/account_followup/wizard/wizard_followup_print.py rename to addons/account_followup/wizard/account_followup_print.py index 2f82ec6ba609dfd083e547847dff58d5833403aa..1411157574836cea48db60de52a9d89805436d21 100644 --- a/addons/account_followup/wizard/wizard_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -18,140 +18,175 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - -import wizard import datetime -import pooler import time import tools from osv import fields, osv from tools.translate import _ -_email_summary_form = """<?xml version="1.0"?> -<form string="Summary"> - <field name="summary" height="300" width="800"/> -</form>""" +class account_followup_print(osv.osv_memory): + _name = 'account.followup.print' + _description = 'Print Followup & Send Mail to Customers' + _columns = { + 'date': fields.date('Follow-up Sending Date', required=True, help="This field allow you to select a forecast date to plan your follow-ups"), + 'followup_id': fields.many2one('account_followup.followup', 'Follow-up', required=True) + } -_email_summary_fields = { - 'summary': {'string': 'Summary', 'type': 'text', 'required': False, 'readonly': True}, -} + def _get_followup(self, cr, uid, context=None): + company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id + tmp = self.pool.get('account_followup.followup').search(cr, uid, [('company_id', '=', company_id)]) + return tmp and tmp[0] or False -_followup_wizard_screen1_form = """<?xml version="1.0"?> -<form string="Follow-up and Date Selection"> - <field name="followup_id"/> - <field name="date"/> -</form>""" + def do_continue(self, cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.model.data') + data = self.read(cr, uid, ids, [])[0] + model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all')], context=context) + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] + context.update({'followup_id': data['followup_id'], 'date':data['date']}) + return { + 'name': _('Select partners'), + 'view_type': 'form', + 'context': context, + 'view_mode': 'tree,form', + 'res_model': 'account.followup.print.all', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } -_followup_wizard_screen1_fields = { - 'date': {'string': 'Follow-up Sending Date', 'type': 'date', 'required': True, 'help':"This field allow you to select a forecast date to plan your follow-ups"}, - 'followup_id': {'string': 'Follow-up', 'type':'many2one', 'relation':'account_followup.followup', 'required': True,}, -} + _defaults = { + 'date': time.strftime('%Y-%m-%d'), + 'followup_id': _get_followup, + } +account_followup_print() +class account_followup_print_all(osv.osv_memory): + _name = 'account.followup.print.all' + _description = 'Print Followup & Send Mail to Customers' + _columns = { + 'partner_ids': fields.many2many('account_followup.stat', 'partner_stat_rel', 'followup_id', 'stat_id', 'Partners', required=True), + 'email_conf': fields.boolean('Send email confirmation'), + 'email_subject': fields.char('Email Subject', size=64), + 'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configre from company'), + 'email_body': fields.text('Email body'), + 'summary': fields.text('Summary', required=True, readonly=True) + } + def _get_summary(self, cr, uid, context=None): + return context.get('summary', '') -_followup_wizard_all_form = """<?xml version="1.0"?> -<form string="Select partners" colspan="4"> - <notebook> - <page string="Partner Selection"> - <separator string="Select partners to remind" colspan="4"/> - <field name="partner_ids" colspan="4" nolabel="1"/> - </page> - <page string="Email Settings"> - <field name="email_conf" colspan="4"/> - <field name="partner_lang" colspan="4"/> - <field name="email_subject" colspan="4"/> - <separator string="Email body" colspan="4" attrs="{'readonly':[('partner_lang','=',True)]}"/> - <field name="email_body" colspan="4" nolabel="1"/> - <separator string="Legend" colspan="4"/> + def _get_partners(self, cr, uid, context=None): + return self._get_partners_followp(cr, uid, [], context)['partner_ids'] - <label string="%(partner_name)s: Partner name" colspan="2"/> - <label string="%(user_signature)s: User name" colspan="2"/> - <label string="%(followup_amount)s: Total Amount Due" colspan="2"/> - <label string="%(date)s: Current Date" colspan="2"/> - <label string="%(company_name)s: User's Company name" colspan="2"/> - <label string="%(company_currency)s: User's Company Currency" colspan="2"/> - <label string="%(heading)s: Move line header" colspan="2"/> - <label string="%(line)s: Ledger Posting lines" colspan="2"/> - </page> - </notebook> -</form>""" + def _get_msg(self, cr, uid, context=None): + return self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.follow_up_msg -_followup_wizard_all_fields = { - 'partner_ids': { - 'string': "Partners", - 'type': 'many2many', - 'required': True, - 'relation': 'account_followup.stat', - }, - 'email_conf': { - 'string': "Send email confirmation", - 'type': 'boolean', - }, - 'email_subject' : { - 'string' : "Email Subject", - 'type' : "char", - 'size': 64, - 'default': 'Invoices Reminder' - }, - 'partner_lang':{ - 'string': "Send Email in Partner Language", - 'type': 'boolean', - 'default':True, - 'help':'Do not change message text, if you want to send email in partner language, or configre from company' - }, - 'email_body': { - 'string': "Email body", - 'type': 'text', - 'default': ''' -Date : %(date)s + _defaults = { + 'email_body': _get_msg, + 'email_subject': 'Invoices Reminder', + 'partner_lang': True, + 'partner_ids': _get_partners, + 'summary': _get_summary, +# 'email_body':''' +#Date : %(date)s +# +#Dear %(partner_name)s, +# +#Please find in attachment a reminder of all your unpaid invoices, for a total amount due of: +# +#%(followup_amount).2f %(company_currency)s +# +# +#Thanks, +#-- +#%(user_signature)s +#%(company_name)s +# ''' + } -Dear %(partner_name)s, + def _get_partners_followp(self, cr, uid, ids, context=None): + data = {} + if context is None: + context = {} + if ids: + data = self.read(cr, uid, ids, [])[0] + cr.execute( + "SELECT l.partner_id, l.followup_line_id,l.date_maturity, l.date, l.id "\ + "FROM account_move_line AS l "\ + "LEFT JOIN account_account AS a "\ + "ON (l.account_id=a.id) "\ + "WHERE (l.reconcile_id IS NULL) "\ + "AND (a.type='receivable') "\ + "AND (l.state<>'draft') "\ + "AND (l.partner_id is NOT NULL) "\ + "AND (a.active) "\ + "ORDER BY l.date") + move_lines = cr.fetchall() + old = None + fups = {} + fup_id = 'followup_id' in context and context['followup_id'] or data['followup_id'] + date = 'date' in context and context['date'] or data['date'] -Please find in attachment a reminder of all your unpaid invoices, for a total amount due of: + current_date = datetime.date(*time.strptime(date, + '%Y-%m-%d')[:3]) + cr.execute( + "SELECT * "\ + "FROM account_followup_followup_line "\ + "WHERE followup_id=%s "\ + "ORDER BY sequence", (fup_id,)) + for result in cr.dictfetchall(): + delay = datetime.timedelta(days=result['delay']) + fups[old] = (current_date - delay, result['id']) + if result['start'] == 'end_of_month': + fups[old][0].replace(day=1) + old = result['id'] -%(followup_amount).2f %(company_currency)s + fups[old] = (datetime.date(datetime.MAXYEAR, 12, 31), old) + partner_list = [] + to_update = {} + for partner_id, followup_line_id, date_maturity,date, id in move_lines: + if not partner_id: + continue + if followup_line_id not in fups: + continue + if date_maturity: + if date_maturity <= fups[followup_line_id][0].strftime('%Y-%m-%d'): + if partner_id not in partner_list: + partner_list.append(partner_id) + to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id} + elif date and date <= fups[followup_line_id][0].strftime('%Y-%m-%d'): + if partner_id not in partner_list: + partner_list.append(partner_id) + to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id} -Thanks, --- -%(user_signature)s -%(company_name)s - ''' - } -} + return {'partner_ids': partner_list, 'to_update': to_update} -class followup_all_print(wizard.interface): - def _update_partners(self, cr, uid, data, context): - to_update = data['form']['to_update'] - for id in to_update.keys(): - if to_update[id]['partner_id'] in data['form']['partner_ids'][0][2]: - cr.execute( - "UPDATE account_move_line "\ - "SET followup_line_id=%s, followup_date=%s "\ - "WHERE id=%s", - (to_update[id]['level'], - data['form']['date'], int(id),)) - return {} + def do_mail(self ,cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.model.data') + move_obj = self.pool.get('account.move.line') + user_obj = self.pool.get('res.users') + line_obj = self.pool.get('account_followup.stat') + data = self.read(cr, uid, ids, [])[0] + model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all_msg')], context=context) + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] - def _sendmail(self ,cr, uid, data, context): - if data['form']['email_conf']: + if data['email_conf']: mail_notsent = '' msg_sent = '' msg_unsent = '' count = 0 - pool = pooler.get_pool(cr.dbname) - data_user = pool.get('res.users').browse(cr,uid,uid) - line_obj = pool.get('account_followup.stat') - move_lines = line_obj.browse(cr,uid,data['form']['partner_ids'][0][2]) + data_user = user_obj.browse(cr, uid, uid) + move_lines = line_obj.browse(cr,uid,data['partner_ids'][0][2]) partners = [] dict_lines = {} for line in move_lines: partners.append(line.name) dict_lines[line.name.id] =line for partner in partners: - ids_lines = pool.get('account.move.line').search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable'])]) - data_lines = pool.get('account.move.line').browse(cr,uid,ids_lines) + ids_lines = move_obj.search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable'])]) + data_lines = move_obj.browse(cr,uid,ids_lines) followup_data = dict_lines[partner.id] dest = False if partner.address: @@ -163,12 +198,12 @@ class followup_all_print(wizard.interface): if adr.email: dest = [adr.email] src = tools.config.options['email_from'] - if not data['form']['partner_lang']: - body = data['form']['email_body'] + if not data['partner_lang']: + body = data['email_body'] else: cxt = context.copy() cxt['lang'] = partner.lang - body = pool.get('res.users').browse(cr, uid, uid, context=cxt).company_id.follow_up_msg + body = user_obj.browse(cr, uid, uid, context=cxt).company_id.follow_up_msg total_amt = followup_data.debit - followup_data.credit move_line = '' @@ -200,7 +235,7 @@ class followup_all_print(wizard.interface): 'date':time.strftime('%Y-%m-%d'), } body = body%val - sub = tools.ustr(data['form']['email_subject']) + sub = tools.ustr(data['email_subject']) msg = '' if dest: tools.email_send(src,dest,sub,body) @@ -215,113 +250,48 @@ class followup_all_print(wizard.interface): msg_sent = msg_sent and _("\n\nE-Mail sent to following Partners successfully. !\n\n") + msg_sent line = '==========================================================================' summary = msg_unsent + line + msg_sent - return {'summary' : summary} + context.update({'summary': summary}) else: - return {'summary' : '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'} + context.update({'summary': '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'}) + return { + 'name': _('Summary'), + 'view_type': 'form', + 'context': context, + 'view_mode': 'tree,form', + 'res_model': 'account.followup.print.all', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + 'nodestroy': True + } - def _get_partners(self, cr, uid, data, context): - pool = pooler.get_pool(cr.dbname) - cr.execute( - "SELECT l.partner_id, l.followup_line_id,l.date_maturity, l.date, l.id "\ - "FROM account_move_line AS l "\ - "LEFT JOIN account_account AS a "\ - "ON (l.account_id=a.id) "\ - "WHERE (l.reconcile_id IS NULL) "\ - "AND (a.type='receivable') "\ - "AND (l.state<>'draft') "\ - "AND (l.partner_id is NOT NULL) "\ - "AND (a.active) "\ - "ORDER BY l.date") - move_lines = cr.fetchall() - old = None - fups = {} - fup_id = data['form']['followup_id'] - - current_date = datetime.date(*time.strptime(data['form']['date'], - '%Y-%m-%d')[:3]) - cr.execute( - "SELECT * "\ - "FROM account_followup_followup_line "\ - "WHERE followup_id=%s "\ - "ORDER BY sequence", (fup_id,)) - for result in cr.dictfetchall(): - delay = datetime.timedelta(days=result['delay']) - fups[old] = (current_date - delay, result['id']) - if result['start'] == 'end_of_month': - fups[old][0].replace(day=1) - old = result['id'] - - fups[old] = (datetime.date(datetime.MAXYEAR, 12, 31), old) - - partner_list = [] - to_update = {} - for partner_id, followup_line_id, date_maturity,date, id in move_lines: - if not partner_id: - continue - if followup_line_id not in fups: - continue - if date_maturity: - if date_maturity <= fups[followup_line_id][0].strftime('%Y-%m-%d'): - if partner_id not in partner_list: - partner_list.append(partner_id) - to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id} - elif date and date <= fups[followup_line_id][0].strftime('%Y-%m-%d'): - if partner_id not in partner_list: - partner_list.append(partner_id) - to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id} - - message = pool.get('res.users').browse(cr, uid, uid, context=context).company_id.follow_up_msg - - return {'partner_ids': partner_list, 'to_update': to_update, 'email_body':message} - - def _get_screen1_values(self, cr, uid, data, context): - pool = pooler.get_pool(cr.dbname) - company_id = pool.get('res.users').browse(cr, uid, uid).company_id.id - tmp = pool.get('account_followup.followup').search(cr, uid, [('company_id', '=', company_id)]) - followup = tmp and tmp[0] or False - return {'date': time.strftime('%Y-%m-%d'), 'followup_id': followup} - - states = { - 'init': { - 'actions': [_get_screen1_values], - 'result': {'type': 'form', - 'arch': _followup_wizard_screen1_form, - 'fields': _followup_wizard_screen1_fields, - 'state': [ - ('end', 'Cancel'), - ('next', 'Continue'), - ] - }, - }, - 'next': { - 'actions': [_get_partners], - 'result': {'type': 'form', - 'arch': _followup_wizard_all_form, - 'fields': _followup_wizard_all_fields, - 'state': [ - ('end','Cancel'), - ('print','Print Follow Ups & Send Mails'), - ] - }, - }, - 'print': { - 'actions': [_update_partners], - 'result': {'type': 'print', - 'report':'account_followup.followup.print', - 'state':'summary'}, - }, - 'summary': { - 'actions': [_sendmail], - 'result': {'type': 'form', - 'arch': _email_summary_form, - 'fields': _email_summary_fields, - 'state':[('end','Ok')] - }, - }, - } - -followup_all_print('account_followup.followup.print.all') + def do_print(self, cr, uid, ids, context=None): + data = self.read(cr, uid, ids, [])[0] + res = self._get_partners_followp(cr, uid, ids, context)['to_update'] + to_update = res + data['followup_id'] = 'followup_id' in context and context['followup_id'] or False + date = 'date' in context and context['date'] or data['date'] + for id in to_update.keys(): + if to_update[id]['partner_id'] in data['partner_ids'][0][2]: + cr.execute( + "UPDATE account_move_line "\ + "SET followup_line_id=%s, followup_date=%s "\ + "WHERE id=%s", + (to_update[id]['level'], + date, int(id),)) + datas = { + 'ids': [], + 'model': 'account_followup.followup', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account_followup.followup.print', + 'datas': datas, + 'nodestroy': True + } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +account_followup_print_all() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_followup/wizard/account_followup_print_view.xml b/addons/account_followup/wizard/account_followup_print_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..021fc52f63c1a4aa3d5b46761ed3d2a5e5330404 --- /dev/null +++ b/addons/account_followup/wizard/account_followup_print_view.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data noupdate="0"> + + <!--<wizard string="Send followups" + name="account_followup.followup.print.all" + id="action_account_followup_all_wizard" + model="account_followup.followup" /> + + <menuitem action="action_account_followup_all_wizard" + id="account_followup_wizard_menu" + parent="account.menu_finance_periodical_processing" + type="wizard" />--> + + + <record id="view_account_followup_print" model="ir.ui.view"> + <field name="name">account.followup.print.form</field> + <field name="model">account.followup.print</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Send followups"> + <group col="4" colspan="6"> + <field name="followup_id"/> + <field name="date"/> + <newline/> + </group> + <separator colspan="4"/> + <group col="2" colspan="4"> + <button special="cancel" string="Cancel" icon='gtk-cancel'/> + <button name="do_continue" string="Continue" colspan="1" type="object" icon="gtk-ok"/> + </group> + </form> + </field> + </record> + + <record id="action_account_followup_print" model="ir.actions.act_window"> + <field name="name">Send followups</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.followup.print</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_followup_print_values"> + <field name="model_id" ref="model_account_followup_followup" /> + <field name="object" eval="1" /> + <field name="name">Send followups</field> + <field name="key2">client_action_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_followup_print'))" /> + <field name="key">action</field> + <field name="model">account_followup.followup</field> + </record> + + <menuitem action="action_account_followup_print" + id="account_followup_print_menu" + parent="account.menu_finance_periodical_processing" + /> + + + <!-- Screen2 --> + + <record id="view_account_followup_print_all" model="ir.ui.view"> + <field name="name">account.followup.print.all.form</field> + <field name="model">account.followup.print.all</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Send followups"> + <group col="4" colspan="6"> + <notebook> + <page string="Partner Selection"> + <separator string="Select partners to remind" colspan="4"/> + <field name="partner_ids" colspan="4" nolabel="1"/> + </page> + <page string="Email Settings"> + <field name="email_conf" colspan="4"/> + <field name="partner_lang" colspan="4"/> + <field name="email_subject" colspan="4"/> + <!--<separator string="Email body" colspan="4" attrs="{'readonly':[('partner_lang','=',True)]}"/>--> + <separator string="Email body" colspan="4" /> + <field name="email_body" colspan="4" nolabel="1"/> + <separator string="Legend" colspan="4"/> + <label string="%%(partner_name)s: Partner name" colspan="2"/> + <label string="%%(user_signature)s: User name" colspan="2"/> + <label string="%%(followup_amount)s: Total Amount Due" colspan="2"/> + <label string="%%(date)s: Current Date" colspan="2"/> + <label string="%%(company_name)s: User's Company name" colspan="2"/> + <label string="%%(company_currency)s: User's Company Currency" colspan="2"/> + <label string="%%(heading)s: Move line header" colspan="2"/> + <label string="%%(line)s: Ledger Posting lines" colspan="2"/> + </page> + </notebook> + </group> + <separator colspan="4"/> + <group> + <button special="cancel" string="Cancel" icon='gtk-cancel'/> + <button name="do_print" string="Print Follow Ups" colspan="1" type="object" icon="gtk-print"/> + <button name="do_mail" string="Send Mails" colspan="1" type="object" icon="gtk-execute"/> + </group> + </form> + </field> + </record> + + <record id="view_account_followup_print_all_msg" model="ir.ui.view"> + <field name="name">account.followup.print.all.msg.form</field> + <field name="model">account.followup.print.all</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Summary"> + <group col="4" colspan="6"> + <field name="summary" height="300" width="800"/> + </group> + <separator colspan="4"/> + <group> + <button special="cancel" string="Ok" icon='gtk-cancel'/> + </group> + </form> + </field> + </record> + + <record id="action_account_followup_print_all" model="ir.actions.act_window"> + <field name="name">Send followups</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.followup.print.all</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_followup/wizard/wizard_view.xml b/addons/account_followup/wizard/wizard_view.xml deleted file mode 100644 index 643265ddca2870810873222b70dc1f919492651a..0000000000000000000000000000000000000000 --- a/addons/account_followup/wizard/wizard_view.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><openerp><data noupdate="0"> - <wizard string="Send followups" - name="account_followup.followup.print.all" - id="action_account_followup_all_wizard" - model="account_followup.followup" /> - - <menuitem action="action_account_followup_all_wizard" - id="account_followup_wizard_menu" - parent="account.menu_finance_periodical_processing" - type="wizard" /> -</data></openerp> - diff --git a/addons/account_invoice_layout/__openerp__.py b/addons/account_invoice_layout/__openerp__.py index 5ba6a9291f4766e65b3d166bc11b70004dfb2dad..f2df124dc756bded0f06b3629b3ae6dc1bf82792 100644 --- a/addons/account_invoice_layout/__openerp__.py +++ b/addons/account_invoice_layout/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -42,7 +42,8 @@ 'update_xml': [ 'security/ir.model.access.csv', 'account_invoice_layout_view.xml', - 'account_invoice_layout_report.xml' + 'account_invoice_layout_report.xml', + 'wizard/account_invoice_special_message.xml', ], 'demo_xml': [], 'installable': True, diff --git a/addons/account_invoice_layout/account_invoice_layout_report.xml b/addons/account_invoice_layout/account_invoice_layout_report.xml index 2579609bfbf2c99322f9e63e5e1afdadf9831f5e..747bc83d4c21d2f7793d2ad30c9d163236a834af 100644 --- a/addons/account_invoice_layout/account_invoice_layout_report.xml +++ b/addons/account_invoice_layout/account_invoice_layout_report.xml @@ -1,12 +1,12 @@ <?xml version="1.0"?> <openerp> <data> - <wizard string="Invoices with Layout and Message" +<!-- <wizard string="Invoices with Layout and Message" model="account.invoice" name="wizard.notify_message" id="wizard_notify_message" keyword="client_print_multi" - /> + /> --> <report id="account_invoices_1" string="Invoices with Layout" diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml index e8f1cee42f39f9a79ddcf77cbd1a538c851608ce..950a84fc63728ac687f92dd8ef3285f4944958ef 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml @@ -191,7 +191,7 @@ </para> </td> <td> - <para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="terp_default_9">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]] </para> <para style="terp_default_9">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para> <para style="terp_default_9">[[ o.address_invoice_id.street ]]</para> <para style="terp_default_9">[[ o.address_invoice_id.street2 or '' ]]</para> diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml index 133fffe5c0f1d4bda1f09a7a01921077e151de62..7eaae14497fb47a97fd50cfc372a1bb604ea022f 100644 --- a/addons/account_invoice_layout/report/special_message_invoice.rml +++ b/addons/account_invoice_layout/report/special_message_invoice.rml @@ -195,7 +195,7 @@ </para> </td> <td> - <para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="terp_default_9">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="terp_default_9">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para> <para style="terp_default_9">[[ o.address_invoice_id.street ]]</para> <para style="terp_default_9">[[ o.address_invoice_id.street2 or '' ]]</para> diff --git a/addons/account_invoice_layout/wizard/__init__.py b/addons/account_invoice_layout/wizard/__init__.py index 62b012d0a5e030799a7b235773b50c9a45182b69..3b724adbe399a7f2e477b696a693f4a168c42034 100644 --- a/addons/account_invoice_layout/wizard/__init__.py +++ b/addons/account_invoice_layout/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,10 +15,10 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import invoice_special_message +import account_invoice_special_message # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_invoice_layout/wizard/invoice_special_message.py b/addons/account_invoice_layout/wizard/account_invoice_special_message.py similarity index 54% rename from addons/account_invoice_layout/wizard/invoice_special_message.py rename to addons/account_invoice_layout/wizard/account_invoice_special_message.py index a97b3a144b011564b3bb93d26abee6d628333e61..5936e4c15794c96979c9dbd5eef7c8443c0f0177 100644 --- a/addons/account_invoice_layout/wizard/invoice_special_message.py +++ b/addons/account_invoice_layout/wizard/account_invoice_special_message.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,38 +15,34 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## - -import wizard -import time -import datetime -import pooler - -invoice_form = """<?xml version="1.0"?> -<form string="Select Message"> - <field name="message"/> -</form>""" - -invoice_fields = { - 'message': {'string': 'Message', 'type': 'many2one', 'relation': 'notify.message', 'required': True}, - } - -class wizard_report(wizard.interface): - - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':invoice_form, 'fields':invoice_fields, 'state':[('end','Cancel'),('print','Print')]}, - }, - 'print': { - 'actions': [], - 'result': {'type':'print', 'report':'notify_account.invoice', 'state':'end'}, - }, - } - -wizard_report('wizard.notify_message') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +from osv import osv, fields + +class account_invoice_special_msg(osv.osv_memory): + _name = 'account.invoice.special.msg' + _description = 'Account Invoice Special Message' + + _columns = { + 'message': fields.many2one('notify.message', 'Message', required = True, help="Message to Print at the bottom of report"), + } + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids, [])[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.invoice', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'notify_account.invoice', + 'datas': datas, + } + +account_invoice_special_msg() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_invoice_layout/wizard/account_invoice_special_message.xml b/addons/account_invoice_layout/wizard/account_invoice_special_message.xml new file mode 100644 index 0000000000000000000000000000000000000000..b1cf73572411b84ffa2e718d0b29b157ecbef196 --- /dev/null +++ b/addons/account_invoice_layout/wizard/account_invoice_special_message.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_invoice_special_msg_view" model="ir.ui.view"> + <field name="name">Account Invioce Special Message</field> + <field name="model">account.invoice.special.msg</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Message"> + <group colspan="4" col="6"> + <field name="message"/> + </group> + <separator colspan="4"/> + <group colspan="4" col="6"> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print"/> + </group> + </form> + </field> + </record> + + <record id="action_account_invoice_special_msg" model="ir.actions.act_window"> + <field name="name">Invoices with Layout and Message</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.invoice.special.msg</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_invoice_special_msg_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_invoice_special_msg_values"> + <field name="model_id" ref="account.model_account_invoice" /> + <field name="object" eval="1" /> + <field name="name">Account Invioce Special Message</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_invoice_special_msg'))" /> + <field name="key">action</field> + <field name="model">account.invoice</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py index aa0829b689a5de12e902111bf5a5975d27284ac1..eba905a525320367ed679664cd2dbc8dd1974376 100644 --- a/addons/account_payment/__openerp__.py +++ b/addons/account_payment/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -38,12 +38,14 @@ 'update_xml': [ 'security/account_payment_security.xml', 'security/ir.model.access.csv', - 'payment_wizard.xml', + 'wizard/account_payment_pay_view.xml', + 'wizard/account_payment_create_order_view.xml', 'payment_view.xml', 'payment_workflow.xml', 'payment_sequence.xml', 'account_invoice_view.xml', - 'payment_report.xml' + 'payment_report.xml', + ], 'demo_xml': [], 'installable': True, diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml index a0ab77a593446837171fca55490b75c2f6d029f7..c5c335c4f5fecee00a2d60cb6c1b37b1816cedc3 100644 --- a/addons/account_payment/payment_view.xml +++ b/addons/account_payment/payment_view.xml @@ -2,6 +2,7 @@ <openerp> <data> + <wizard id="wizard_populate_statement" menu="False" model="account.bank.statement" name="populate_statement" string="Populate Statement with Payment lines"/> <!-- View used in the wizard --> <record id="view_move_line_form" model="ir.ui.view"> <field name="name">account.move.line.form.inherit</field> @@ -107,7 +108,7 @@ <field name="date_prefered"/> <field name="date_planned" select="1"/> <field name="user_id"/> - <button colspan="2" name="%(wizard_populate_payment)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/> + <button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/> <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1"> <form string="Payment Line"> <notebook> @@ -162,7 +163,7 @@ <group col="4" colspan="2"> <button name="cancel" states="draft,open" string="Cancel" icon="gtk-cancel"/> <button name="open" states="draft" string="Confirm Payments" icon="gtk-apply"/> - <button name="%(wizard_pay_payment)d" states="open" string="Make Payments" type="action" icon="gtk-execute"/> + <button name="%(action_account_payment_make_payment)d" states="open" string="Make Payments" type="action" icon="gtk-execute"/> <button name="set_to_draft" states="cancel" string="Set to draft" type="object" icon="gtk-convert"/> </group> </form> diff --git a/addons/account_payment/payment_wizard.xml b/addons/account_payment/payment_wizard.xml deleted file mode 100644 index 0cc5759b31818ecc48de02ab1651b36c8d338dce..0000000000000000000000000000000000000000 --- a/addons/account_payment/payment_wizard.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<openerp> - <data> - <wizard id="wizard_populate_payment" menu="False" model="payment.order" name="populate_payment" string="Populate payment"/> - - <wizard id="wizard_pay_payment" menu="False" model="payment.order" name="pay_payment" string="Pay"/> - - <wizard id="wizard_populate_statement" menu="False" model="account.bank.statement" name="populate_statement" string="Populate Statement with Payment lines"/> - - </data> -</openerp> diff --git a/addons/account_payment/wizard/__init__.py b/addons/account_payment/wizard/__init__.py index 6254c9f5794310a56ab5769f8956bfeb367a81bd..0a2db6f8fd018b6da507931afb6474ced7c79686 100644 --- a/addons/account_payment/wizard/__init__.py +++ b/addons/account_payment/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,12 +15,12 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import wizard_payment_order -import wizard_pay +import account_payment_order +import account_payment_pay import wizard_populate_statement # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/wizard/account_payment_create_order_view.xml b/addons/account_payment/wizard/account_payment_create_order_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..d301e72e1abe5ca7155b1886dcf5317655600830 --- /dev/null +++ b/addons/account_payment/wizard/account_payment_create_order_view.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="view_create_payment_order" model="ir.ui.view"> + <field name="name">payment.order.create.form</field> + <field name="model">payment.order.create</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Search Payment lines"> + <group col="4" colspan="6"> + <field name="duedate" /> + </group> + <separator colspan="4"/> + <group col="2" colspan="4"> + <button special="cancel" string="Cancel" icon='gtk-cancel'/> + <button name="search_entries" string="Search" colspan="1" type="object" icon="gtk-execute"/> + </group> + </form> + </field> + </record> + + <record id="view_create_payment_order_lines" model="ir.ui.view"> + <field name="name">payment.order.create.form</field> + <field name="model">payment.order.create</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Search Payment lines"> + <group col="4" colspan="6"> + </group> + <separator colspan="4"/> + <group col="2" colspan="4"> + <button special="cancel" string="Cancel" icon='gtk-cancel'/> + <button name="create_payment" string="_Add to payment order" colspan="1" type="object" icon="gtk-execute"/> + </group> + </form> + </field> + </record> + + <record id="action_create_payment_order" model="ir.actions.act_window"> + <field name="name">Populate Payment</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">payment.order.create</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py new file mode 100644 index 0000000000000000000000000000000000000000..001804c9e8a39ffc981a78b9bd97450642841e41 --- /dev/null +++ b/addons/account_payment/wizard/account_payment_order.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time +from lxml import etree + +from osv import osv, fields + +class payment_order_create(osv.osv_memory): + """ + Create a payment object with lines corresponding to the account move line + to pay according to the date and the mode provided by the user. + Hypothesis: + - Small number of non-reconcilied move line , payment mode and bank account type, + - Big number of partner and bank account. + + If a type is given, unsuitable account Entry lines are ignored. + """ + + _name = 'payment.order.create' + _description = 'payment.order.create' + _columns = { + 'duedate': fields.date('Due Date', required=True), + 'entries': fields.many2many('account.move.line', 'line_pay_rel', 'pay_id', 'line_id', 'Entries') + } + _defaults = { + 'duedate': time.strftime('%Y-%m-%d'), + } + + def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): + res = super(payment_order_create, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False) + if context and 'line_ids' in context: + view_obj = etree.XML(res['arch']) + child = view_obj.getchildren()[0] + domain = '[("id", "in", '+ str(context['line_ids'])+')]' + field = etree.Element('field', attrib={'domain': domain, 'name':'entries', 'colspan':'4', 'height':'300', 'width':'800', 'nolabel':"1"}) + child.addprevious(field) + res['arch'] = etree.tostring(view_obj) + return res + + def create_payment(self, cr, uid, ids, context=None): + order_obj = self.pool.get('payment.order') + line_obj = self.pool.get('account.move.line') + + data = self.read(cr, uid, ids, [], context)[0] + line_ids= data['entries'] + if not line_ids: return {} + + payment = order_obj.browse(cr, uid, data['active_id'], + context=context) + t = payment.mode and payment.mode.type.id or None + line2bank = pool.get('account.move.line').line2bank(cr, uid, + line_ids, t, context) + + ## Finally populate the current payment with new lines: + for line in line_obj.browse(cr, uid, line_ids, context=context): + if payment.date_prefered == "now": + #no payment date => immediate payment + date_to_pay = False + elif payment.date_prefered == 'due': + date_to_pay = line.date_maturity + elif payment.date_prefered == 'fixed': + date_to_pay = payment.date_planned + pool.get('payment.line').create(cr, uid,{ + 'move_line_id': line.id, + 'amount_currency': line.amount_to_pay, + 'bank_id': line2bank.get(line.id), + 'order_id': payment.id, + 'partner_id': line.partner_id and line.partner_id.id or False, + 'communication': line.ref or '/', + 'date': date_to_pay, + 'currency': line.invoice and line.invoice.currency_id.id or False, + }, context=context) + return {} + + def search_entries(self, cr, uid, ids, context=None): + order_obj = self.pool.get('payment.order') + line_obj = self.pool.get('account.move.line') + mod_obj = self.pool.get('ir.model.data') + + data = self.read(cr, uid, ids, [], context=context)[0] + search_due_date = data['duedate'] + payment = order_obj.browse(cr, uid, context['active_id'], context=context) + ctx = '' + if payment.mode: + ctx = '''context="{'journal_id': %d}"''' % payment.mode.journal.id + + # Search for move line to pay: + domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)] + domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)] + line_ids = line_obj.search(cr, uid, domain, context=context) + context.update({'line_ids': line_ids}) + model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context) + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] + return { + 'name': ('Entrie Lines'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'payment.order.create', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } + +payment_order_create() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_payment/wizard/account_payment_pay.py b/addons/account_payment/wizard/account_payment_pay.py new file mode 100644 index 0000000000000000000000000000000000000000..74e1566520c0d42963fd2b2aeec21efbba8cd81c --- /dev/null +++ b/addons/account_payment/wizard/account_payment_pay.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +import time +from osv import fields, osv + +class account_payment_make_payment(osv.osv_memory): + _name = 'account.payment.make.payment' + _description = 'Account make payment' + _columns = { + } + + def launch_wizard(self, cr, uid, ids, context): + """ + Search for a wizard to launch according to the type. + If type is manual. just confirm the order. + """ + obj_payment_order = self.pool.get('payment.order') + obj_model = self.pool.get('ir.model.data') + obj_act = self.pool.get('ir.actions.act_window') + order= obj_payment_order.browse(cr,uid,context['active_id'],context) + t= order.mode and order.mode.type.code or 'manual' + if t == 'manual' : + obj_payment_order.set_done(cr,uid,context['active_id'],context) + return {} + + gw= obj_payment_order.get_wizard(t) + if not gw: + obj_payment_order.set_done(cr,uid,context['active_id'],context) + return {} + + module, wizard= gw + result = mod_obj._get_id(cr, uid, module, wizard) + id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] + result = act_obj.read(cr, uid, [id])[0] + #result['context'] = str({'fiscalyear': data['form']['fiscalyear']}) + return result + + +account_payment_make_payment() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_payment/wizard/account_payment_pay_view.xml b/addons/account_payment/wizard/account_payment_pay_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..061c152361c965ead8bc48ed04da953519f186c5 --- /dev/null +++ b/addons/account_payment/wizard/account_payment_pay_view.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_payment_make_payment_view" model="ir.ui.view"> + <field name="name">account.payment.make.payment.form</field> + <field name="model">account.payment.make.payment</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Make Payment"> + <label string ="Are you sure you want to make payment?" /> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="launch_wizard" string="Print" type="object" icon="gtk-print" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_account_payment_make_payment" model="ir.actions.act_window"> + <field name="name">Make Payment</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.payment.make.payment</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_payment_make_payment_view"/> + <field name="target">new</field> + </record> + + + </data> +</openerp> diff --git a/addons/account_payment/wizard/wizard_pay.py b/addons/account_payment/wizard/wizard_pay.py deleted file mode 100644 index 7380cadb6857fc0e8b867bde8068f0e262491dfe..0000000000000000000000000000000000000000 --- a/addons/account_payment/wizard/wizard_pay.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -from osv import osv -import pooler -from osv import fields -import time - - -def _launch_wizard(self, cr, uid, data, context): - """ - Search for a wizard to launch according to the type. - If type is manual. just confirm the order. - """ - - order_ref= pooler.get_pool(cr.dbname).get('payment.order') - order= order_ref.browse(cr,uid,data['id'],context) - t= order.mode and order.mode.type.code or 'manual' - if t == 'manual' : - order_ref.set_done(cr,uid,data['id'],context) - return {} - - gw= order_ref.get_wizard(t) - if not gw: - order_ref.set_done(cr,uid,data['id'],context) - return {} - - mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data') - act_obj = pooler.get_pool(cr.dbname).get('ir.actions.wizard') - module, wizard= gw - result = mod_obj._get_id(cr, uid, module, wizard) - id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] - result = act_obj.read(cr, uid, [id])[0] - #result['context'] = str({'fiscalyear': data['form']['fiscalyear']}) - return result - - -class wizard_pay(wizard.interface): - - states= {'init' : {'actions': [], - 'result':{'type':'action', - 'action':_launch_wizard, - 'state':'end'} - } - } -wizard_pay('pay_payment') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account_payment/wizard/wizard_payment_order.py b/addons/account_payment/wizard/wizard_payment_order.py deleted file mode 100644 index 7caa72dc666d44d29fe3e3061ac40db563e6d132..0000000000000000000000000000000000000000 --- a/addons/account_payment/wizard/wizard_payment_order.py +++ /dev/null @@ -1,154 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import pooler -from tools.misc import UpdateableStr -import time - - -FORM = UpdateableStr() - -FIELDS = { - 'entries': {'string':'Entries', 'type':'many2many', - 'relation': 'account.move.line',}, -} -field_duedate={ - 'duedate': {'string':'Due Date', 'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d'),}, - } -arch_duedate='''<?xml version="1.0"?> -<form string="Search Payment lines"> - <field name="duedate" /> -</form>''' - - -def search_entries(self, cr, uid, data, context): - search_due_date=data['form']['duedate'] - - pool = pooler.get_pool(cr.dbname) - order_obj = pool.get('payment.order') - line_obj = pool.get('account.move.line') - - payment = order_obj.browse(cr, uid, data['id'], - context=context) - ctx = '' - if payment.mode: - ctx = '''context="{'journal_id': %d}"''' % payment.mode.journal.id - - # Search for move line to pay: - domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)] - domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)] - line_ids = line_obj.search(cr, uid, domain, context=context) - FORM.string = '''<?xml version="1.0"?> -<form string="Populate Payment:"> - <field name="entries" colspan="4" height="300" width="800" nolabel="1" - domain="[('id', 'in', [%s])]" %s/> -</form>''' % (','.join([str(x) for x in line_ids]), ctx) - return {} - -def create_payment(self, cr, uid, data, context): - line_ids= data['form']['entries'][0][2] - if not line_ids: return {} - - pool= pooler.get_pool(cr.dbname) - order_obj = pool.get('payment.order') - line_obj = pool.get('account.move.line') - - payment = order_obj.browse(cr, uid, data['id'], - context=context) - t = payment.mode and payment.mode.type.id or None - line2bank = pool.get('account.move.line').line2bank(cr, uid, - line_ids, t, context) - - ## Finally populate the current payment with new lines: - for line in line_obj.browse(cr, uid, line_ids, context=context): - if payment.date_prefered == "now": - #no payment date => immediate payment - date_to_pay = False - elif payment.date_prefered == 'due': - date_to_pay = line.date_maturity - elif payment.date_prefered == 'fixed': - date_to_pay = payment.date_planned - pool.get('payment.line').create(cr,uid,{ - 'move_line_id': line.id, - 'amount_currency': line.amount_to_pay, - 'bank_id': line2bank.get(line.id), - 'order_id': payment.id, - 'partner_id': line.partner_id and line.partner_id.id or False, - 'communication': line.ref or '/', - 'date': date_to_pay, - 'currency': line.invoice and line.invoice.currency_id.id or False, - }, context=context) - return {} - - -class wizard_payment_order(wizard.interface): - """ - Create a payment object with lines corresponding to the account move line - to pay according to the date and the mode provided by the user. - Hypothesis: - - Small number of non-reconcilied move line , payment mode and bank account type, - - Big number of partner and bank account. - - If a type is given, unsuitable account Entry lines are ignored. - """ - states = { - - 'init': { - 'actions': [], - 'result': { - 'type': 'form', - 'arch': arch_duedate, - 'fields':field_duedate, - 'state': [ - ('end','_Cancel'), - ('search','_Search', '', True) - ] - }, - }, - - 'search': { - 'actions': [search_entries], - 'result': { - 'type': 'form', - 'arch': FORM, - 'fields': FIELDS, - 'state': [ - ('end','_Cancel'), - ('create','_Add to payment order', '', True) - ] - }, - }, - 'create': { - 'actions': [], - 'result': { - 'type': 'action', - 'action': create_payment, - 'state': 'end'} - }, - } - -wizard_payment_order('populate_payment') - - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account_report/__openerp__.py b/addons/account_report/__openerp__.py index 2982c8439c4b92168d726819946f744c4f8f6e62..d71d75f0bb3c8779af7838d63cd5ce0b9c9992aa 100644 --- a/addons/account_report/__openerp__.py +++ b/addons/account_report/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -36,7 +36,8 @@ 'security/ir.model.access.csv', 'account_view.xml', 'account_report.xml', - 'account_wizard.xml' + 'account_wizard.xml', + 'wizard/account_report_print_indicators_view.xml', ], 'demo_xml': [], 'installable': True, diff --git a/addons/account_report/account_report.xml b/addons/account_report/account_report.xml old mode 100755 new mode 100644 diff --git a/addons/account_report/account_wizard.xml b/addons/account_report/account_wizard.xml index 84404f461ab78a18a9c45c99d4bf67d71109e180..d56b6c9d5652d814bcea248bbd2e2a9d7a6d8b30 100644 --- a/addons/account_report/account_wizard.xml +++ b/addons/account_report/account_wizard.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <openerp> <data> - <wizard id="wizard_print_indicators" name="print.indicators" string="Print Indicators"/> - <menuitem action="wizard_print_indicators" type="wizard" parent="account_report.menu_action_account_report_tree_view" id="menu_wizard_print_indicators"/> +<!-- <wizard id="wizard_print_indicators" name="print.indicators" string="Print Indicators"/>--> +<!-- <menuitem action="wizard_print_indicators" type="wizard" parent="account_report.menu_action_account_report_tree_view" id="menu_wizard_print_indicators"/>--> <wizard id="wizard_indicators_with_pdf" model="account.report.report" name="print.indicators.pdf" string="Indicators in PDF" keyword="client_action_multi" /> <!--<menuitem action="wizard_indicators_with_pdf" type="wizard" parent="account_report.menu_action_account_report_tree_view" id="menu_wizard_print_indicators_with_pdf"/>--> diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py index 3c4af0ae5c520dedaa239a22a960dbc683e8f7aa..ef94c9161f9060e551ed8b284d10f72d39d8b1a0 100644 --- a/addons/account_report/report/print_indicator.py +++ b/addons/account_report/report/print_indicator.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -215,10 +215,10 @@ class accounting_report_indicator(report_sxw.rml_parse): obj_history=self.pool.get('account.report.history') if data['select_base']=='year': - tuple_search=('fiscalyear_id','in',data['base_selection'][0][2]) + tuple_search=('fiscalyear_id','in',data['base_selection']) base='year' else: - tuple_search=('period_id','in',data['base_selection'][0][2]) + tuple_search=('period_id','in',data['base_selection']) base='period' history_ids=obj_history.search(self.cr,self.uid,[('name','=',object['id']),tuple_search]) @@ -232,7 +232,7 @@ class accounting_report_indicator(report_sxw.rml_parse): data_val.append(item.val) data_period.append(item.period_id.name) else: - for i in data['base_selection'][0][2]: + for i in data['base_selection']: val_temp=[] data_period.append(self.pool.get('account.fiscalyear').browse(self.cr,self.uid,i).name) for item in obj_his: diff --git a/addons/account_report/wizard/__init__.py b/addons/account_report/wizard/__init__.py index 66a127f8278deaa80292b2e811a03080abe420fd..2658c47cf175ff84f5c43809580709d492d2171c 100644 --- a/addons/account_report/wizard/__init__.py +++ b/addons/account_report/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,11 +15,11 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import wizard_print_indicators +import account_report_print_indicators import wizard_print_indicators_with_pdf # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/wizard/account_report_print_indicators.py b/addons/account_report/wizard/account_report_print_indicators.py new file mode 100644 index 0000000000000000000000000000000000000000..af855db2c89b1b7812551392ec1eb88dcc1db3d6 --- /dev/null +++ b/addons/account_report/wizard/account_report_print_indicators.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +from lxml import etree + +from osv import fields, osv +from tools.translate import _ + +class account_report_print_indicators(osv.osv_memory): + """ + This wizard will print indicators + """ + _name = "account.report.print.indicators" + _description = "Print Indicators" + _columns = { + 'select_base': fields.selection([('year','Based On Fiscal Years'), + ('periods','Based on Fiscal Periods')],'Choose Criteria',required=True), + 'base_selection': fields.many2many('account.fiscalyear', 'indicator_rel','account_id','fiscalyear_id','Fiscal year'), + } + _defaults ={ + 'select_base':'year' + } + + def next(self, cr, uid, ids, context=None): + obj_model = self.pool.get('ir.model.data') + if context is None: + context = {} + data = self.read(cr, uid, ids, [])[0] + context.update({'base': data['select_base']}) + model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_report_print_indicators_relation_view')]) + resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id'] + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'account.report.print.indicators', + 'views': [(resource_id,'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + 'context': context, + } + + def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): + record_id = context and context.get('base', False) or False + res = super(account_report_print_indicators, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False) + fields = res.get('fields',{}) + if record_id: + if record_id == 'periods': + fields.update({'base_selection': {'domain': [],'string': 'Periods','relation': 'account.period','context': '', 'selectable': True,'type':'many2many'}}) + view_obj = etree.XML(res['arch']) + child = view_obj.getchildren()[0] + field = etree.Element('field', attrib={'name':'base_selection'}) + child.addprevious(field) + res['arch'] = etree.tostring(view_obj) + return res + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids, [])[0] + data['select_base']=context['base'] + if len(data['base_selection'])>8: + raise osv.except_osv(_('User Error!'),_("Please select maximum 8 records to fit the page-width.")) + datas = { + 'ids': context.get('active_ids', []), + 'model': 'ir.ui.menu', + 'form': data + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'print.indicators', + 'datas': datas, + } + +account_report_print_indicators() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/wizard/account_report_print_indicators_view.xml b/addons/account_report/wizard/account_report_print_indicators_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..9add8c9a61673a755e5795d410b57cf9375fe045 --- /dev/null +++ b/addons/account_report/wizard/account_report_print_indicators_view.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_report_print_indicators_view" model="ir.ui.view"> + <field name="name">account.report.print.indicators.form</field> + <field name="model">account.report.print.indicators</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Indicators"> + <label string="Select the criteria based on which Indicators will be printed."/> + <newline/> + <field name="select_base"/> + <separator string="" colspan="4"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="next" string="Next" type="object" icon="gtk-ok" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_account_report_print_indicators" model="ir.actions.act_window"> + <field name="name">Print Indicators</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.report.print.indicators</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_report_print_indicators_view"/> + <field name="target">new</field> + </record> + + <menuitem action="action_account_report_print_indicators" + name="Print Indicators" + parent="account_report.menu_action_account_report_tree_view" id="menu_wizard_print_indicators"/> + + <record id="account_report_print_indicators_relation_view" model="ir.ui.view"> + <field name="name">account.report.print.indicators.relation.form</field> + <field name="model">account.report.print.indicators</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Indicators"> + <newline/> + <separator string="" colspan="4"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/> + </group> + </form> + </field> + </record> + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_report/wizard/wizard_print_indicators.py b/addons/account_report/wizard/wizard_print_indicators.py deleted file mode 100644 index b2c20046e8d8a54cdfa8c4870ed9dbbc30cf1d7b..0000000000000000000000000000000000000000 --- a/addons/account_report/wizard/wizard_print_indicators.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import pooler -from tools.translate import _ - -form = '''<?xml version="1.0"?> -<form string="Print Indicators"> - <label string="Select the criteria based on which Indicators will be printed."/> - <newline/> - <field name="select_base"/> -</form>''' - -fields = { - 'select_base': {'string':'Choose Criteria', 'type':'selection','selection':[('year','Based On Fiscal Years'),('periods','Based on Fiscal Periods')],'required':True,}, -} - -next_form = '''<?xml version="1.0"?> -<form string="Print Indicators"> - <field name="base_selection"/> -</form>''' - -next_fields = { - 'base_selection': {'string':'Select Criteria', 'type':'many2many','required':True,}, -} - -def _load(self, cr, uid, data, context): - data['form']['select_base'] = 'year' - return data['form'] - -def _load_base(self, cr, uid, data, context): - next_fields['base_selection']['relation']='account.fiscalyear' - if data['form']['select_base']=='periods': - next_fields['base_selection']['relation']='account.period' - return data['form'] - -def _check_len(self, cr, uid, data, context): - if len(data['form']['base_selection'][0][2])>8: - raise wizard.except_wizard(_('User Error!'),_("Please select maximum 8 records to fit the page-width.")) - return data['form'] - -class wizard_print_indicators(wizard.interface): - states = { - 'init': { - 'actions': [_load], - 'result': {'type': 'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('next','Next')]} - }, - 'next': { - 'actions': [_load_base], - 'result': {'type':'form', 'arch':next_form, 'fields':next_fields, 'state':[('end','Cancel'),('print','Print')]} - }, - 'print': { - 'actions':[_check_len], - 'result' :{'type':'print','report':'print.indicators', 'state':'end'} - } - } -wizard_print_indicators('print.indicators') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_reporting/__openerp__.py b/addons/account_reporting/__openerp__.py index d58fd77846e5c0d0e6d2edf750159d962baa9ac6..b31c7fb516b67d96abd8690af318eceeeb5d0ec7 100644 --- a/addons/account_reporting/__openerp__.py +++ b/addons/account_reporting/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -33,7 +33,8 @@ 'security/ir.model.access.csv', 'account_view.xml', 'account_report.xml', - 'account_data.xml' + 'account_data.xml', + 'wizard/account_reporting_balance_report_view.xml', ], 'demo_xml': [], 'installable': True, diff --git a/addons/account_reporting/account_report.xml b/addons/account_reporting/account_report.xml index 7385f009f31cacbd24cbf9499dcc90dadc8e072f..7603aaf5c45cc0005905a5a16f89d02d1f06691c 100644 --- a/addons/account_reporting/account_report.xml +++ b/addons/account_reporting/account_report.xml @@ -7,12 +7,12 @@ name="account.report.bs" rml="addons/account_report_bs/report/account_report_bs.rml" auto="False"/>--> - <wizard - string="Account balance" - model="account.report.bs" - name="account.account.balancesheet.report" - keyword="client_print_multi" - id="wizard_balance_report"/> +<!-- <wizard--> +<!-- string="Account balance"--> +<!-- model="account.report.bs"--> +<!-- name="account.account.balancesheet.report"--> +<!-- keyword="client_print_multi"--> +<!-- id="wizard_balance_report"/>--> </data> </openerp> diff --git a/addons/account_reporting/report/account_report_bs.py b/addons/account_reporting/report/account_report_bs.py index ba097cea8e5d5e24413a4a1aa30d6a330b6290db..89ad84d1065c21994bdb11b9e525cff5d5918c68 100644 --- a/addons/account_reporting/report/account_report_bs.py +++ b/addons/account_reporting/report/account_report_bs.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -61,7 +61,7 @@ class account_report_bs(report_sxw.rml_parse): if object: ids = [object.id] elif not ids: - ids = self.ids + ids = self.ids if not ids: return [] if not done: @@ -69,7 +69,7 @@ class account_report_bs(report_sxw.rml_parse): result = [] ctx = self.context.copy() ctx['fiscalyear'] = form['fiscalyear'] - ctx['periods'] = form['periods'][0][2] + ctx['periods'] = form['periods'] report_objs = self.pool.get('account.report.bs').browse(self.cr, self.uid, ids) title_name = False if level==1: @@ -130,7 +130,7 @@ class account_report_bs(report_sxw.rml_parse): ids2 = [(x.code,x.id) for x in report_obj.child_id] ids2.sort() result += self.lines(form,[x[1] for x in ids2], done, level+1,object=False) - + return result # def check_child_id(self,account_id,level,ctx,report_type): @@ -151,13 +151,13 @@ class account_report_bs(report_sxw.rml_parse): # for child_id in acc_child_id : # result += self.check_child_id(child_id,level+1,ctx,report_type) # return result - - - -# def _sum_credit(self): +# +# +# +# def _sum_credit(self): # return self.sum_credit # -# def _sum_debit(self): +# def _sum_debit(self): # return self.sum_debit report_sxw.report_sxw('report.account.report.bs', 'account.report.bs', 'addons/account_reporting/report/account_report_bs.rml', parser=account_report_bs) diff --git a/addons/account_reporting/wizard/__init__.py b/addons/account_reporting/wizard/__init__.py index a61b6f886339774174e652635acd5a7ae11bdc11..8371eaa5d82eceee28e0937e0d1bdcfb6738d7d7 100644 --- a/addons/account_reporting/wizard/__init__.py +++ b/addons/account_reporting/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,10 +15,10 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import wizard_account_balance_report +import account_reporting_balance_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_reporting/wizard/account_reporting_balance_report.py b/addons/account_reporting/wizard/account_reporting_balance_report.py new file mode 100644 index 0000000000000000000000000000000000000000..3f67c64b64beaefa52b2b79f2ca802db300c9941 --- /dev/null +++ b/addons/account_reporting/wizard/account_reporting_balance_report.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +from osv import fields, osv +from tools.translate import _ + +class account_reporting_balance_report(osv.osv_memory): + + def _get_fiscalyear(self, cr, uid, context=None): + """Return default Fiscalyear value""" + fiscalyear_obj = self.pool.get('account.fiscalyear') + fiscalyear = fiscalyear_obj.find(cr, uid) + return fiscalyear + + _name = 'account.reporting.balance.report' + _description = 'Account balance report' + _columns = { + 'fiscalyear': fields.many2one('account.fiscalyear', 'Fiscal year', required=True), + 'periods': fields.many2many('account.period', 'acc_reporting_relation', 'acc_id','period_id', 'Periods', help='All periods if empty'), + } + _defaults = { + 'fiscalyear' : _get_fiscalyear, + } + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.report.bs', + 'form': data + } + datas['form']['report_type'] = 'only_obj' + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.report.bs', + 'datas': datas, + } + +account_reporting_balance_report() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_reporting/wizard/account_reporting_balance_report_view.xml b/addons/account_reporting/wizard/account_reporting_balance_report_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..b554152c19d3d9742e556c645353da64d4d8da00 --- /dev/null +++ b/addons/account_reporting/wizard/account_reporting_balance_report_view.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="account_reporting_balance_report_view" model="ir.ui.view"> + <field name="name">account.reporting.balance.report.form</field> + <field name="model">account.reporting.balance.report</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Select Dates Period"> + <field name="fiscalyear"/> + <newline/> + <field name="periods"/> + <group colspan="4" col="6"> + <label string ="" colspan="2"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/> + </group> + </form> + </field> + </record> + + <record id="action_account_reporting_balance_report" model="ir.actions.act_window"> + <field name="name">Account Balance</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">account.reporting.balance.report</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="view_id" ref="account_reporting_balance_report_view"/> + <field name="target">new</field> + </record> + + <record model="ir.values" id="account_reporting_balance_report_values"> + <field name="model_id" ref="account_reporting.model_account_report_bs" /> + <field name="object" eval="1" /> + <field name="name">Account Balance</field> + <field name="key2">client_print_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_reporting_balance_report'))" /> + <field name="key">action</field> + <field name="model">account.report.bs</field> + </record> + + </data> +</openerp> diff --git a/addons/account_reporting/wizard/wizard_account_balance_report.py b/addons/account_reporting/wizard/wizard_account_balance_report.py deleted file mode 100644 index 4496ff7a56d683c1a4a163c6038fc15675673737..0000000000000000000000000000000000000000 --- a/addons/account_reporting/wizard/wizard_account_balance_report.py +++ /dev/null @@ -1,98 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import ir -import pooler -import time -import netsvc -from osv import fields, osv -import mx.DateTime -from mx.DateTime import RelativeDateTime - -from tools import config - - -dates_form = '''<?xml version="1.0"?> -<form string="Customize Report"> - <field name="fiscalyear" colspan="4"/> - <field name="periods" colspan="4"/> -</form>''' - -# <field name="report_type" colspan="4"/> - - -dates_fields = { - 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear', 'required': True}, - 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}, -# 'report_type': {'string': 'Report Type','type': 'selection','selection': [('only_obj', 'Report Objects Only'),('with_account', 'Report Objects With Accounts'),('acc_with_child', 'Report Objects With Accounts and child of Accounts'),],'required': True}, -} - -back_form='''<?xml version="1.0"?> -<form string="Notification"> -<separator string="You might have done following mistakes.Please correct them and try again." colspan="4"/> -<separator string="1. You have selected more than 3 years in any case." colspan="4"/> -<separator string="2. You have not selected 'Percentage' option,but you have selected more than 2 years." colspan="4"/> -<label string="You can select maximum 3 years.Please check again." colspan="4"/> -</form>''' - -back_fields={ -} - -zero_form='''<?xml version="1.0"?> -<form string="Notification"> -<label string="You have to select at least 1 Fiscal Year. Try again."/> -</form>''' - -zero_fields={ -} - -periods_form='''<?xml version="1.0"?> -<form string="Set Periods"> -<separator string="Select Period(s) (All periods if empty)" colspan="4"/> - <field name="periods" colspan="4" nolabel="1"/> -</form>''' - -periods_fields={ - 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'} -} - -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) - data['form']['report_type'] = 'only_obj' - return data['form'] - - states = { - 'init': { - 'actions': [_get_defaults], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('report','Print BalanceSheet')]} - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'account.report.bs', 'state':'end'} - } - } -wizard_report('account.account.balancesheet.report') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account_tax_include/i18n/cs.po b/addons/account_tax_include/i18n/cs.po index cd4dfc6f3ed6233bb83f134d2d992194a54ccb47..2cc4bc1bcc0b82bcab173e716f611d7e7119a018 100644 --- a/addons/account_tax_include/i18n/cs.po +++ b/addons/account_tax_include/i18n/cs.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-04-25 21:20+0000\n" +"PO-Revision-Date: 2010-04-26 09:10+0000\n" "Last-Translator: Martin Volf <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-26 03:41+0000\n" +"X-Launchpad-Export-Date: 2010-04-28 03:44+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_tax_include @@ -24,12 +24,12 @@ msgstr "Neplatný XML pro zobrazenà architektury" #. module: account_tax_include #: field:account.invoice,price_type:0 msgid "Price method" -msgstr "" +msgstr "Metoda urÄovánà cen" #. module: account_tax_include #: model:ir.module.module,shortdesc:account_tax_include.module_meta_information msgid "Invoices and prices with taxes included" -msgstr "" +msgstr "Faktury a ceny vÄetnÄ› danÃ" #. module: account_tax_include #: selection:account.invoice,price_type:0 diff --git a/addons/account_tax_include/i18n/oc.po b/addons/account_tax_include/i18n/oc.po new file mode 100644 index 0000000000000000000000000000000000000000..5d0f82c83d6dc7e2c5b8feef2d4bd71383393949 --- /dev/null +++ b/addons/account_tax_include/i18n/oc.po @@ -0,0 +1,53 @@ +# Occitan (post 1500) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-04-29 14:21+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) <cvalmary@yahoo.fr>\n" +"Language-Team: Occitan (post 1500) <oc@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: account_tax_include +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalid per l'arquitectura de la vista" + +#. module: account_tax_include +#: field:account.invoice,price_type:0 +msgid "Price method" +msgstr "Metòde de prètz" + +#. module: account_tax_include +#: model:ir.module.module,shortdesc:account_tax_include.module_meta_information +msgid "Invoices and prices with taxes included" +msgstr "Facturas e prèses amb taxas inclusas" + +#. module: account_tax_include +#: selection:account.invoice,price_type:0 +msgid "Tax included" +msgstr "Taxa inclusa" + +#. module: account_tax_include +#: selection:account.invoice,price_type:0 +msgid "Tax excluded" +msgstr "Fòra taxa" + +#. module: account_tax_include +#: view:account.tax:0 +msgid "Compute Code for Taxes included prices" +msgstr "Còde de calcul pels prèses amb taxas compresas" + +#. module: account_tax_include +#: field:account.invoice.line,price_subtotal_incl:0 +msgid "Subtotal" +msgstr "Sostotal" diff --git a/addons/account_voucher/__init__.py b/addons/account_voucher/__init__.py old mode 100755 new mode 100644 diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py old mode 100755 new mode 100644 index a006cb10babf7086e5e84f07f7c0cebaf9b1527e..a3813f47feefe4636f8f5c8540d29561e1446213 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -50,6 +50,7 @@ "voucher_view.xml", "voucher_wizard.xml", "account_view.xml", + "wizard/account_voucher_open_view.xml", ], 'certificate': '0037580727101', "active": False, diff --git a/addons/account_voucher/account_report.xml b/addons/account_voucher/account_report.xml old mode 100755 new mode 100644 diff --git a/addons/account_voucher/account_view.xml b/addons/account_voucher/account_view.xml old mode 100755 new mode 100644 diff --git a/addons/account_voucher/report/__init__.py b/addons/account_voucher/report/__init__.py old mode 100755 new mode 100644 diff --git a/addons/account_voucher/report/report_voucher.py b/addons/account_voucher/report/report_voucher.py old mode 100755 new mode 100644 diff --git a/addons/account_voucher/report/report_voucher_amount.py b/addons/account_voucher/report/report_voucher_amount.py old mode 100755 new mode 100644 diff --git a/addons/account_voucher/report/rml_parse.py b/addons/account_voucher/report/rml_parse.py old mode 100755 new mode 100644 diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py old mode 100755 new mode 100644 diff --git a/addons/account_voucher/voucher_view.xml b/addons/account_voucher/voucher_view.xml old mode 100755 new mode 100644 diff --git a/addons/account_voucher/voucher_wizard.xml b/addons/account_voucher/voucher_wizard.xml index 5e8a3f6ce5dd503c43d108ed48bfaae9a7a3affb..661acdd4241c6b07e296baa06b5016b4813a317b 100644 --- a/addons/account_voucher/voucher_wizard.xml +++ b/addons/account_voucher/voucher_wizard.xml @@ -1,20 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <openerp> <data> - - <wizard - id="wizard_account_voucher_open" - model="account.voucher" - name="account.voucher.open" - menu="False" - string="Open a Voucher Entry"/> - <menuitem - action="wizard_account_voucher_open" - id="menu_wizard_account_voucher_open" + +<!-- <wizard + id="wizard_account_voucher_open" + model="account.voucher" + name="account.voucher.open" + menu="False" + string="Open a Voucher Entry"/> + <menuitem + action="wizard_account_voucher_open" + id="menu_wizard_account_voucher_open" name="Open Vouchers" - sequence="0" + sequence="0" type="wizard" - parent="menu_action_voucher_list"/> + parent="menu_action_voucher_list"/> --> </data> </openerp> diff --git a/addons/account_voucher/wizard/__init__.py b/addons/account_voucher/wizard/__init__.py index 136fd1d8ee94d025c6aafd002b404edfc9fb3add..bd436ecd1355c9e702402a75c7fccfdd95cf54a3 100644 --- a/addons/account_voucher/wizard/__init__.py +++ b/addons/account_voucher/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,8 +15,8 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import open_voucher +import account_voucher_open diff --git a/addons/account_voucher/wizard/account_voucher_open.py b/addons/account_voucher/wizard/account_voucher_open.py new file mode 100644 index 0000000000000000000000000000000000000000..b286217e106a577d09631d69d59545e67a085872 --- /dev/null +++ b/addons/account_voucher/wizard/account_voucher_open.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +from osv import osv, fields +from tools.translate import _ + +_types = { + 'pay_voucher':'Cash Payment Voucher', + 'bank_pay_voucher':'Bank Payment Voucher', + 'rec_voucher':'Cash Receipt Voucher', + 'bank_rec_voucher':'Bank Receipt Voucher', + 'cont_voucher':'Contra Voucher', + 'journal_sale_vou':'Journal Sale Voucher', + 'journal_pur_voucher':'Journal Purchase Voucher' + } +_states = { + 'draft':'Draft', + 'proforma':'Pro-forma', + 'posted':'Posted', + 'cancel':'Cancel' + } + +class account_open_voucher(osv.osv_memory): + _name = "account.open.voucher" + _description = "Account Open Voucher" + + _columns = { + 'type': fields.selection([('pay_voucher','Cash Payment Voucher'), + ('bank_pay_voucher','Bank Payment Voucher'), + ('rec_voucher','Cash Receipt Voucher'), + ('bank_rec_voucher','Bank Receipt Voucher'), + ('cont_voucher','Contra Voucher'), + ('journal_sale_vou','Journal Sale Voucher'), + ('journal_pur_voucher','Journal Purchase Voucher')],'Voucher Type', required=True), + 'state': fields.selection([('draft','Draft'), + ('proforma','Pro-forma'), + ('posted','Posted'), + ('cancel','Cancel')], 'State', required=True), + 'period_ids': fields.many2many('account.period', 'voucher_period_rel', 'voucher_id', 'period_id', 'Periods'), + } + + def action_open_window(self, cr, uid, ids, context=None): + obj_period = self.pool.get('account.period') + obj_fyear = self.pool.get('account.fiscalyear') + periods = [] + if context is None: + context = {} + + form = self.read(cr, uid, ids, [])[0] + if not form['period_ids']: + year = obj_fyear.find(cr, uid) + periods = obj_period.search(cr, uid, [('fiscalyear_id','=',year)]) + else: + periods = form['period_ids'] + return { + 'domain': "[('type','=','%s'), ('state','=','%s'), ('period_id','in',%s)]" % (form['type'], form['state'], periods), + 'name': "%s - %s" % (_types[form['type']], _states[form['state']]), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'account.voucher', + 'view_id': False, + 'context': "{'type':'%s', 'state':'%s', 'period_id':%s}" % (form['type'], form['state'], periods), + 'type': 'ir.actions.act_window', + 'nodestroy': True + } + +account_open_voucher() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_voucher/wizard/account_voucher_open_view.xml b/addons/account_voucher/wizard/account_voucher_open_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..0d67c455c3f1ff814df71ae1a26f2b25401fa2a6 --- /dev/null +++ b/addons/account_voucher/wizard/account_voucher_open_view.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<openerp> + <data> + + <record id="account_open_vouchers_view" model="ir.ui.view"> + <field name="name">Open Vouchers</field> + <field name="model">account.open.voucher</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Open Vouchers"> + <field name="type"/> + <field name="state"/> + <field name="period_ids" colspan="4"/> + <group colspan="4" col="6"> + <separator colspan="6"/> + <button special="cancel" string="Cancel" icon="gtk-cancel"/> + <button name="action_open_window" string="Open Voucher Entries" type="object" icon="gtk-ok"/> + </group> + </form> + </field> + </record> + + <record id="action_account_open_vouchers" model="ir.actions.act_window"> + <field name="name">Open Vouchers</field> + <field name="res_model">account.open.voucher</field> + <field name="type">ir.actions.act_window</field> + <field name="view_type">form</field> + <field name="view_mode">tree,form</field> + <field name="view_id" ref="account_open_vouchers_view"/> + <field name="context">{'record_id':active_id}</field> + <field name="target">new</field> + </record> + + <menuitem + icon="STOCK_EXECUTE" + name="Open Vouchers" + action="action_account_open_vouchers" + id="menu_account_voucher_open" + parent="menu_action_voucher_list"/> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/account_voucher/wizard/open_voucher.py b/addons/account_voucher/wizard/open_voucher.py deleted file mode 100644 index 5a3892e1a1465a668e4cd3c7e8b0bfb143696b4f..0000000000000000000000000000000000000000 --- a/addons/account_voucher/wizard/open_voucher.py +++ /dev/null @@ -1,104 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -from tools.translate import _ -import pooler - -_voucher_form = '''<?xml version="1.0"?> -<form string="Open Vouchers"> - <field name="type"/> - <field name="state"/> - <field name="period_ids" colspan="4"/> -</form>''' - -_types = { - 'pay_voucher':'Cash Payment Voucher', - 'bank_pay_voucher':'Bank Payment Voucher', - 'rec_voucher':'Cash Receipt Voucher', - 'bank_rec_voucher':'Bank Receipt Voucher', - 'cont_voucher':'Contra Voucher', - 'journal_sale_vou':'Journal Sale Voucher', - 'journal_pur_voucher':'Journal Purchase Voucher' -} -_states = { - 'draft':'Draft', - 'proforma':'Pro-forma', - 'posted':'Posted', - 'cancel':'Cancel' -} - -_voucher_fields = { - 'type': {'string':'Voucher Type', 'type':'selection', 'selection':[ - ('pay_voucher','Cash Payment Voucher'), - ('bank_pay_voucher','Bank Payment Voucher'), - ('rec_voucher','Cash Receipt Voucher'), - ('bank_rec_voucher','Bank Receipt Voucher'), - ('cont_voucher','Contra Voucher'), - ('journal_sale_vou','Journal Sale Voucher'), - ('journal_pur_voucher','Journal Purchase Voucher')], 'required':True}, - 'state': {'string':'State', 'type':'selection', 'selection':[ - ('draft','Draft'), - ('proforma','Pro-forma'), - ('posted','Posted'), - ('cancel','Cancel')], 'required':True}, - 'period_ids': {'string':'Periods', 'type':'many2many', 'relation':'account.period'}, -} - -def _action_open_window(self, cr, uid, data, context): - form = data['form'] - periods = [] - - if not form['period_ids'][0][2]: - pool = pooler.get_pool(cr.dbname) - period = pool.get('account.period') - year = pool.get('account.fiscalyear') - - year = year.find(cr, uid) - periods = period.search(cr, uid, [('fiscalyear_id','=',year)]) - else: - periods = form['period_ids'][0][2] - - return { - 'domain': "[('type','=','%s'), ('state','=','%s'), ('period_id','in',%s)]" % (form['type'], form['state'], periods), - 'name': "%s - %s" % (_types[form['type']], _states[form['state']]), - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'account.voucher', - 'view_id': False, - 'context': "{'type':'%s', 'state':'%s', 'period_id':%s}" % (form['type'], form['state'], periods), - 'type': 'ir.actions.act_window' - } - -class OpenVoucherEntries(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type': 'form', 'arch':_voucher_form, 'fields':_voucher_fields, 'state':[('end','Cancel'),('open','Open Voucher Entries')]} - }, - 'open': { - 'actions': [], - 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'} - } - } -OpenVoucherEntries('account.voucher.open') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/analytic/__openerp__.py b/addons/analytic/__openerp__.py index c19404388a66b15cb20a53d764e1c8c0b7134ea2..143168ab8fed3a8b758f04964f75370e182e64e2 100644 --- a/addons/analytic/__openerp__.py +++ b/addons/analytic/__openerp__.py @@ -26,7 +26,7 @@ "author" : "Tiny", "website" : "http://www.openerp.com", "category" : "Generic Modules/Projects & Services", - "depends" : ["base"], + "depends" : ["base", "decimal_precision"], "description": """Module for defining analytic accounting object. """, "init_xml" : [], diff --git a/addons/analytic/project.py b/addons/analytic/project.py index 9194bd9906b7b26d9025a2738a71e38cb621cc84..2ed3fe5a67d2d9646847d8ee34b50ba276ed8828 100644 --- a/addons/analytic/project.py +++ b/addons/analytic/project.py @@ -22,8 +22,8 @@ import time import operator -from osv import fields -from osv import osv +from osv import fields, osv +import decimal_precision as dp # # Object definition @@ -282,3 +282,70 @@ class account_analytic_account(osv.osv): account_analytic_account() + +class account_analytic_line(osv.osv): + _name = 'account.analytic.line' + _description = 'Analytic lines' + def _amount_currency(self, cr, uid, ids, field_name, arg, context={}): + result = {} + for rec in self.browse(cr, uid, ids, context): + cmp_cur_id=rec.company_id.currency_id.id + aa_cur_id=rec.account_id.currency_id.id + # Always provide the amount in currency + if cmp_cur_id != aa_cur_id: + cur_obj = self.pool.get('res.currency') + ctx = {} + if rec.date and rec.amount: + ctx['date'] = rec.date + result[rec.id] = cur_obj.compute(cr, uid, rec.company_id.currency_id.id, + rec.account_id.currency_id.id, rec.amount, + context=ctx) + else: + result[rec.id]=rec.amount + return result + + def _get_account_currency(self, cr, uid, ids, field_name, arg, context={}): + result = {} + for rec in self.browse(cr, uid, ids, context): + # Always provide second currency + result[rec.id] = (rec.account_id.currency_id.id,rec.account_id.currency_id.code) + return result + def _get_account_line(self, cr, uid, ids, context={}): + aac_ids = {} + for acc in self.pool.get('account.analytic.account').browse(cr, uid, ids): + aac_ids[acc.id] = True + aal_ids = [] + if aac_ids: + aal_ids = self.pool.get('account.analytic.line').search(cr, uid, [('account_id','in',aac_ids.keys())], context=context) + return aal_ids + + _columns = { + 'name' : fields.char('Description', size=256, required=True), + 'date' : fields.date('Date', required=True), + 'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price.'), + 'unit_amount' : fields.float('Quantity', help='Specifies the amount of quantity to count.'), + 'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True), + 'user_id' : fields.many2one('res.users', 'User',), + 'company_id': fields.many2one('res.company','Company',required=True), + 'currency_id': fields.function(_get_account_currency, method=True, type='many2one', relation='res.currency', string='Account currency', + store={ + 'account.analytic.account': (_get_account_line, ['company_id'], 50), + 'account.analytic.line': (lambda self,cr,uid,ids,c={}: ids, ['amount','unit_amount'],10), + }, + help="The related account currency if not equal to the company one."), + 'amount_currency': fields.function(_amount_currency, method=True, digits_compute= dp.get_precision('Account'), string='Amount currency', + store={ + 'account.analytic.account': (_get_account_line, ['company_id'], 50), + 'account.analytic.line': (lambda self,cr,uid,ids,c={}: ids, ['amount','unit_amount'],10), + }, + help="The amount expressed in the related account currency if not equal to the company one."), + + } + _defaults = { + 'date': lambda *a: time.strftime('%Y-%m-%d'), + 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c), + } + _order = 'date' +account_analytic_line() + + diff --git a/addons/analytic_user_function/i18n/oc.po b/addons/analytic_user_function/i18n/oc.po new file mode 100644 index 0000000000000000000000000000000000000000..89de5e0ac5047f9101d501481e75bc571ac09417 --- /dev/null +++ b/addons/analytic_user_function/i18n/oc.po @@ -0,0 +1,67 @@ +# Occitan (post 1500) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-04-29 14:21+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) <cvalmary@yahoo.fr>\n" +"Language-Team: Occitan (post 1500) <oc@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-05 03:48+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: analytic_user_function +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalid per l'arquitectura de la vista" + +#. module: analytic_user_function +#: model:ir.model,name:analytic_user_function.model_analytic_user_funct_grid +msgid "Relation table between users and products on a analytic account" +msgstr "" + +#. module: analytic_user_function +#: field:analytic_user_funct_grid,product_id:0 +msgid "Product" +msgstr "Produch" + +#. module: analytic_user_function +#: field:analytic_user_funct_grid,account_id:0 +msgid "Analytic Account" +msgstr "Compte Analitic" + +#. module: analytic_user_function +#: view:account.analytic.account:0 +#: field:account.analytic.account,user_product_ids:0 +msgid "Users/Products Rel." +msgstr "Relacion Utilizaires/Produches" + +#. module: analytic_user_function +#: field:analytic_user_funct_grid,user_id:0 +msgid "User" +msgstr "Utilizaire" + +#. module: analytic_user_function +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs " +"especials !" + +#. module: analytic_user_function +#: model:ir.module.module,shortdesc:analytic_user_function.module_meta_information +msgid "Analytic User Function" +msgstr "" + +#. module: analytic_user_function +#: view:analytic_user_funct_grid:0 +msgid "User's Product for this Analytic Account" +msgstr "Produch de l'Utilizaire per aqueste Compte Analitic" diff --git a/addons/base_calendar/__init__.py b/addons/base_calendar/__init__.py old mode 100755 new mode 100644 diff --git a/addons/base_calendar/__openerp__.py b/addons/base_calendar/__openerp__.py old mode 100755 new mode 100644 diff --git a/addons/base_calendar/base_calendar_data.xml b/addons/base_calendar/base_calendar_data.xml old mode 100755 new mode 100644 diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml old mode 100755 new mode 100644 diff --git a/addons/base_calendar/wizard/__init__.py b/addons/base_calendar/wizard/__init__.py old mode 100755 new mode 100644 diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee.py b/addons/base_calendar/wizard/base_calendar_invite_attendee.py old mode 100755 new mode 100644 diff --git a/addons/base_calendar/wizard/calendar_event_edit_all.py b/addons/base_calendar/wizard/calendar_event_edit_all.py old mode 100755 new mode 100644 diff --git a/addons/base_calendar/wizard/calendar_event_edit_all_view.xml b/addons/base_calendar/wizard/calendar_event_edit_all_view.xml old mode 100755 new mode 100644 diff --git a/addons/base_contact/process/base_contact_process.xml b/addons/base_contact/process/base_contact_process.xml old mode 100755 new mode 100644 diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py index 97c0ada4bca5becf40b053f42e4b3e69180b834d..9eb3f2eda7f7eb3e7482b4df47e3edb03034a1ff 100644 --- a/addons/base_module_record/base_module_record.py +++ b/addons/base_module_record/base_module_record.py @@ -30,19 +30,34 @@ import tools #objects_proxy = netsvc.ExportService.getService('object').__class__ class recording_objects_proxy(osv_pool): def execute(self, *args, **argv): - if len(args) >= 6 and isinstance(args[5], dict): + if args[3] == 'create': + _old_args = args[4].copy() + elif args[3] == 'write': + _old_args = args[5].copy() + elif len(args) >= 5 and isinstance(args[4], dict): + _old_args = args[4].copy() + elif len(args) > 5 and args[3] != 'write' and isinstance(args[5], dict): _old_args = args[5].copy() else: _old_args = None res = super(recording_objects_proxy, self).execute(*args, **argv) pool = pooler.get_pool(args[0]) mod = pool.get('ir.module.record') + if mod and mod.recording: if args[3] not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink'): if _old_args is not None: - args[5].update(_old_args) - if args[5]: - mod.recording_data.append(('query', args, argv,res)) + if args[3] != 'write' and args[3] != 'create' and len(args) > 5 and isinstance(args[5], dict): + args=list(args) + args[5]=_old_args + args=tuple(args) + mod.recording_data.append(('osv_memory_action', args, argv ,None)) + else: + if args[3] == 'create': + args[4].update(_old_args) + elif args[3] == 'write': + args[5].update(_old_args) + mod.recording_data.append(('query', args, argv,res)) return res def exec_workflow(self, *args, **argv): @@ -54,7 +69,7 @@ class recording_objects_proxy(osv_pool): return res recording_objects_proxy() - + class xElement(minidom.Element): """dom.Element with compact print The Element in minidom has a problem: if printed, adds whitespace @@ -106,6 +121,15 @@ class eval(yaml.YAMLObject): def __repr__(self): return 'eval(%s)' % (str(self.expr,)) +class function(yaml.YAMLObject): + yaml_tag = u'!python' + def __init__(self, model, action=None,attrs={}): + self.model = model + self.action = action + self.attrs=attrs + def __repr__(self): + return '!python {model: %s}: |' % (str(self.model), ) + class base_module_record(osv.osv): _name = "ir.module.record" _columns = { @@ -125,7 +149,8 @@ class base_module_record(osv.osv): name = filter(lambda x: x in string.letters, (data.get('name','') or '').lower()) except: name='' - val = model.replace('.','_')+'_'+name+ str(i) +# name=data.get('name','') or ''.lower() + val = model.replace('.','_')+'_'+ name + str(i) i+=1 if val not in self.ids.values(): break @@ -135,7 +160,8 @@ class base_module_record(osv.osv): if type(id)==type(()): id=id[0] if (model,id) in self.ids: - return self.ids[(model,id)], False + res_id = self.ids[(model,id)] + return res_id, False dt = self.pool.get('ir.model.data') dtids = dt.search(cr, uid, [('model','=',model), ('res_id','=',id)]) if not dtids: @@ -145,7 +171,6 @@ class base_module_record(osv.osv): return obj.module+'.'+obj.name, obj.noupdate def _create_record(self, cr, uid, doc, model, data, record_id, noupdate=False): - data_pool = self.pool.get('ir.model.data') model_pool = self.pool.get(model) @@ -153,6 +178,7 @@ class base_module_record(osv.osv): record.setAttribute("id", record_id) record.setAttribute("model", model) record_list = [record] + lids = data_pool.search(cr, uid, [('model','=',model)]) res = data_pool.read(cr, uid, lids[:1], ['module']) if res: @@ -196,12 +222,16 @@ class base_module_record(osv.osv): fname = model_pool._columns[key]._fields_id else: fname = model_pool._inherit_fields[key][2]._fields_id - valitem[2][fname] = record_id - newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1]) - if not newid: + if valitem[0] == 0: newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2]) + valitem[1]=newid + else: + newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1]) + if not newid: + newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2]) + valitem[1]=newid self.ids[(fields[key]['relation'], valitem[1])] = newid - + childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid) noupdate = noupdate or update record_list += childrecord @@ -233,26 +263,31 @@ class base_module_record(osv.osv): model_pool = self.pool.get(model) data_pool = self.pool.get('ir.model.data') - lids = data_pool.search(cr, uid, [('model','=',model)]) + res = data_pool.read(cr, uid, lids[:1], ['module']) attrs={} if res: self.depends[res[0]['module']]=True fields = model_pool.fields_get(cr, uid) defaults={} - defaults[model] = model_pool.default_get(cr, uid, data) + try: + defaults[model] = model_pool.default_get(cr, uid, data) + except: + defaults[model]={} for key,val in data.items(): if ((key in defaults[model]) and (val == defaults[model][key])) and not(fields[key].get('required',False)): continue - if not (val or (fields[key]['type']=='boolean')): + if fields[key]['type'] in ('integer','float'): + if not val: + val=0.0 + attrs[key] = val + elif not (val or (fields[key]['type']=='function')): continue elif fields[key]['type'] in ('boolean',): if not val: continue attrs[key] = val - elif fields[key]['type'] in ('integer','float'): - attrs[key] = val elif fields[key]['type'] in ('many2one',): if type(val) in (type(''), type(u'')): id = val @@ -267,12 +302,9 @@ class base_module_record(osv.osv): fname = model_pool._columns[key]._fields_id else: fname = model_pool._inherit_fields[key][2]._fields_id - valitem[2][fname] = record_id - newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1]) - if not newid: - newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2]) - self.ids[(fields[key]['relation'], valitem[1])] = newid - childrecord = self._create_yaml_record(cr, uid, fields[key]['relation'],valitem[2], newid) + del valitem[2][fname] #delete parent_field from child's fields list + + childrecord = self._create_yaml_record(cr, uid, fields[key]['relation'],valitem[2], None) items[0].append(childrecord['attrs']) attrs[key] = items elif fields[key]['type'] in ('many2many',): @@ -289,11 +321,11 @@ class base_module_record(osv.osv): if m2m[0]: attrs[key] = m2m else: - val=val.replace('"','\'') try: attrs[key]=str(val) except: attrs[key]=tools.ustr(val) + attrs[key]=attrs[key].replace('"','\'') record['attrs'] = attrs return record @@ -311,7 +343,7 @@ class base_module_record(osv.osv): for f in filter(lambda a: isinstance(obj._columns[a], fields.function)\ and (not obj._columns[a].store),obj._columns): del data[f] - + for key,val in data.items(): if result.has_key(key): continue @@ -361,16 +393,16 @@ class base_module_record(osv.osv): def _generate_object_xml(self, cr, uid, rec, recv, doc, result=None): record_list = [] noupdate = False - if rec[4]=='write': - for id in rec[5]: - id,update = self._get_id(cr, uid, rec[3], id) + if rec[3]=='write': + for id in rec[4]: + id,update = self._get_id(cr, uid, rec[2], id) noupdate = noupdate or update if not id: continue - record,update = self._create_record(cr, uid, doc, rec[3], rec[6], id) + record,update = self._create_record(cr, uid, doc, rec[2], rec[5], id) noupdate = noupdate or update record_list += record - + elif rec[4] in ('menu_create',): for id in rec[5]: id,update = self._get_id(cr, uid, rec[3], id) @@ -402,9 +434,9 @@ class base_module_record(osv.osv): def _generate_object_yaml(self, cr, uid, rec, result=None): if self.mode=="create": - id = self._create_id(cr, uid, rec[2],rec[4]) - self.ids[(rec[2], result)] = id - record = self._create_yaml_record(cr, uid, rec[2], rec[4], id) + yml_id = self._create_id(cr, uid, rec[2],rec[4]) + self.ids[(rec[2], result)] = yml_id + record = self._create_yaml_record(cr, uid, rec[2], rec[4], yml_id) return record if self.mode=="workflow": id,update = self._get_id(cr, uid, rec[2], rec[4]) @@ -427,6 +459,32 @@ class base_module_record(osv.osv): self.ids[(rec[2], result)] = id return record + def _generate_function_yaml(self, cr, uid, args): + db, uid, model, action, ids, context = args + temp_context = context.copy() + active_id = temp_context['active_id'] + active_model = temp_context['active_model'] + active_id, update = self._get_id(cr, uid, active_model, active_id) + if not active_id: + active_id = 1 + rec_id, noupdate = self._get_id(cr, uid, model, ids[0]) + temp_context['active_id'] = "ref('%s')"%unicode(active_id) + temp_context['active_ids'][0] = "ref('%s')"%str(active_id) + function={} + function['model'] = model + function['action'] = action + attrs = "self.%s(cr, uid, [ref('%s')], {" %(action, rec_id, ) + for k, v in temp_context.iteritems(): + if isinstance(v, str): + f= "'"+k+"': "+"'%s'"%v + ", " + else: + v=str(v).replace('"', '') + f= "'"+k+"': "+"%s"%v + ", " + attrs = attrs + f + attrs=str(attrs)+'})' + function['attrs'] = attrs + return function + def _generate_assert_xml(self, rec, doc): pass @@ -478,16 +536,31 @@ class base_module_record(osv.osv): self.mode="copy" elif rec[0] == 'workflow': self.mode="workflow" + elif rec[0] == 'osv_memory_action': + self.mode='osv_memory_action' else: continue if self.mode == "workflow": record= self._generate_object_yaml(cr, uid, rec[1],rec[0]) yaml_file+="!comment Performing a workflow action %s on module %s"%(record['action'], record['model']) + '''\n''' object=yaml.load(unicode('''\n !workflow %s \n'''%record,'iso-8859-1')) + attrs=attrs.replace("''", '"') yaml_file += str(object) + '''\n\n''' + elif self.mode == 'osv_memory_action': + osv_action= self._generate_function_yaml(cr, uid, rec[1]) + yaml_file+="!comment Performing an osv_memory action %s on module %s"%(osv_action['action'], osv_action['model']) + '''\n''' + osv_action=yaml.load(unicode('''\n !python %s \n'''%osv_action,'iso-8859-1')) + yaml_file += str(osv_action) + '''\n''' + attrs=yaml.dump(osv_action.attrs, default_flow_style=False) + attrs=attrs.replace("''", '"') + attrs=attrs.replace("'", '') + yaml_file += attrs + '''\n\n''' else: - record= self._generate_object_yaml(cr, uid, rec[1],rec[3]) - yaml_file+="!comment Creating an %s record"%(record['model']) + '''\n''' + record= self._generate_object_yaml(cr, uid, rec[1], rec[3]) + if self.mode == "create" or self.mode == "copy": + yaml_file+="!comment Creating a %s record"%(record['model']) + '''\n''' + else: + yaml_file+="!comment Modifying a %s record"%(record['model']) + '''\n''' object= yaml.load(unicode('''\n !record %s \n'''%record,'iso-8859-1')) yaml_file += str(object) + '''\n''' attrs=yaml.dump(object.attrs, default_flow_style=False) @@ -496,9 +569,7 @@ class base_module_record(osv.osv): yaml_result='''''' for line in yaml_file.split('\n'): line=line.replace("''","'") - if line.find('!record') == 0: - line = "- \n" + " " + line - elif line.find('!workflow') == 0: + if (line.find('!record') == 0) or (line.find('!workflow') == 0) or (line.find('!python') == 0): line = "- \n" + " " + line elif line.find('!comment') == 0: line=line.replace('!comment','- \n ') diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml index 03d64eaa16ec51c17378bbdb140ea83c2a25a21f..155e934de5f586f2186456915c1a697b1ed50617 100644 --- a/addons/base_setup/base_setup_installer.xml +++ b/addons/base_setup/base_setup_installer.xml @@ -33,7 +33,6 @@ If you don't think you need any of these right now, you can easily install them <field name="report_designer" groups="base.group_extended"/> <separator string="Install Specific Business Modules" colspan="4"/> <field name="profile_association"/> - <field name="profile_training"/> <field name="profile_auction"/> <field name="profile_bookstore"/> </group> diff --git a/addons/base_setup/gtk_contact_form.py b/addons/base_setup/gtk_contact_form.py index 25324050d8e3a3e8fb3abb203a8af95a2bd0f018..112d66d2919a43e2fbb48642f49beb7225ed923f 100644 --- a/addons/base_setup/gtk_contact_form.py +++ b/addons/base_setup/gtk_contact_form.py @@ -69,7 +69,7 @@ class base_gtkcontactform(osv.osv_memory): 'other':fields.boolean('Other'), 'ebook':fields.boolean('ebook'), 'updates':fields.boolean('updates'), - 'note':fields.text('Note'), + #'note':fields.text('Note'), } def execute(self, cr, uid, ids, context=None): company_id = self.pool.get('base.setup.company').search(cr, uid, []) diff --git a/addons/base_setup/gtk_contact_form.xml b/addons/base_setup/gtk_contact_form.xml index ffae67adcf5ef7d185dd1385eb1d3894625db6aa..ab0c2dfe8ab29db51972b94df1eef4467e45bb16 100644 --- a/addons/base_setup/gtk_contact_form.xml +++ b/addons/base_setup/gtk_contact_form.xml @@ -18,7 +18,7 @@ <attribute name='colspan'>4</attribute> </xpath> <xpath expr='//separator[@string="vsep"]' position='attributes'> - <attribute name='rowspan'>27</attribute> + <attribute name='rowspan'>24</attribute> <attribute name='string'></attribute> </xpath> <group string="res_config_contents" position="replace"> @@ -47,8 +47,6 @@ <field name="support" colspan="1"/> <field name="training" colspan="1"/> <field name="other" colspan="1"/> - <separator colspan="4" string="Notes"/> - <field name="note" colspan="4" nolabel="1"/> </group> <group colspan="2"> <separator colspan="4" string="Do You Need Them ?"/> diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py index 1fb4a97110794081bdc93a8c3fecaa4a84dc398d..e38e2009e753dc9e2e943413aca68cbd924a0fc9 100644 --- a/addons/base_setup/installer.py +++ b/addons/base_setup/installer.py @@ -78,10 +78,6 @@ class base_setup_installer(osv.osv_memory): help="Installs a preselected set of OpenERP " "applications which will help you manage your association " "more efficiently."), - 'profile_training':fields.boolean('Training Centers', - help="Helps you manage your training sessions and " - "centers, from the conception of a training project to the " - "gathering of trainee feedback."), 'profile_auction':fields.boolean('Auction Houses', help="Installs a preselected set of OpenERP " "applications selected to help you manage your auctions " diff --git a/addons/caldav/DAV/davcopy.py b/addons/caldav/DAV/davcopy.py old mode 100755 new mode 100644 diff --git a/addons/caldav/DAV/davmove.py b/addons/caldav/DAV/davmove.py old mode 100755 new mode 100644 diff --git a/addons/caldav/DAV/delete.py b/addons/caldav/DAV/delete.py old mode 100755 new mode 100644 diff --git a/addons/caldav/DAV/errors.py b/addons/caldav/DAV/errors.py old mode 100755 new mode 100644 diff --git a/addons/caldav/DAV/propfind.py b/addons/caldav/DAV/propfind.py old mode 100755 new mode 100644 diff --git a/addons/caldav/DAV/utils.py b/addons/caldav/DAV/utils.py old mode 100755 new mode 100644 diff --git a/addons/caldav/wizard/__init__.py b/addons/caldav/wizard/__init__.py old mode 100755 new mode 100644 diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index b3e45a33978993d9e09afa11428cb86df8f61929..f9ec0e7d315ff42963313508efb75cb8a37be6f5 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -75,6 +75,7 @@ between mails and Open ERP.""", 'wizard/crm_opportunity_to_phonecall_view.xml', 'wizard/crm_partner_to_opportunity_view.xml', + 'wizard/crm_forward_to_partner_view.xml', 'wizard/crm_send_email_view.xml', 'wizard/crm_email_add_cc_view.xml', 'crm_view.xml', diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 85a27bb5d55b3a0720a97a6f246fc43ab76cf82c..91ef20be892cd5998e7e33b116a5ee53a0556bce 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -34,15 +34,15 @@ AVAILABLE_STATES = [ ('open', 'Open'), ('cancel', 'Cancelled'), ('done', 'Closed'), - ('pending', 'Pending') + ('pending', 'Pending'), ] AVAILABLE_PRIORITIES = [ - ('5', 'Lowest'), - ('4', 'Low'), - ('3', 'Normal'), + ('1', 'Highest'), ('2', 'High'), - ('1', 'Highest') + ('3', 'Normal'), + ('4', 'Low'), + ('5', 'Lowest'), ] class crm_case_section(osv.osv): @@ -516,7 +516,7 @@ class crm_case(osv.osv): @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param ids: List of Case ids + @param cases: a browse record list @param keyword: Case action keyword e.g.: If case is closed "Close" keyword is used @param history: Value True/False, If True it makes entry in case History otherwise in Case Log @param email: Email address if any @@ -525,6 +525,10 @@ class crm_case(osv.osv): if not context: context = {} + # The mailgate sends the ids of the cases and not the object list + if all(isinstance(case_id, (int, long)) for case_id in cases) and context.get('model'): + cases = self.pool.get(context['model']).browse(cr, uid, cases, context=context) + model_obj = self.pool.get('ir.model') obj = self.pool.get('crm.case.log') for case in cases: diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 03318270e9bc8debe77e01ff49a5473c075f6aaf..f89c558fee40811be99f3535d93a504392cdbdc4 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -174,15 +174,20 @@ icon="gtk-undo" type="action" /> </form> <tree string="Communication history"> - <field name="description"/> - <field name="email_to"/> + <field name="name" /> <field name="date"/> + <field name="email_from" /> + <field name="email_to"/> + <field name="description"/> </tree> </field> - <button colspan="4" string="Send New Email" + <button colspan="2" string="Send New Email" name="%(action_crm_send_mail)d" context="{'mail':'new', 'model': 'crm.lead'}" icon="gtk-go-forward" type="action" /> + <button colspan="2" string="Forward to Partner" + name="%(crm_lead_forward_to_partner_act)d" + icon="gtk-go-forward" type="action" /> </page> </notebook> diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index 076919d5fb3fec9131975fbb358b63634e253990..e56ccb7b1b0565394a32aa4331e3c12fdb69137f 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -190,10 +190,13 @@ <field name="date"/> </tree> </field> - <button colspan="4" string="Send New Email" + <button colspan="2" string="Send New Email" name="%(action_crm_send_mail)d" context="{'mail':'new', 'model': 'crm.opportunity'}" icon="gtk-go-forward" type="action" /> + <button colspan="2" string="Forward to Partner" + name="%(crm_opportunity_forward_to_partner_act)d" + icon="gtk-go-forward" type="action" /> </page> </notebook> </form> diff --git a/addons/crm/i18n/es.po b/addons/crm/i18n/es.po index 135128bc3ebf0020eb3286e2433120146d601be0..b9424d024dda7f209de1417bb76c7cc5f903785b 100644 --- a/addons/crm/i18n/es.po +++ b/addons/crm/i18n/es.po @@ -7,13 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2010-01-05 05:59+0000\n" -"PO-Revision-Date: 2010-03-30 21:03+0000\n" -"Last-Translator: Luis Gerardo Cruz Garcia <lgcruz@morfosys.com>\n" +"PO-Revision-Date: 2010-04-29 10:04+0000\n" +"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " +"<jesteve@zikzakmedia.com>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:02+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: crm @@ -79,7 +80,7 @@ msgstr "Botón oprimido" #. module: crm #: view:crm.case:0 msgid "Planned costs" -msgstr "Costos planeados" +msgstr "Costos previstos" #. module: crm #: wizard_field:crm.job.partner_create,init,close:0 @@ -89,7 +90,7 @@ msgstr "Requerimiento de trabajo a finalizar" #. module: crm #: field:crm.case.stage,name:0 msgid "Stage Name" -msgstr "Nombre de etapa" +msgstr "Nombre de fase" #. module: crm #: view:crm.case:0 @@ -174,7 +175,7 @@ msgstr "Busqueda de oportunidades" #: model:ir.ui.menu,name:crm.menu_crm_case_section_stage_tree #: view:report.crm.case.section.stage:0 msgid "Cases by Section and Stage" -msgstr "Casos por sección y estados" +msgstr "Casos por sección y fase" #. module: crm #: wizard_field:crm.job.meeting_set,init,duration:0 @@ -222,7 +223,7 @@ msgstr "" #: wizard_field:crm.phonecall.opportunity_set,opportunity,partner_id:0 #: model:process.node,name:crm.process_node_partner0 msgid "Partner" -msgstr "Compañero" +msgstr "Empresa" #. module: crm #: field:crm.case.categ,section_id:0 @@ -256,7 +257,7 @@ msgstr "Llamada de telefono" #. module: crm #: model:ir.model,name:crm.model_report_crm_case_section_stage msgid "Cases by section and stage" -msgstr "Casos por secciòn y estado" +msgstr "Casos por sección y fase" #. module: crm #: field:crm.case.rule,act_mail_to_email:0 @@ -297,7 +298,7 @@ msgstr "Criterios" #: model:ir.actions.act_window,name:crm.crm_case_section_act #: model:ir.ui.menu,name:crm.menu_crm_case_section_act msgid "Sections" -msgstr "Secciónes" +msgstr "Secciones" #. module: crm #: help:crm.menu.config_wizard,opportunity:0 @@ -421,6 +422,8 @@ msgid "" "customer. With each commercial opportunity, you can indicate the canall " "which is this opportunity source." msgstr "" +"Los canales representan las diferentes maneras que existen de comunicación " +"con el cliente. A cada oportunidad se le puede indicar de que canal provino." #. module: crm #: view:crm.meeting:0 @@ -477,7 +480,7 @@ msgstr "Cliente existente" #. module: crm #: model:crm.case.category2,name:crm.category_meet2 msgid "Home" -msgstr "" +msgstr "Particular" #. module: crm #: field:crm.case,categ_id:0 @@ -578,7 +581,7 @@ msgstr "Crear oportunidad" #: selection:report.crm.case.section.categ2,month:0 #: selection:report.crm.case.section.stage,month:0 msgid "August" -msgstr "" +msgstr "Agosto" #. module: crm #: view:crm.meeting:0 @@ -611,7 +614,7 @@ msgstr "Gestión de relaciones con clientes & proveedores" #: view:crm.email.add.cc:0 #: model:ir.actions.act_window,name:crm.action_view_crm_email_add_cc_wizard msgid "Add CC" -msgstr "Agregar CC" +msgstr "Añadir CC" #. module: crm #: selection:report.crm.case.section.categ.categ2,month:0 @@ -634,7 +637,7 @@ msgstr "Rechazado por la compañÃa" #. module: crm #: field:crm.case,planned_revenue:0 msgid "Planned Revenue" -msgstr "Retorno planeado" +msgstr "Ingresos previstos" #. module: crm #: field:crm.case.section,allow_unlink:0 @@ -904,7 +907,7 @@ msgstr "Buscar llamadas" #: wizard_button:crm.lead.opportunity_set,create_partner,create:0 #: wizard_button:crm.phonecall.opportunity_set,create_partner,create:0 msgid "Continue" -msgstr "Continue" +msgstr "Siguiente" #. module: crm #: field:crm.segmentation,som_interval:0 @@ -959,7 +962,7 @@ msgstr "Establecer grado a" #: code:addons/crm/crm.py:0 #, python-format msgid "Email!" -msgstr "" +msgstr "Correo electrónico!" #. module: crm #: model:crm.case.category2,name:crm.category_lead6 @@ -969,7 +972,7 @@ msgstr "Radio" #. module: crm #: model:ir.model,name:crm.model_crm_opportunity_assign_wizard msgid "crm.opportunity.assign_wizard" -msgstr "" +msgstr "crm.opportunity.assign_wizard" #. module: crm #: view:crm.case.rule:0 @@ -990,7 +993,7 @@ msgstr "Buscar en Historial" #: help:crm.case.stage,sequence:0 msgid "Gives the sequence order when displaying a list of case stages." msgstr "" -"Da el orden de secuencia cuando se muestra un lista de etápas de caso." +"Indica el orden de secuencia cuando se muestra un lista de fases de casos." #. module: crm #: model:crm.case.section,name:crm.section_support3 @@ -1024,7 +1027,7 @@ msgstr "Importe de compra" #. module: crm #: view:crm.phonecall:0 msgid "Direction" -msgstr "" +msgstr "Dirección" #. module: crm #: help:crm.case,email_cc:0 @@ -1059,7 +1062,7 @@ msgstr "Reglas" #: wizard_view:crm.job.meeting_set,init:0 #: wizard_view:crm.phonecall.meeting_set,init:0 msgid "Plan Meeting" -msgstr "" +msgstr "Planear reunión" #. module: crm #: wizard_field:crm.new.send.mail,init,state:0 @@ -1090,7 +1093,7 @@ msgstr "<" #. module: crm #: view:crm.case.rule:0 msgid "%(case_description)s = Case description" -msgstr "" +msgstr "%(case_description)s = Descripción del caso" #. module: crm #: view:crm.fundraising:0 @@ -1111,7 +1114,7 @@ msgstr "Nombre de regla" #. module: crm #: field:crm.case,planned_cost:0 msgid "Planned Costs" -msgstr "Costos planeados" +msgstr "Costos previstos" #. module: crm #: model:ir.model,name:crm.model_crm_case_history @@ -1293,7 +1296,7 @@ msgstr "El prospecto se convierte a partner" #. module: crm #: view:crm.case.rule:0 msgid "Regex on Case Name" -msgstr "" +msgstr "Expresión regular del nombre del caso" #. module: crm #: view:crm.claim:0 @@ -1303,7 +1306,7 @@ msgstr "Reclamaciones Pendientes" #. module: crm #: model:ir.ui.menu,name:crm.menu_action_report_crm_case_oppor_categ_stage msgid "Cases by Opportunities, Category and Stage" -msgstr "Casos por oportunidades, categorÃa y etapa" +msgstr "Casos por oportunidades, categorÃa y fase" #. module: crm #: model:crm.case.category2,name:crm.category_lead4 @@ -1416,8 +1419,8 @@ msgid "" "If the active field is set to true, it will allow you to hide the case " "section without removing it." msgstr "" -"Si el campo activo esta en verdadero, te permitira esconder la sección del " -"caso sin removerla" +"Si el campo activo está marcado, podrá ocultar la sección del caso sin " +"eliminarla." #. module: crm #: model:crm.case.categ,name:crm.categ_fund2 @@ -1435,31 +1438,31 @@ msgstr "Estas seguro que deseas crear una empresa basado en esta llamada?" #: model:ir.actions.act_window,name:crm.crm_case_stage_act #: model:ir.ui.menu,name:crm.menu_crm_case_stage_act msgid "Stages" -msgstr "Etapas" +msgstr "Fases" #. module: crm #: wizard_field:crm.case.opportunity.partner_opportunity,init,planned_revenue:0 #: wizard_field:crm.lead.opportunity_set,opportunity,planned_revenue:0 #: wizard_field:crm.phonecall.opportunity_set,opportunity,planned_revenue:0 msgid "Expected Revenue" -msgstr "" +msgstr "Ingreso estimado" #. module: crm #: view:crm.meeting:0 msgid "Meeting Date" -msgstr "" +msgstr "Fecha de reunión" #. module: crm #: view:crm.job:0 #: view:crm.lead:0 #: view:crm.phonecall:0 msgid "Convert to Partner" -msgstr "" +msgstr "Convertir a empresa" #. module: crm #: model:ir.actions.act_window,name:crm.crm_case_category_act_meetall3 msgid "Next Meetings" -msgstr "" +msgstr "Próximas reuniones" #. module: crm #: field:crm.segmentation,partner_id:0 @@ -1475,7 +1478,7 @@ msgstr "No puede eliminar este caso. SerÃa mejor que lo cancelara." #. module: crm #: wizard_button:caldav.crm.subscribe,init,open:0 msgid "_Subscribe" -msgstr "" +msgstr "_Suscribir" #. module: crm #: field:crm.case.rule,trg_priority_from:0 @@ -1485,22 +1488,22 @@ msgstr "Prioridad mÃnima" #. module: crm #: model:ir.actions.act_window,name:crm.crm_meeting_generic_wizard_act msgid "Meeting Generic Wizard" -msgstr "" +msgstr "Asistente genérico de reuniones" #. module: crm #: model:crm.case.categ,name:crm.categ_claim2 msgid "Value Claims" -msgstr "" +msgstr "Valor reclamaciones" #. module: crm #: wizard_view:caldav.crm.subscribe,display:0 msgid "Message..." -msgstr "" +msgstr "Mensaje..." #. module: crm #: model:ir.model,name:crm.model_crm_phonecall_assign_wizard msgid "crm.phonecall.assign_wizard" -msgstr "" +msgstr "crm.phonecall.assign_wizard" #. module: crm #: view:report.crm.case.section.categ2:0 @@ -2179,7 +2182,7 @@ msgstr "" #: view:crm.job:0 #: view:crm.lead:0 msgid "Stage: " -msgstr "" +msgstr "Fase: " #. module: crm #: view:crm.case.section:0 @@ -2806,7 +2809,7 @@ msgstr "" #. module: crm #: view:crm.case:0 msgid "Cases By Stage and Estimates" -msgstr "" +msgstr "Casos por fases y estimaciones" #. module: crm #: code:addons/crm/crm.py:0 @@ -3004,7 +3007,7 @@ msgstr "" #. module: crm #: model:ir.model,name:crm.model_report_crm_case_section_categ_stage msgid "Cases by section, Category and stage" -msgstr "" +msgstr "Casos por sección, categorÃa y fase" #. module: crm #: view:crm.job:0 @@ -3297,7 +3300,7 @@ msgstr "Recordatorios por Email (incluye el contenido del caso)" #. module: crm #: model:ir.ui.menu,name:crm.menu_action_report_crm_case_lead_stage msgid "Cases by Leads and Stage" -msgstr "" +msgstr "Casos por iniciativas y fase" #. module: crm #: field:crm.meeting,exdate:0 @@ -3410,7 +3413,7 @@ msgstr "" #. module: crm #: view:crm.opportunity:0 msgid "Sales Stage: " -msgstr "" +msgstr "Fase de ventas: " #. module: crm #: view:crm.claim:0 @@ -3692,7 +3695,7 @@ msgstr "Secciones hijas" #. module: crm #: view:crm.case:0 msgid "Planned revenue" -msgstr "Retorno planeado" +msgstr "Ingresos previstos" #. module: crm #: model:crm.case.categ,name:crm.categ_fund3 @@ -3731,7 +3734,7 @@ msgstr "" #. module: crm #: model:ir.model,name:crm.model_crm_case_stage msgid "Stage of case" -msgstr "" +msgstr "Fase del caso" #. module: crm #: view:crm.case:0 diff --git a/addons/crm/process/crm_configuration_process.xml b/addons/crm/process/crm_configuration_process.xml old mode 100755 new mode 100644 diff --git a/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py b/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py index 5e6ab5a094ce87e307735dfaa464a784b6c99095..607b0fbd434f7bc792261f08242d6e2d70420c3b 100755 --- a/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py +++ b/addons/crm/scripts/openerp_mailgate/openerp_mailgate.py @@ -189,7 +189,7 @@ class email_parser(object): try: id = self.rpc(self.model, 'create', data) - self.rpc(self.model, 'history', [id], 'Receive', True, msg['From'], message['body']) + self.rpc(self.model, 'history', [id], 'Receive', True, msg['From'], message['body'], False, False, {'model' : self.model}) #self.rpc(self.model, 'case_open', [id]) except Exception, e: if getattr(e, 'faultCode', '') and 'AccessError' in e.faultCode: @@ -284,10 +284,10 @@ class email_parser(object): act = 'case_' + actions['state'] for k1, k2 in [('cost', 'planned_cost'), ('revenue', 'planned_revenue'), ('probability', 'probability')]: - try: - data[k2] = float(actions[k1]) - except: - pass + try: + data[k2] = float(actions[k1]) + except: + pass if 'priority' in actions: if actions['priority'] in ('1', '2', '3', '4', '5'): diff --git a/addons/crm/wizard/__init__.py b/addons/crm/wizard/__init__.py index f3d92447acd506adcbf56a65837557fc5bd399ea..a9067d9fa0be9775a681e473f1ddeedc9c251681 100644 --- a/addons/crm/wizard/__init__.py +++ b/addons/crm/wizard/__init__.py @@ -20,6 +20,7 @@ ############################################################################## import crm_send_email +import crm_forward_to_partner import crm_email_add_cc import crm_lead_to_partner diff --git a/addons/crm/wizard/crm_forward_to_partner.py b/addons/crm/wizard/crm_forward_to_partner.py new file mode 100644 index 0000000000000000000000000000000000000000..413747739c2e2c5f0a3adfd8ae3383e4af545274 --- /dev/null +++ b/addons/crm/wizard/crm_forward_to_partner.py @@ -0,0 +1,285 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# 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, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +from osv import osv, fields + +from tools.translate import _ +import tools + +class crm_lead_forward_to_partner(osv.osv_memory): + _name = 'crm.lead.forward.to.partner' + + _columns = { + 'partner_id' : fields.many2one('res.partner', 'Partner'), + 'address_id' : fields.many2one('res.partner.address', 'Address'), + 'email_from' : fields.char('From', required=True, size=128), + 'email_to' : fields.char('To', required=True, size=128), + 'subject' : fields.char('Subject', required=True, size=128), + 'message' : fields.text('Message', required=True), + } + + def on_change_partner(self, cr, uid, ids, partner_id): + return { + 'domain' : { + 'address_id' : partner_id and "[('partner_id', '=', partner_id)]" or "[]", + } + } + + def on_change_address(self, cr, uid, ids, address_id): + email = '' + if address_id: + email = self.pool.get('res.partner.address').browse(cr, uid, address_id).email + + return { + 'value' : { + 'email_to' : email, + } + } + + def action_cancel(self, cr, uid, ids, context=None): + return {'type' : 'ir.actions.act_window_close'} + + def action_forward(self, cr, uid, ids, context=None): + """ + Forward the lead to a partner + """ + if context is None: + context = {} + + res_id = context.get('active_id', False) + + if not res_id: + return {} + + this = self.browse(cr, uid, ids[0], context=context) + + hist_obj = self.pool.get('crm.case.history') + smtp_pool = self.pool.get('email.smtpclient') + case_pool = self.pool.get('crm.lead') + case = case_pool.browse(cr, uid, res_id, context=context) + + emails = [this.email_to] + body = case_pool.format_body(this.message) + email_from = this.email_from or False + case_pool._history(cr, uid, [case], _('Forward'), history=True, email=this.email_to, details=body, email_from=email_from) + + flag = False + if case.section_id and case.section_id.server_id: + flag = smtp_pool.send_email( + cr=cr, + uid=uid, + server_id=case.section_id.server_id.id, + emailto=emails, + subject=this.subject, + body="<pre>%s</pre>" % body, + ) + else: + flag = tools.email_send( + email_from, + emails, + this.subject, + body, + ) + + return {} + + def default_get(self, cr, uid, fields, context=None): + """ + This function gets default values + """ + if context is None: + context = {} + + active_ids = context.get('active_ids') + if not active_ids: + return {} + + lead_proxy = self.pool.get('crm.lead') + + lead = lead_proxy.browse(cr, uid, active_ids[0], context=context) + + field_names = [ + 'partner_name', 'title', 'function_name', 'street', 'street2', + 'zip', 'city', 'country_id', 'state_id', 'email_from', + 'phone', 'fax', 'mobile' + ] + + message = [] + + for field_name in field_names: + field_definition = lead_proxy._columns[field_name] + value = None + + if field_definition._type == 'selection': + if hasattr(field_definition.selection, '__call__'): + key = field_definition.selection(lead_proxy, cr, uid, context=context) + else: + key = field.definition.selection + value = dict(key).get(lead[field_name], lead[field_name]) + elif field_definition._type == 'many2one': + if lead[field_name]: + value = lead[field_name].name_get()[0][1] + else: + value = lead[field_name] + + message.append("%s: %s" % (field_definition.string, value or '')) + + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + email_from = '' + if user.address_id and user.address_id.email: + email_from = "%s <%s>" % (user.name, user.address_id.email) + + res = { + 'email_from' : email_from, + 'subject' : '[Lead-Forward:%06d] %s' % (lead.id, lead.name), + 'message' : "\n".join(message + ['---']), + } + + return res + +crm_lead_forward_to_partner() + +class crm_opportunity_forward_to_partner(osv.osv_memory): + _name = 'crm.opportunity.forward.to.partner' + + _columns = { + 'partner_id' : fields.many2one('res.partner', 'Partner'), + 'address_id' : fields.many2one('res.partner.address', 'Address'), + 'email_from' : fields.char('From', required=True, size=128), + 'email_to' : fields.char('To', required=True, size=128), + 'subject' : fields.char('Subject', required=True, size=128), + 'message' : fields.text('Message', required=True), + } + + def on_change_partner(self, cr, uid, ids, partner_id): + return { + 'domain' : { + 'address_id' : partner_id and "[('partner_id', '=', partner_id)]" or "[]", + } + } + + def on_change_address(self, cr, uid, ids, address_id): + email = '' + if address_id: + email = self.pool.get('res.partner.address').browse(cr, uid, address_id).email + + return { + 'value' : { + 'email_to' : email, + } + } + + def action_cancel(self, cr, uid, ids, context=None): + return {'type' : 'ir.actions.act_window_close'} + + def action_forward(self, cr, uid, ids, context=None): + """ + Forward the opportunity to a partner + """ + if context is None: + context = {} + + res_id = context.get('active_id', False) + + if not res_id: + return {} + + this = self.browse(cr, uid, ids[0], context=context) + + hist_obj = self.pool.get('crm.case.history') + smtp_pool = self.pool.get('email.smtpclient') + case_pool = self.pool.get('crm.opportunity') + case = case_pool.browse(cr, uid, res_id, context=context) + + emails = [this.email_to] + body = case_pool.format_body(this.message) + email_from = this.email_from or False + case_pool._history(cr, uid, [case], _('Forward'), history=True, email=this.email_to, details=body, email_from=email_from) + + flag = False + if case.section_id and case.section_id.server_id: + flag = smtp_pool.send_email( + cr=cr, + uid=uid, + server_id=case.section_id.server_id.id, + emailto=emails, + subject=this.subject, + body="<pre>%s</pre>" % body, + ) + else: + flag = tools.email_send( + email_from, + emails, + this.subject, + body, + ) + + return {} + + def default_get(self, cr, uid, fields, context=None): + """ + This function gets default values + """ + if context is None: + context = {} + + active_ids = context.get('active_ids') + if not active_ids: + return {} + + opportunity_proxy = self.pool.get('crm.opportunity') + + opportunity = opportunity_proxy.browse(cr, uid, active_ids[0], context=context) + + pa = opportunity.partner_address_id + message = [ + "Partner: %s" % (opportunity.partner_id.name_get()[0][1]), + "Contact: %s" % (pa.name), + "Title: %s" % (pa.title), + "Function: %s" % (pa.function and pa.function.name_get()[0][1] or ''), + "Street: %s" % (pa.street), + "Street2: %s" % (pa.street2), + "Zip: %s" % (pa.zip), + "City: %s" % (pa.city), + "Country: %s" % (pa.country_id and pa.country_id.name_get()[0][1] or ''), + "State: %s" % (pa.state_id and pa.state_id.name_get()[0][1] or ''), + "Email: %s" % (pa.email), + "Phone: %s" % (pa.phone), + "Fax: %s" % (pa.fax), + "Mobile: %s" % (pa.mobile), + ] + + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + email_from = '' + if user.address_id and user.address_id.email: + email_from = "%s <%s>" % (user.name, user.address_id.email) + + res = { + 'email_from' : email_from, + 'subject' : '[Opportunity-Forward:%06d] %s' % (opportunity.id, opportunity.name), + 'message' : "\n".join(message + ['---']), + } + + return res + +crm_opportunity_forward_to_partner() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/wizard/crm_forward_to_partner_view.xml b/addons/crm/wizard/crm_forward_to_partner_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..8f238333a29284df1ff97099b9b0b61e1e358a69 --- /dev/null +++ b/addons/crm/wizard/crm_forward_to_partner_view.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<openerp> + <data> + <record model="ir.ui.view" id="crm_lead_forward_to_partner_form"> + <field name="name">crm_lead_forward_to_partner</field> + <field name="model">crm.lead.forward.to.partner</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Forward to Partner"> + <separator string="User" colspan="4" /> + <field name="email_from" colspan="4" /> + + <separator string="Destination" colspan="4" /> + <field name="partner_id" on_change="on_change_partner(partner_id)" colspan="4" /> + <field name="address_id" string="Contact" on_change="on_change_address(address_id)" colspan="4" /> + <field name="email_to" colspan="4" /> + + <separator string="Email" colspan="4" /> + <field name="subject" colspan="4" /> + <field name="message" colspan="4" /> + <separator string="" colspan="4" /> + <group colspan="4" col="2"> + <button name="action_cancel" special="cancel" string="Cancel" icon="gtk-cancel" type="object" /> + <button name="action_forward" string="Forward" icon="gtk-go-forward" type="object" /> + </group> + </form> + </field> + </record> + + <record model="ir.actions.act_window" id="crm_lead_forward_to_partner_act"> + <field name="name">Forward to Partner</field> + <field name="res_model">crm.lead.forward.to.partner</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <record model="ir.ui.view" id="crm_opportunity_forward_to_partner_form"> + <field name="name">crm_opportunity_forward_to_partner</field> + <field name="model">crm.opportunity.forward.to.partner</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Forward to Partner"> + <separator string="User" colspan="4" /> + <field name="email_from" colspan="4" /> + + <separator string="Destination" colspan="4" /> + <field name="partner_id" on_change="on_change_partner(partner_id)" colspan="4" /> + <field name="address_id" string="Contact" on_change="on_change_address(address_id)" colspan="4" /> + <field name="email_to" colspan="4" /> + + <separator string="Email" colspan="4" /> + <field name="subject" colspan="4" /> + <field name="message" colspan="4" /> + <separator string="" colspan="4" /> + <group colspan="4" col="2"> + <button name="action_cancel" special="cancel" string="Cancel" icon="gtk-cancel" type="object" /> + <button name="action_forward" string="Forward" icon="gtk-go-forward" type="object" /> + </group> + </form> + </field> + </record> + + <record model="ir.actions.act_window" id="crm_opportunity_forward_to_partner_act"> + <field name="name">Forward to Partner</field> + <field name="res_model">crm.opportunity.forward.to.partner</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + </data> +</openerp> diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py index a0f91fb2ae500bcfec27a2ba4d99d9d69730e43c..b0d20cd6e5559435a04ca722a68e2e6997881268 100644 --- a/addons/crm/wizard/crm_send_email.py +++ b/addons/crm/wizard/crm_send_email.py @@ -76,7 +76,8 @@ class crm_send_new_email(osv.osv_memory): case = case_pool.browse(cr, uid, res_id) if context.get('mail', 'new') == 'new': - message_id = case.history_line[0].message_id + if len(case.history_line): + message_id = case.history_line[0].message_id else: hist = hist_obj.browse(cr, uid, res_id) message_id = hist.message_id @@ -92,9 +93,11 @@ class crm_send_new_email(osv.osv_memory): case_pool._history(cr, uid, [case], _('Send'), history=True, email=data['email_to'], details=body, email_from=email_from, message_id=message_id) x_headers = { - 'References':"%s" % (message_id), 'Reply-To':"%s" % case.section_id.reply_to, } + if message_id: + x_headers['References'] = "%s" % (message_id) + flag = False if case.section_id and case.section_id.server_id: flag = smtp_pool.send_email( @@ -159,13 +162,15 @@ class crm_send_new_email(osv.osv_memory): if 'email_from' in fields: res.update({'email_from': (case.section_id and case.section_id.reply_to) or \ (case.user_id and case.user_id.address_id and \ - case.user_id.address_id.email) or tools.config.get('email_from',False)}) + case.user_id.address_id.email and \ + "%s <%s>" % (case.user_id.name, case.user_id.address_id.email)) or \ + tools.config.get('email_from',False)}) if 'subject' in fields: res.update({'subject': '[%s] %s' %(str(case.id), case.name or '')}) if 'email_cc' in fields: res.update({'email_cc': case.email_cc or ''}) if 'text' in fields: - res.update({'text': '\n\n'+(case.user_id.signature or '') + '\n\n' + (case.description or '')}) + res.update({'text': '\n\n'+(case.user_id.signature or '')}) if 'state' in fields: res.update({'state': 'pending'}) return res diff --git a/addons/crm/wizard/crm_send_email_view.xml b/addons/crm/wizard/crm_send_email_view.xml index 4db670de61fdce0230a4514ad623acae135a6dec..49758245eb0048c1af6934c80728fd30abbce0ef 100644 --- a/addons/crm/wizard/crm_send_email_view.xml +++ b/addons/crm/wizard/crm_send_email_view.xml @@ -20,11 +20,11 @@ </page> <page string="Attachments"> <field name="doc1" filename="doc1_fname"/> - <field name="doc1_fname"/> + <field name="doc1_fname" invisible="1" /> <field name="doc2" filename="doc2_fname" /> - <field name="doc2_fname"/> + <field name="doc2_fname" invisible="1" /> <field name="doc3" filename="doc3_fname" /> - <field name="doc3_fname"/> + <field name="doc3_fname" invisible="1" /> </page> </notebook> <group colspan="2" col="4" > diff --git a/addons/crm_profiling/i18n/ru.po b/addons/crm_profiling/i18n/ru.po index 16c4e3aeb7957b4a997fa8955365cb496f95aead..cc9231b12fa44041506bf5770d345ad53f831dbb 100644 --- a/addons/crm_profiling/i18n/ru.po +++ b/addons/crm_profiling/i18n/ru.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2008-11-01 16:12+0000\n" -"Last-Translator: Sergei Kostigoff <sergei.kostigoff@gmail.com>\n" +"PO-Revision-Date: 2010-05-01 15:57+0000\n" +"Last-Translator: g0nz1k12 <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:17+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:48+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: crm_profiling @@ -116,7 +116,7 @@ msgstr "" #. module: crm_profiling #: field:crm.segmentation,profiling_active:0 msgid "Use The Profiling Rules" -msgstr "" +msgstr "ИÑпользуйте Правила ПрофилированиÑ" #. module: crm_profiling #: view:crm_profiling.question:0 @@ -147,7 +147,7 @@ msgstr "ВопроÑÑ‹" #. module: crm_profiling #: field:crm.segmentation,parent_id:0 msgid "Parent Profile" -msgstr "" +msgstr "РодительÑкий Профиль" #. module: crm_profiling #: wizard_button:open_questionnaire,init,end:0 diff --git a/addons/delivery/i18n/pl.po b/addons/delivery/i18n/pl.po index abbc1ce1987e5879cc3ad62c1b83c17c193008a6..d395d60a8a21a4d702b1bd2b1ebb36758d52b2fd 100644 --- a/addons/delivery/i18n/pl.po +++ b/addons/delivery/i18n/pl.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-11-21 16:05+0000\n" -"Last-Translator: Andrzej MoST (Marcin Ostajewski) <Unknown>\n" +"PO-Revision-Date: 2010-05-03 08:04+0000\n" +"Last-Translator: Piotr Lipski <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: delivery @@ -27,7 +27,7 @@ msgstr "" #. module: delivery #: selection:delivery.grid.line,operator:0 msgid ">=" -msgstr "" +msgstr ">=" #. module: delivery #: view:res.partner:0 @@ -62,7 +62,7 @@ msgstr "Stany" #. module: delivery #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "" +msgstr "NieprawidÅ‚owa nazwa modelu w definicji akcji." #. module: delivery #: help:res.partner,property_delivery_carrier:0 diff --git a/addons/document/test_cindex.py b/addons/document/test_cindex.py old mode 100755 new mode 100644 diff --git a/addons/document_webdav/DAV/davcopy.py b/addons/document_webdav/DAV/davcopy.py old mode 100755 new mode 100644 diff --git a/addons/document_webdav/DAV/davmove.py b/addons/document_webdav/DAV/davmove.py old mode 100755 new mode 100644 diff --git a/addons/document_webdav/DAV/delete.py b/addons/document_webdav/DAV/delete.py old mode 100755 new mode 100644 diff --git a/addons/document_webdav/DAV/errors.py b/addons/document_webdav/DAV/errors.py old mode 100755 new mode 100644 diff --git a/addons/document_webdav/DAV/propfind.py b/addons/document_webdav/DAV/propfind.py old mode 100755 new mode 100644 diff --git a/addons/document_webdav/DAV/utils.py b/addons/document_webdav/DAV/utils.py old mode 100755 new mode 100644 diff --git a/addons/document_webdav/i18n/et.po b/addons/document_webdav/i18n/et.po new file mode 100644 index 0000000000000000000000000000000000000000..dc3cbb28cb2dbfa39424d7e33dde0e5a8baa7531 --- /dev/null +++ b/addons/document_webdav/i18n/et.po @@ -0,0 +1,31 @@ +# Estonian translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-05-30 15:14+0000\n" +"PO-Revision-Date: 2010-05-05 21:44+0000\n" +"Last-Translator: lyyser <logard.1961@gmail.com>\n" +"Language-Team: Estonian <et@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: document_webdav_old +#: model:ir.module.module,description:document_webdav_old.module_meta_information +msgid "" +"This is a complete document management system:\n" +"\t* WebDav Interface\n" +"\t* User Authentification\n" +"\t* Document Indexation\n" +msgstr "" +"See on terviklik juhtimissüsteemi dokument:\n" +"\t* WebDav liides\n" +"\t* Kasutaja audentimise\n" +"\t* Dokumendi indekseerimine\n" diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py index 611b7c178fb2ef88b5fb42c7aa071b5829b0c2c2..598ed4aad6f31308cae611fc97274014d07a7ba5 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -137,7 +137,8 @@ class email_server(osv.osv): ('imap','IMAP Server'), ],'State', select=True, readonly=False), 'is_ssl':fields.boolean('SSL ?', required=False), - 'date': fields.date('Date'), + 'attach':fields.boolean('Add Attachments ?', required=False), + 'date': fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}), 'user' : fields.char('User Name', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}), 'password' : fields.char('Password', size=1024, invisible=True, required=True, readonly=True, states={'draft':[('readonly',False)]}), 'note': fields.text('Description'), @@ -292,17 +293,18 @@ class email_server(osv.osv): else: logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_new is not define in model %s' % (model_pool._name)) return False - -# for attactment in attachents or []: -# data_attach = { -# 'name': attactment, -# 'datas':binascii.b2a_base64(str(attachents.get(attactment))), -# 'datas_fname': attactment, -# 'description': 'Mail attachment', -# 'res_model': server.object_id.model, -# 'res_id': res_id, -# } -# self.pool.get('ir.attachment').create(cr, uid, data_attach) + + if server.attach: + for attactment in attachents or []: + data_attach = { + 'name': attactment, + 'datas':binascii.b2a_base64(str(attachents.get(attactment))), + 'datas_fname': attactment, + 'description': 'Mail attachment', + 'res_model': server.object_id.model, + 'res_id': res_id, + } + self.pool.get('ir.attachment').create(cr, uid, data_attach) if server.action_id: action_pool = self.pool.get('ir.actions.server') @@ -319,10 +321,15 @@ class email_server(osv.osv): his_id = history_pool.create(cr, uid, res) return res_id - - def __fetch_mail(self, cr, uid, ids, context={}): - sendmail_thread = threading.Thread(target=self.fetch_mail, args=(cr, uid, ids)) - sendmail_thread.start() + + def set_draft(self, cr, uid, ids, context={}): + self.write(cr, uid, ids , {'state':'draft'}) + return True + + def button_fetch_mail(self, cr, uid, ids, context={}): + self.fetch_mail(cr, uid, ids) +# sendmail_thread = threading.Thread(target=self.fetch_mail, args=(cr, uid, ids)) +# sendmail_thread.start() return True def _fetch_mails(self, cr, uid, ids=False, context={}): @@ -332,10 +339,6 @@ class email_server(osv.osv): def fetch_mail(self, cr, uid, ids, context={}): - fp = os.popen('ping www.google.com -c 1 -w 5',"r") - if not fp.read(): - logger.notifyChannel('imap', netsvc.LOG_WARNING, 'lost internet connection !') - for server in self.browse(cr, uid, ids, context): logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail start checking for new emails on %s' % (server.name)) diff --git a/addons/fetchmail/fetchmail_data.xml b/addons/fetchmail/fetchmail_data.xml index d9f3587435624032a3a649df1d9b6337783c5af4..1b60f4ca0a8857ddae3a2fc2d2d1b563b8348e82 100644 --- a/addons/fetchmail/fetchmail_data.xml +++ b/addons/fetchmail/fetchmail_data.xml @@ -12,19 +12,14 @@ <field eval="'()'" name="args"/> </record> </data> - + <data> - <record id="fetchmail_user_server" model="ir.rule.group"> - <field name="name">User wise Server</field> - <field ref="model_email_server" name="model_id" model="ir.model"/> - <field eval="True" name="global"/> - </record> <record id="fetchmail_user_server_rule" model="ir.rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','email.server'),('name','=','user_id')]"/> - <field name="operator">=</field> - <field name="operand">user.id</field> - <field name="rule_group" ref="fetchmail_user_server"/> + <field name="name">User wise Server</field> + <field ref="model_email_server" name="model_id" model="ir.model"/> + <field eval="True" name="global"/> + <field name="domain_force">[('user_id', '=', user.id)]</field> </record> </data> diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml index a3a8534b559a2dafd3ea582aa9ff68d97ef90a00..ea08706b62d55ce2c504caa9cdcdd462cf04cf96 100644 --- a/addons/fetchmail/fetchmail_view.xml +++ b/addons/fetchmail/fetchmail_view.xml @@ -26,15 +26,15 @@ <group col="6" colspan="4"> <field name="name" select="1" colspan="4"/> <field name="type" select="1" on_change="onchange_server_type(type, is_ssl)"/> - <field name="date" select="1"/> - <field name="is_ssl" select="1" on_change="onchange_server_type(type, is_ssl)"/> + <field name="attach"/> <field name="active" select="1"/> </group> <notebook colspan="4"> <page string="Server & Login"> <group col="2" colspan="2"> <separator string="Server Information" colspan="2"/> + <field name="is_ssl" select="1" on_change="onchange_server_type(type, is_ssl)"/> <field name="server" /> <field name="port" /> </group> @@ -58,7 +58,8 @@ </notebook> <group col="6" colspan="4"> <field name="state" select="1"/> - <button string="Fetch Emails" type="object" name="__fetch_mail"/> + <button string="Fetch Emails" type="object" name="button_fetch_mail"/> + <button string="Set to Draft" type="object" name="set_draft"/> </group> </form> </field> diff --git a/addons/google_map/i18n/et.po b/addons/google_map/i18n/et.po index cea1b3ec12839bddc8380e177eabb8314cdd6278..bfc318b5e881ea0455a305e68ff43ca029bca53e 100644 --- a/addons/google_map/i18n/et.po +++ b/addons/google_map/i18n/et.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-01-28 20:11+0000\n" -"Last-Translator: Ahti Hinnov <sipelgas@gmail.com>\n" +"PO-Revision-Date: 2010-05-05 21:41+0000\n" +"Last-Translator: lyyser <logard.1961@gmail.com>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n" +"X-Launchpad-Export-Date: 2010-05-06 04:03+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: google_map @@ -39,6 +39,9 @@ msgid "" "so that we can directly open google map from the\n" "url widget." msgstr "" +"See moodul lisab google kaardi välja partneri\n" +"aadressile nii, et me saame otse avada google\n" +"kaardi url vidinast." #. module: google_map #: view:res.partner:0 diff --git a/addons/hr/hr.py b/addons/hr/hr.py old mode 100755 new mode 100644 diff --git a/addons/hr/process/hr_process.xml b/addons/hr/process/hr_process.xml old mode 100755 new mode 100644 diff --git a/addons/hr_evaluation/i18n/et.po b/addons/hr_evaluation/i18n/et.po new file mode 100644 index 0000000000000000000000000000000000000000..9b39362dbff94cd88f91733e091192a418fcf14f --- /dev/null +++ b/addons/hr_evaluation/i18n/et.po @@ -0,0 +1,278 @@ +# Estonian translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-11-25 12:18+0000\n" +"PO-Revision-Date: 2010-05-05 21:37+0000\n" +"Last-Translator: lyyser <logard.1961@gmail.com>\n" +"Language-Team: Estonian <et@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: hr_evaluation +#: view:hr_evaluation.type:0 +#: field:hr_evaluation.type,info:0 +msgid "Information" +msgstr "" + +#. module: hr_evaluation +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Objekti nimi peab algama x_'ga ja ei tohi sisaldada ühtegi erisümbolit !" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +msgid "Schedule next evaluation" +msgstr "" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +#: field:hr_evaluation.evaluation,info_bad:0 +msgid "Bad Points" +msgstr "" + +#. module: hr_evaluation +#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_my_list +msgid "My Next Evaluation" +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.type,value_ids:0 +msgid "Values" +msgstr "Väärtused" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +#: field:hr_evaluation.evaluation,info_good:0 +msgid "Good Points" +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.evaluation,state:0 +msgid "State" +msgstr "Olek" + +#. module: hr_evaluation +#: field:hr_evaluation.evaluation,score:0 +#: field:hr_evaluation.quote,score:0 +#: field:hr_evaluation.type,score:0 +#: field:hr_evaluation.type.value,score:0 +msgid "Score" +msgstr "" + +#. module: hr_evaluation +#: selection:hr_evaluation.evaluation,state:0 +msgid "Draft" +msgstr "Mustand" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +msgid "Informal Data" +msgstr "Mitteametlikud andmed" + +#. module: hr_evaluation +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "Vigane mudeli nimi toimingu definitsioonis." + +#. module: hr_evaluation +#: field:hr_evaluation.evaluation,employee_id:0 +msgid "Employee" +msgstr "Töötaja" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +#: field:hr_evaluation.evaluation,info_improve:0 +msgid "To Improve" +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.quote,evaluation_id:0 +msgid "Evaluation" +msgstr "Hinnang" + +#. module: hr_evaluation +#: field:hr_evaluation.type.value,type_id:0 +msgid "Evaluation Type" +msgstr "Hinnangu tüüp" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +msgid "Status" +msgstr "Olek" + +#. module: hr_evaluation +#: view:hr_evaluation.type:0 +msgid "Apply to categories" +msgstr "Rakenda ktegooriatele" + +#. module: hr_evaluation +#: model:ir.module.module,description:hr_evaluation.module_meta_information +msgid "Ability to create employees evaluation." +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.quote,name:0 +msgid "Quote" +msgstr "Tsitaat" + +#. module: hr_evaluation +#: field:hr_evaluation.type,category_ids:0 +msgid "Appliable Role" +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.evaluation,user_id:0 +msgid "Evaluation User" +msgstr "" + +#. module: hr_evaluation +#: view:hr_evaluation.type:0 +msgid "Choices Results" +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.evaluation,date:0 +msgid "Date" +msgstr "Kuupäev" + +#. module: hr_evaluation +#: model:ir.ui.menu,name:hr_evaluation.menu_eval_hr +#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_form +msgid "Evaluations" +msgstr "Hinnangud" + +#. module: hr_evaluation +#: model:ir.ui.menu,name:hr_evaluation.menu_eval_config +msgid "Configuration" +msgstr "Seadistamine" + +#. module: hr_evaluation +#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_list +msgid "Next Evaluations" +msgstr "Järgmine hindamine" + +#. module: hr_evaluation +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "Vigane XML vaate arhitektuurile!" + +#. module: hr_evaluation +#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_evaluation_type_form +msgid "Evaluation Criterions" +msgstr "Hindamise kriteeriumid" + +#. module: hr_evaluation +#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_my_old_evaluation_list +msgid "My Preceeding Evaluations" +msgstr "" + +#. module: hr_evaluation +#: model:ir.ui.menu,name:hr_evaluation.menu_resp_hr +msgid "HR Responsible" +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.quote,value_id:0 +#: field:hr_evaluation.type.value,name:0 +msgid "Value" +msgstr "Väärtus" + +#. module: hr_evaluation +#: field:hr_evaluation.evaluation,name:0 +msgid "Summary" +msgstr "Summaarne" + +#. module: hr_evaluation +#: field:hr_evaluation.type,active:0 +msgid "Active" +msgstr "Aktiivne" + +#. module: hr_evaluation +#: view:hr_evaluation.type:0 +msgid "Notes" +msgstr "Märkused" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +#: model:ir.model,name:hr_evaluation.model_hr_evaluation_evaluation +msgid "Employee Evaluation" +msgstr "" + +#. module: hr_evaluation +#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type +msgid "Employee Evaluation Type" +msgstr "" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +msgid "Quotations" +msgstr "Tsitaadid" + +#. module: hr_evaluation +#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_list +msgid "Next Employee Evaluation" +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.quote,type_id:0 +msgid "Type" +msgstr "Tüüp" + +#. module: hr_evaluation +#: view:hr_evaluation.type:0 +#: field:hr_evaluation.type,name:0 +msgid "Evaluation Criterion" +msgstr "Hindamiskriteerium" + +#. module: hr_evaluation +#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_my_list +msgid "My Next Evaluations" +msgstr "Minu järgmine hindamine" + +#. module: hr_evaluation +#: view:hr_evaluation.quote:0 +msgid "Evalution Quote" +msgstr "" + +#. module: hr_evaluation +#: model:ir.module.module,shortdesc:hr_evaluation.module_meta_information +msgid "Human Resources Evaluation" +msgstr "" + +#. module: hr_evaluation +#: field:hr_evaluation.evaluation,quote_ids:0 +msgid "Quotes" +msgstr "Tsitaadid" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +#: selection:hr_evaluation.evaluation,state:0 +msgid "Done" +msgstr "Valmis" + +#. module: hr_evaluation +#: model:ir.model,name:hr_evaluation.model_hr_evaluation_quote +msgid "Employee Evaluation Quote" +msgstr "" + +#. module: hr_evaluation +#: view:hr_evaluation.evaluation:0 +#: field:hr_evaluation.evaluation,info_employee:0 +msgid "Employee Response" +msgstr "" + +#. module: hr_evaluation +#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type_value +msgid "Evaluation Type Value" +msgstr "" diff --git a/addons/hr_expense/process/hr_expense_process.xml b/addons/hr_expense/process/hr_expense_process.xml old mode 100755 new mode 100644 diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py old mode 100755 new mode 100644 diff --git a/addons/hr_holidays/i18n/es.po b/addons/hr_holidays/i18n/es.po index 60a661a9717e3641899b3e503683cc63bc59314c..9d0158f14b28333adbd30c26811b79c4a86da26f 100644 --- a/addons/hr_holidays/i18n/es.po +++ b/addons/hr_holidays/i18n/es.po @@ -7,71 +7,71 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-11-09 13:37+0000\n" -"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n" +"PO-Revision-Date: 2010-04-30 21:12+0000\n" +"Last-Translator: Cristian Salamea (GnuThink) <ovnicraft@gmail.com>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:48+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: hr_holidays #: model:ir.ui.menu,name:hr_holidays.menu_open_ask_holidays_new msgid "New Holidays Request" -msgstr "" +msgstr "Nueva petición de vacaciones" #. module: hr_holidays #: model:ir.ui.menu,name:hr_holidays.menu_action_all_holiday msgid "All Holidays Requests" -msgstr "" +msgstr "Todas las peticiones de vacaciones" #. module: hr_holidays #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "" +msgstr "Nombre de modelo no válido en la definición de la acción" #. module: hr_holidays #: field:hr.holidays.per.user,remaining_leaves:0 msgid "Remaining Leaves" -msgstr "" +msgstr "Vacaciones disponibles" #. module: hr_holidays #: model:ir.actions.act_window,name:hr_holidays.action_holiday_waiting msgid "Requests Awaiting for Validation" -msgstr "" +msgstr "Peticiones esperando validación" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Light Blue" -msgstr "" +msgstr "Azul claro" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Brown" -msgstr "" +msgstr "Café" #. module: hr_holidays #: xsl:holidays.summary:0 msgid "of the" -msgstr "" +msgstr "del" #. module: hr_holidays #: xsl:holidays.summary:0 msgid "Off-Days' Summary" -msgstr "" +msgstr "Resumen dÃas de ausencia" #. module: hr_holidays #: view:hr.holidays:0 #: view:hr.holidays.per.user:0 #: model:process.transition,name:hr_holidays.process_transition_employeeholidays0 msgid "Employee Holidays" -msgstr "" +msgstr "Vacaciones de empleado" #. module: hr_holidays #: view:hr.holidays:0 msgid "Set to Draft" -msgstr "" +msgstr "Cambiar a borrador" #. module: hr_holidays #: view:hr.holidays.per.user:0 @@ -79,27 +79,27 @@ msgstr "" #: model:ir.model,name:hr_holidays.model_hr_holidays #: model:process.node,name:hr_holidays.process_node_holidays0 msgid "Holidays" -msgstr "" +msgstr "Vacaciones" #. module: hr_holidays #: xsl:holidays.summary:0 msgid "to" -msgstr "" +msgstr "hasta" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Light Cyan" -msgstr "" +msgstr "Cian Claro" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Light Green" -msgstr "" +msgstr "Verde claro" #. module: hr_holidays #: model:process.transition,name:hr_holidays.process_transition_employeedeclaration0 msgid "Employee Declaration" -msgstr "" +msgstr "Declaración de empleado" #. module: hr_holidays #: view:hr.holidays:0 @@ -111,7 +111,7 @@ msgstr "Validar" #. module: hr_holidays #: model:process.transition,name:hr_holidays.process_transition_refusedrequest0 msgid "Refused Request" -msgstr "" +msgstr "Petición rechazada" #. module: hr_holidays #: model:process.node,name:hr_holidays.process_node_approved0 @@ -121,113 +121,113 @@ msgstr "Aprobado" #. module: hr_holidays #: selection:hr.holidays.summary.employee,init,holiday_type:0 msgid "Both" -msgstr "" +msgstr "Ambas" #. module: hr_holidays #: view:hr.holidays:0 msgid "Refuse" -msgstr "" +msgstr "Rechazar" #. module: hr_holidays #: wizard_button:hr.holidays.summary,notify,end:0 #: wizard_button:hr.holidays.summary.employee,notify,end:0 msgid "Ok" -msgstr "" +msgstr "Ok" #. module: hr_holidays #: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday msgid "My Holidays Requests" -msgstr "" +msgstr "Mis peticiones de vacaciones" #. module: hr_holidays #: field:hr.holidays,notes:0 #: field:hr.holidays.per.user,notes:0 msgid "Notes" -msgstr "" +msgstr "Notas" #. module: hr_holidays #: field:hr.holidays,holiday_status:0 #: field:hr.holidays.log,holiday_status:0 #: field:hr.holidays.per.user,holiday_status:0 msgid "Holiday's Status" -msgstr "" +msgstr "Estado de vacaciones" #. module: hr_holidays #: model:process.transition,note:hr_holidays.process_transition_refusedrequest0 msgid "Request is refused." -msgstr "" +msgstr "Petición es rechazada." #. module: hr_holidays #: model:ir.ui.menu,name:hr_holidays.menu_open_ask_holidays msgid "Holidays Management" -msgstr "" +msgstr "Gestión de vacaciones" #. module: hr_holidays #: xsl:holidays.summary:0 msgid "Analyze from" -msgstr "" +msgstr "Análisis desde" #. module: hr_holidays #: model:ir.actions.report.xml,name:hr_holidays.report_holidays_summary msgid "Summary Of Holidays" -msgstr "" +msgstr "Resumen de las vacaciones" #. module: hr_holidays #: model:process.node,note:hr_holidays.process_node_calendar0 msgid "The holiday is set in the calendar" -msgstr "" +msgstr "Las vacaciones son fijadas en el calendario" #. module: hr_holidays #: view:hr.holidays.status:0 msgid "Holiday status" -msgstr "" +msgstr "Estado Vacaciones" #. module: hr_holidays #: model:ir.model,name:hr_holidays.model_hr_holidays_status msgid "Holidays Status" -msgstr "" +msgstr "Estado de Vacaciones" #. module: hr_holidays #: field:hr.holidays,date_to:0 msgid "Vacation end day" -msgstr "" +msgstr "Fecha Fin Vacaciones" #. module: hr_holidays #: view:hr.holidays.per.user:0 msgid "Holidays Allowed" -msgstr "" +msgstr "Vacaciones permitidas" #. module: hr_holidays #: model:process.node,note:hr_holidays.process_node_legaldeclaration0 msgid "Legal Declaration Document to declare new employee" -msgstr "" +msgstr "Documento de declaración oficial para declarar nuevo empleado" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Magenta" -msgstr "" +msgstr "Violeta" #. module: hr_holidays #: model:ir.model,name:hr_holidays.model_hr_holidays_per_user msgid "Holidays Per User" -msgstr "" +msgstr "Vacaciones por usuario" #. module: hr_holidays #: view:hr.holidays.status:0 msgid "Define holiday status" -msgstr "" +msgstr "Definir Estado Vacaciones" #. module: hr_holidays #: selection:hr.holidays.summary,init,holiday_type:0 #: selection:hr.holidays.summary.employee,init,holiday_type:0 msgid "Confirmed" -msgstr "" +msgstr "Confirmado" #. module: hr_holidays #: wizard_field:hr.holidays.summary,init,date_from:0 #: wizard_field:hr.holidays.summary.employee,init,date_from:0 msgid "From" -msgstr "" +msgstr "Desde" #. module: hr_holidays #: view:hr.holidays:0 @@ -239,73 +239,73 @@ msgstr "Confirmar" #: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_waiting #: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_waiting msgid "My Awaiting Confirmation Holidays Requests" -msgstr "" +msgstr "Mis peticiones de vacaciones esperando confirmación" #. module: hr_holidays #: field:hr.holidays,user_id:0 msgid "Employee_id" -msgstr "" +msgstr "Empleado" #. module: hr_holidays #: model:process.node,note:hr_holidays.process_node_holidaysdefinition0 msgid "Encoding of annual available holidays." -msgstr "" +msgstr "Codificación de vacaciones disponibles anuales." #. module: hr_holidays #: field:hr.holidays,employee_id:0 #: field:hr.holidays.log,employee_id:0 #: field:hr.holidays.per.user,employee_id:0 msgid "Employee" -msgstr "" +msgstr "Empleado" #. module: hr_holidays #: selection:hr.holidays,state:0 msgid "Waiting Validation" -msgstr "" +msgstr "Esperando Validación" #. module: hr_holidays #: model:process.transition,note:hr_holidays.process_transition_employeeholidays0 msgid "Employee get holidays" -msgstr "" +msgstr "Empleado obtiene vacaciones" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Light Salmon" -msgstr "" +msgstr "Salmón claro" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Wheat" -msgstr "" +msgstr "Abano" #. module: hr_holidays #: field:hr.holidays.log,nb_holidays:0 msgid "Number of Holidays Requested" -msgstr "" +msgstr "Número de vacaciones solicitadas" #. module: hr_holidays #: model:ir.actions.act_window,name:hr_holidays.act_hr_employee_holiday_request msgid "My Holiday Requests" -msgstr "" +msgstr "Mis peticiones" #. module: hr_holidays #: view:hr.holidays:0 #: view:hr.holidays.per.user:0 msgid "Number of Days" -msgstr "" +msgstr "Número de DÃas" #. module: hr_holidays #: field:hr.holidays.status,name:0 #: model:ir.actions.act_window,name:hr_holidays.open_view_holiday_status #: model:ir.ui.menu,name:hr_holidays.menu_open_view_holiday_status msgid "Holiday Status" -msgstr "" +msgstr "Estado de Vacaciones" #. module: hr_holidays #: wizard_view:hr.holidays.summary,init:0 #: wizard_view:hr.holidays.summary.employee,init:0 msgid "Report Options" -msgstr "" +msgstr "Opciones de Reporte" #. module: hr_holidays #: constraint:ir.ui.view:0 @@ -315,74 +315,75 @@ msgstr "¡XML inválido para la definición de la vista!" #. module: hr_holidays #: model:process.node,note:hr_holidays.process_node_approved0 msgid "His manager approves the request" -msgstr "" +msgstr "Su responsable aprueba la petición" #. module: hr_holidays #: model:process.transition,note:hr_holidays.process_transition_holidaysdefrequest0 msgid "If holidays available, employee can take it and fill it." msgstr "" +"Si hay vacaciones disponibles, el empleado puede cogerla y rellenarla." #. module: hr_holidays #: wizard_view:hr.holidays.summary.employee,notify:0 msgid "You have to select at least 1 Employee. Try again." -msgstr "" +msgstr "Selecciona por lo menos un empleado. Prueba otra vez." #. module: hr_holidays #: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_validate msgid "My Validated Holidays Requests" -msgstr "" +msgstr "Mis peticiones de vacaciones validadas" #. module: hr_holidays #: wizard_field:hr.holidays.summary.employee,init,emp:0 msgid "Employee(s)" -msgstr "" +msgstr "Empleado(s)" #. module: hr_holidays #: field:hr.holidays,number_of_days:0 msgid "Number of Days in this Holiday Request" -msgstr "" +msgstr "Número de dÃas solicitados en esta petición" #. module: hr_holidays #: view:hr.holidays.per.user:0 #: model:ir.actions.act_window,name:hr_holidays.action_holidays_per_user #: model:ir.ui.menu,name:hr_holidays.menu_open_holidays_per_user msgid "Holidays Per Employee" -msgstr "" +msgstr "Vacaciones por empleado" #. module: hr_holidays #: field:hr.holidays.status,limit:0 msgid "Allow to override Limit" -msgstr "" +msgstr "Permite superar el lÃmite" #. module: hr_holidays #: field:hr.holidays.log,holiday_user_id:0 msgid "Holidays user" -msgstr "" +msgstr "Usuario de vacaciones" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Lavender" -msgstr "" +msgstr "Lavanda" #. module: hr_holidays #: model:ir.model,name:hr_holidays.model_hr_holidays_log msgid "hr.holidays.log" -msgstr "" +msgstr "Log de Vacaciones" #. module: hr_holidays #: model:ir.actions.wizard,name:hr_holidays.wizard_holidays_summary msgid "Print Summary of Employee's Holidays" -msgstr "" +msgstr "Imprimir resumen de vacaciones" #. module: hr_holidays #: model:process.node,name:hr_holidays.process_node_calendar0 msgid "Calendar" -msgstr "" +msgstr "Calendario" #. module: hr_holidays #: field:hr.holidays,date_from:0 msgid "Vacation start day" -msgstr "" +msgstr "Inicio de Vacaciones" #. module: hr_holidays #: model:ir.module.module,description:hr_holidays.module_meta_information @@ -420,164 +421,180 @@ msgid "" " Administration / Users / Users\n" " for example, you maybe will do it for the user 'admin'.\n" msgstr "" +"Recursos Humanos: Registro y seguimiento de Vacaciones\n" +"Este modulo permite administrar las vacaciones y peticiones. Para cada " +"empleado se puede definir un numero de vacaciones disponibles.\n" +"Ademas:\n" +"Sincronizacion con la agenda (usando el modulo de CRM) es posible: " +"automatizar la creacion de casos cuando una peticion es aceptada, tiene un " +"link para los estados de vacaciones. Puede configurar esta info en el color " +"de su preferencia.\n" +"Estado de Vacaciones:\n" +"Un empleado puede crear peticiones negativas (pedir -2 dias por ejemplo). es " +"es considerado por el sistema como una peticion de mas dias de ausencia.\n" +"Hay 2 maneras para imprimir las vacaciones:\n" +"Elegir empleados por departamento y usar un asistente.\n" +"O imprimir un empleado especifico.\n" +"Ademas el asistente permite elegir las vacaciones validadas y confirmadas o " +"solo una.\n" #. module: hr_holidays #: wizard_view:hr.holidays.summary,notify:0 #: wizard_view:hr.holidays.summary.employee,notify:0 msgid "Notification" -msgstr "" +msgstr "Notificación" #. module: hr_holidays #: model:process.node,note:hr_holidays.process_node_holidaysrequest0 msgid "Employee fills in a request for holidays" -msgstr "" +msgstr "Petición de Vacaciones" #. module: hr_holidays #: model:process.transition,note:hr_holidays.process_transition_setholiday0 msgid "Holiday is set in the calendar." -msgstr "" +msgstr "Las vacaciones son fijadas en el calendario." #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Light Coral" -msgstr "" +msgstr "Coral claro" #. module: hr_holidays #: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_available #: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_available msgid "My Available Holidays" -msgstr "" +msgstr "Mis vacaciones disponibles" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Black" -msgstr "" +msgstr "Negro" #. module: hr_holidays #: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_refuse msgid "My Refused Holidays Requests" -msgstr "" +msgstr "Mis peticiones rechazadas" #. module: hr_holidays #: model:process.transition,name:hr_holidays.process_transition_setholiday0 msgid "Set Holiday" -msgstr "" +msgstr "Fijar vacaciones" #. module: hr_holidays #: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_draft msgid "My Draft Holidays Requests" -msgstr "" +msgstr "Mis peticiones en borrador" #. module: hr_holidays #: field:hr.holidays.per.user,max_leaves:0 msgid "Maximum Leaves Allowed" -msgstr "" +msgstr "Máximo de vacaciones permitidas" #. module: hr_holidays #: field:hr.holidays,state:0 msgid "Status" -msgstr "" +msgstr "Estado" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Ivory" -msgstr "" +msgstr "Marfil" #. module: hr_holidays #: model:ir.actions.act_window,name:hr_holidays.action_my_holiday msgid "My Holidays Request" -msgstr "" +msgstr "Mis peticiones de vacaciones" #. module: hr_holidays #: field:hr.holidays.status,color_name:0 msgid "Color of the status" -msgstr "" +msgstr "Color de Estado" #. module: hr_holidays #: selection:hr.holidays.summary,init,holiday_type:0 msgid "Both Validated and Confirmed" -msgstr "" +msgstr "Validadas y Confirmadas" #. module: hr_holidays #: field:hr.holidays.per.user,leaves_taken:0 msgid "Leaves Already Taken" -msgstr "" +msgstr "Vacaciones realizadas" #. module: hr_holidays #: xsl:holidays.summary:0 msgid "holidays." -msgstr "" +msgstr "Vacaciones." #. module: hr_holidays #: selection:hr.holidays,state:0 msgid "draft" -msgstr "" +msgstr "Borrador" #. module: hr_holidays #: field:hr.holidays.per.user,user_id:0 msgid "User" -msgstr "" +msgstr "Usuario" #. module: hr_holidays #: model:process.transition,note:hr_holidays.process_transition_employeedeclaration0 msgid "Document for employee" -msgstr "" +msgstr "Documento para empleado" #. module: hr_holidays #: field:hr.holidays.log,date:0 msgid "Date" -msgstr "" +msgstr "Fecha" #. module: hr_holidays #: model:process.transition.action,name:hr_holidays.process_transition_action_reufse0 msgid "Reufse" -msgstr "" +msgstr "Rechazar" #. module: hr_holidays #: field:hr.holidays.status,section_id:0 msgid "Section" -msgstr "" +msgstr "Sección" #. module: hr_holidays #: field:hr.holidays,manager_id:0 msgid "Holiday manager" -msgstr "" +msgstr "Responsable de vacaciones" #. module: hr_holidays #: field:hr.holidays.per.user,active:0 #: field:hr.holidays.status,active:0 msgid "Active" -msgstr "" +msgstr "Activo" #. module: hr_holidays #: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_draft msgid "My Holidays Request Draft" -msgstr "" +msgstr "Mis peticiones en Borrador" #. module: hr_holidays #: model:process.transition,name:hr_holidays.process_transition_approvedrequest0 msgid "Approved Request" -msgstr "" +msgstr "Petición aprobada" #. module: hr_holidays #: model:process.node,name:hr_holidays.process_node_holidaysrequest0 msgid "Holidays Request" -msgstr "" +msgstr "Petición de vacaciones" #. module: hr_holidays #: model:ir.ui.menu,name:hr_holidays.menu_action_holiday_waiting msgid "Holidays Requests Awaiting for Validation" -msgstr "" +msgstr "Peticiones esperando validación" #. module: hr_holidays #: view:hr.holidays:0 msgid "General" -msgstr "" +msgstr "General" #. module: hr_holidays #: view:hr.holidays.per.user:0 msgid "General Information" -msgstr "" +msgstr "Información general" #. module: hr_holidays #: view:hr.holidays:0 @@ -585,23 +602,23 @@ msgstr "" #: wizard_button:hr.holidays.summary,init,end:0 #: wizard_button:hr.holidays.summary.employee,init,end:0 msgid "Cancel" -msgstr "" +msgstr "Cancelar" #. module: hr_holidays #: model:process.transition,name:hr_holidays.process_transition_holidaysdefrequest0 msgid "Holidays def Request" -msgstr "" +msgstr "Petición define vacaciones" #. module: hr_holidays #: selection:hr.holidays.summary,init,holiday_type:0 #: selection:hr.holidays.summary.employee,init,holiday_type:0 msgid "Validated" -msgstr "" +msgstr "Validado" #. module: hr_holidays #: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_refuse msgid "My Holidays Request Refused" -msgstr "" +msgstr "Mis peticiones rechazadas" #. module: hr_holidays #: constraint:ir.model:0 @@ -615,23 +632,23 @@ msgstr "" #: wizard_button:hr.holidays.summary,init,checkdept:0 #: wizard_button:hr.holidays.summary.employee,init,checkemp:0 msgid "Print" -msgstr "" +msgstr "Imprimir" #. module: hr_holidays #: model:ir.actions.wizard,name:hr_holidays.holidays_summary #: model:ir.ui.menu,name:hr_holidays.menu_holidays_summary msgid "Print Summary of Holidays" -msgstr "" +msgstr "Imprimir resumen de vacaciones" #. module: hr_holidays #: wizard_field:hr.holidays.summary,init,depts:0 msgid "Department(s)" -msgstr "" +msgstr "Departamento(s)" #. module: hr_holidays #: field:hr.holidays,name:0 msgid "Description" -msgstr "" +msgstr "Descripción" #. module: hr_holidays #: selection:hr.holidays,state:0 @@ -642,85 +659,85 @@ msgstr "Rechazado" #. module: hr_holidays #: model:process.transition,note:hr_holidays.process_transition_approvedrequest0 msgid "Request is approved." -msgstr "" +msgstr "Petición aprobada." #. module: hr_holidays #: model:process.node,name:hr_holidays.process_node_holidaysdefinition0 msgid "Holidays Definition" -msgstr "" +msgstr "Definición vacaciones" #. module: hr_holidays #: wizard_field:hr.holidays.summary,init,holiday_type:0 #: wizard_field:hr.holidays.summary.employee,init,holiday_type:0 msgid "Select Holiday Type" -msgstr "" +msgstr "Seleccionar un tipo de vacaciones" #. module: hr_holidays #: field:hr.holidays,case_id:0 msgid "Case" -msgstr "" +msgstr "Caso" #. module: hr_holidays #: field:hr.holidays,holiday_user_id:0 msgid "Holiday per user" -msgstr "" +msgstr "Vacaiones por usuario" #. module: hr_holidays #: model:process.node,note:hr_holidays.process_node_holidays0 msgid "Encode number of available holidays" -msgstr "" +msgstr "Codifica número de vacaciones disponibles" #. module: hr_holidays #: model:process.node,name:hr_holidays.process_node_legaldeclaration0 msgid "Secretariat Social" -msgstr "" +msgstr "SecretarÃa social" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Violet" -msgstr "" +msgstr "Violeta" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Red" -msgstr "" +msgstr "Rojo" #. module: hr_holidays #: model:ir.module.module,shortdesc:hr_holidays.module_meta_information msgid "Human Resources: Holidays management" -msgstr "" +msgstr "Gestión de Vacaciones" #. module: hr_holidays #: model:process.process,name:hr_holidays.process_process_holidaysprocess0 msgid "Holidays Process" -msgstr "" +msgstr "Proceso de vacaciones" #. module: hr_holidays #: wizard_view:hr.holidays.summary,notify:0 msgid "You have to select at least 1 Department. Try again." -msgstr "" +msgstr "Debe seleccionar por lo menos 1 departamento. Inténtelo de nuevo." #. module: hr_holidays #: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_validate msgid "My Holidays Request Validated" -msgstr "" +msgstr "Mis peticiones validadas" #. module: hr_holidays #: field:hr.holidays.log,holiday_req_id:0 msgid "Holiday Request ID" -msgstr "" +msgstr "ID solicitud de vacaciones" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Light Yellow" -msgstr "" +msgstr "Amarillo claro" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 msgid "Light Pink" -msgstr "" +msgstr "Rosa claro" #. module: hr_holidays #: model:process.node,note:hr_holidays.process_node_refused0 msgid "His manager refuses the request" -msgstr "" +msgstr "Su responsable rechaza la petición" diff --git a/addons/hr_holidays/process/hr_holidays_process.xml b/addons/hr_holidays/process/hr_holidays_process.xml old mode 100755 new mode 100644 diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department.py b/addons/hr_holidays/wizard/hr_holidays_summary_department.py index 5e35bbdb916b914f09830faf7e163faf53e41bb5..9c6d1447f8954c84d98b1009bde97c5cd596fb7e 100644 --- a/addons/hr_holidays/wizard/hr_holidays_summary_department.py +++ b/addons/hr_holidays/wizard/hr_holidays_summary_department.py @@ -51,6 +51,7 @@ class hr_holidays_summary_dept(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'holidays.summary', 'datas': datas, + 'nodestroy': True, } hr_holidays_summary_dept() diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index eb0d1ae1334c7d630415fafc020d575d8916311e..7ea4f52a392c174c417ad508ec8006ac62a3915b 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -135,7 +135,7 @@ class hr_applicant(osv.osv): 'default_name': opp.name } value = { - 'name': _('Meetings'), + 'name': ('Meetings'), 'domain': "[('user_id','=',%s)]" % (uid), 'context': context, 'view_type': 'form', diff --git a/addons/hr_timesheet/process/hr_timesheet_process.xml b/addons/hr_timesheet/process/hr_timesheet_process.xml old mode 100755 new mode 100644 diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_users.py b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py index 3931e41e18569473f633848cca3fc77a9496068f..f7358eca990dd80b233e3da904bc011785dac5e0 100644 --- a/addons/hr_timesheet/wizard/hr_timesheet_print_users.py +++ b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py @@ -49,6 +49,7 @@ class analytical_timesheet_employees(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'hr.analytical.timesheet_users', 'datas': datas, + 'nodestroy':True } analytical_timesheet_employees() diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py index f5b37256a0236441f3e0ded89f876adfbf2bfa46..b83b84746d29a739206626867cbc9ad7f68ed8b8 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py @@ -72,6 +72,8 @@ class account_analytic_profit(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.analytic.profit', 'datas': datas, + 'nodestroy': True + } account_analytic_profit() diff --git a/addons/hr_timesheet_sheet/process/hr_timesheet_sheet_process.xml b/addons/hr_timesheet_sheet/process/hr_timesheet_sheet_process.xml old mode 100755 new mode 100644 diff --git a/addons/hr_timesheet_sheet/security/hr_timesheet_data.xml b/addons/hr_timesheet_sheet/security/hr_timesheet_data.xml index cc49ed9f936feece3e864edf35b4cc6223741fd3..2ff303cb48fc272bac7e173448d820f9dc59dddd 100644 --- a/addons/hr_timesheet_sheet/security/hr_timesheet_data.xml +++ b/addons/hr_timesheet_sheet/security/hr_timesheet_data.xml @@ -2,16 +2,11 @@ <openerp> <data> - <record model="ir.rule.group" id="timesheet_comp_rule_group"> + <record model="ir.rule" id="timesheet_comp_rule"> <field name="name">Timesheet multi-company</field> <field name="model_id" search="[('model','=','hr_timesheet_sheet.sheet')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="timesheet_comp_rule"> - <field name="field_id" search="[('model','=','hr_timesheet_sheet.sheet'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> - <field name="rule_group" ref="timesheet_comp_rule_group"/> + <field name="domain_force">[('company_id','child_of',[user.company_id.id])]</field> </record> </data> diff --git a/addons/l10n_ch/__init__.py b/addons/l10n_ch/__init__.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/__openerp__.py b/addons/l10n_ch/__openerp__.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/account_invoice.xml b/addons/l10n_ch/account_invoice.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/account_journal_view.xml b/addons/l10n_ch/account_journal_view.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/account_move_line.py b/addons/l10n_ch/account_move_line.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/bank.py b/addons/l10n_ch/bank.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/bank_ch.xml b/addons/l10n_ch/bank_ch.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/bank_view.xml b/addons/l10n_ch/bank_view.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/bvr_report.xml b/addons/l10n_ch/bvr_report.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/bvr_view.xml b/addons/l10n_ch/bvr_view.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/bvr_wizard.xml b/addons/l10n_ch/bvr_wizard.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/company.py b/addons/l10n_ch/company.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/company_view.xml b/addons/l10n_ch/company_view.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/demo/dta_demo.xml b/addons/l10n_ch/demo/dta_demo.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/demo/vaudtax_data_demo.xml b/addons/l10n_ch/demo/vaudtax_data_demo.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/dta.py b/addons/l10n_ch/dta.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/dta_data.xml b/addons/l10n_ch/dta_data.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/dta_view.xml b/addons/l10n_ch/dta_view.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/dta_wizard.xml b/addons/l10n_ch/dta_wizard.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/partner.py b/addons/l10n_ch/partner.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/payment.py b/addons/l10n_ch/payment.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/report/__init__.py b/addons/l10n_ch/report/__init__.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/report/bvr.py b/addons/l10n_ch/report/bvr.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/report/bvr.rml b/addons/l10n_ch/report/bvr.rml index caaa585d8351b6a8d1df1c5c85029d51b667430a..a3eed479be9fb69ec1b51695b20fd34f12bba068 100755 --- a/addons/l10n_ch/report/bvr.rml +++ b/addons/l10n_ch/report/bvr.rml @@ -81,7 +81,7 @@ </para> </td> <td> - <para style="P10">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="P10">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="P10">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para> <para style="P10">[[ o.address_invoice_id.street ]]</para> <para style="P10">[[ o.address_invoice_id.street2 or '' ]]</para> @@ -164,4 +164,4 @@ <drawRightString x="195mm" y="15mm">[[mod10r('01'+str('%.2f' % o.amount_total).replace('.','').rjust(10,'0'))]]>[[ _get_ref(o) ]]+ [[o.partner_bank.bvr_number.split('-')[0]+(str(o.partner_bank.bvr_number.split('-')[1])).rjust(6,'0')+o.partner_bank.bvr_number.split('-')[2] ]]></drawRightString> </illustration> </story> -</document> \ No newline at end of file +</document> diff --git a/addons/l10n_ch/report/invoice.rml b/addons/l10n_ch/report/invoice.rml index ce5ef808f2a9b551b8a29f80230251a8e45ee469..104fbf2a367c14988cd0cf3681aeb7bf24c0aa8e 100755 --- a/addons/l10n_ch/report/invoice.rml +++ b/addons/l10n_ch/report/invoice.rml @@ -155,7 +155,7 @@ </para> </td> <td> - <para style="P18">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="P18">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="P18">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para> <para style="P18">[[ o.address_invoice_id.street ]]</para> <para style="P18">[[ o.address_invoice_id.street2 or '' ]]</para> @@ -380,4 +380,4 @@ </illustration> </story> -</document> \ No newline at end of file +</document> diff --git a/addons/l10n_ch/vaudtax_data.xml b/addons/l10n_ch/vaudtax_data.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/wizard/__init__.py b/addons/l10n_ch/wizard/__init__.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/wizard/bvr_import.py b/addons/l10n_ch/wizard/bvr_import.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/wizard/dta_wizard.py b/addons/l10n_ch/wizard/dta_wizard.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/wizard/journal_config.py b/addons/l10n_ch/wizard/journal_config.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/wizard/wizard_bvr.py b/addons/l10n_ch/wizard/wizard_bvr.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch/zip_code_default.xml b/addons/l10n_ch/zip_code_default.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch_chart_c2c_pcg/tax_template_view.xml b/addons/l10n_ch_chart_c2c_pcg/tax_template_view.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch_chart_c2c_pcg/vat.xml b/addons/l10n_ch_chart_c2c_pcg/vat.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch_chart_c2c_pcg/wizard.xml b/addons/l10n_ch_chart_c2c_pcg/wizard.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ch_chart_c2c_pcg/wizard/__init__.py b/addons/l10n_ch_chart_c2c_pcg/wizard/__init__.py old mode 100755 new mode 100644 diff --git a/addons/l10n_ch_chart_c2c_pcg/wizard/config.py b/addons/l10n_ch_chart_c2c_pcg/wizard/config.py old mode 100755 new mode 100644 diff --git a/addons/l10n_chart_uk_minimal/account_chart.xml b/addons/l10n_chart_uk_minimal/account_chart.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_chart_uk_minimal/account_tax.xml b/addons/l10n_chart_uk_minimal/account_tax.xml old mode 100755 new mode 100644 diff --git a/addons/membership/process/membership_process.xml b/addons/membership/process/membership_process.xml old mode 100755 new mode 100644 diff --git a/addons/mrp/process/procurement_process.xml b/addons/mrp/process/procurement_process.xml old mode 100755 new mode 100644 diff --git a/addons/mrp/security/mrp_security.xml b/addons/mrp/security/mrp_security.xml index cfb31f7d05d3c57f02cc03efcab395c6260f8385..955bdad2fdd50b2b67156410dfb647ad3b3ec5fa 100644 --- a/addons/mrp/security/mrp_security.xml +++ b/addons/mrp/security/mrp_security.xml @@ -16,69 +16,39 @@ </record> <!-- Multi --> - <record model="ir.rule.group" id="mrp_procurement_rule_group"> - <field name="name">mrp_procurement multi-company</field> + <record model="ir.rule" id="mrp_procurement_rule"> + <field name="name">mrp_procurement multi-company</field> <field name="model_id" search="[('model','=','mrp.procurement')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="mrp_procurement_rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','mrp.procurement'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field> - <field name="rule_group" ref="mrp_procurement_rule_group"/> </record> - <record model="ir.rule.group" id="stock_warehouse_orderpoint_rule_group"> - <field name="name">stock_warehouse.orderpoint multi-company</field> + <record model="ir.rule" id="stock_warehouse_orderpoint_rule"> + <field name="name">stock_warehouse.orderpoint multi-company</field> <field name="model_id" search="[('model','=','stock.warehouse.orderpoint')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="stock_warehouse_orderpoint_rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','stock.warehouse.orderpoint'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field> - <field name="rule_group" ref="stock_warehouse_orderpoint_rule_group"/> </record> - <record model="ir.rule.group" id="mrp_production_rule_group"> - <field name="name">mrp_production multi-company</field> + <record model="ir.rule" id="mrp_production_rule"> + <field name="name">mrp_production multi-company</field> <field name="model_id" search="[('model','=','mrp.production')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="mrp_production_rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','mrp.production'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field> - <field name="rule_group" ref="mrp_production_rule_group"/> </record> - <record model="ir.rule.group" id="mrp_workcenter_rule_group"> - <field name="name">mrp_workcenter multi-company</field> + <record model="ir.rule" id="mrp_workcenter_rule"> + <field name="name">mrp_workcenter multi-company</field> <field name="model_id" search="[('model','=','mrp.workcenter')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="mrp_workcenter_rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','mrp.workcenter'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field> - <field name="rule_group" ref="mrp_workcenter_rule_group"/> </record> - <record model="ir.rule.group" id="mrp_bom_rule_group"> - <field name="name">mrp_bom multi-company</field> + <record model="ir.rule" id="mrp_bom_rule"> + <field name="name">mrp_bom multi-company</field> <field name="model_id" search="[('model','=','mrp.bom')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="mrp_bom_rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','mrp.bom'),('name','=','company_id')]"/> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field> - <field name="rule_group" ref="mrp_bom_rule_group"/> </record> </data> diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 21cfac882428d734bab948f800118bb66bbf47b4..4a35d6003cf0b0aa0dedfdb59105cd8ffa0d60d3 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -41,7 +41,7 @@ class stock_warehouse_orderpoint(osv.osv): 'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True), 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True), 'location_id': fields.many2one('stock.location', 'Location', required=True), - 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','=','product')]), + 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]), 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True ), 'product_min_qty': fields.float('Min Quantity', required=True, help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\ diff --git a/addons/mrp_operations/report/__init__.py b/addons/mrp_operations/report/__init__.py old mode 100755 new mode 100644 diff --git a/addons/mrp_operations/report/mrp_code_barcode.py b/addons/mrp_operations/report/mrp_code_barcode.py old mode 100755 new mode 100644 diff --git a/addons/mrp_operations/report/mrp_wc_barcode.py b/addons/mrp_operations/report/mrp_wc_barcode.py old mode 100755 new mode 100644 diff --git a/addons/olap/__init__.py b/addons/olap/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap/cli/tinybi.py b/addons/olap/cli/tinybi.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/__init__.py b/addons/olap/cube/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/agregator.py b/addons/olap/cube/agregator.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/axis.py b/addons/olap/cube/axis.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/axis_map.py b/addons/olap/cube/axis_map.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/common.py b/addons/olap/cube/common.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/cross.py b/addons/olap/cube/cross.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/cube.py b/addons/olap/cube/cube.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/datatype.py b/addons/olap/cube/datatype.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/formatstring.py b/addons/olap/cube/formatstring.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/level.py b/addons/olap/cube/level.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/levels/__init__.py b/addons/olap/cube/levels/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/levels/level_date.py b/addons/olap/cube/levels/level_date.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/levels/level_interface.py b/addons/olap/cube/levels/level_interface.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/levels/level_normal.py b/addons/olap/cube/levels/level_normal.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/mdx_input/__init__.py b/addons/olap/cube/mdx_input/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/mdx_input/mdx_input.py b/addons/olap/cube/mdx_input/mdx_input.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/mdx_operator.py b/addons/olap/cube/mdx_operator.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/mdx_output/__init__.py b/addons/olap/cube/mdx_output/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/mdx_output/mdx_output.py b/addons/olap/cube/mdx_output/mdx_output.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/mdx_parser.py b/addons/olap/cube/mdx_parser.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/measure.py b/addons/olap/cube/measure.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/query.py b/addons/olap/cube/query.py old mode 100755 new mode 100644 diff --git a/addons/olap/cube/slicer.py b/addons/olap/cube/slicer.py old mode 100755 new mode 100644 diff --git a/addons/olap/data/olap_cube_workflow.xml b/addons/olap/data/olap_cube_workflow.xml old mode 100755 new mode 100644 diff --git a/addons/olap/data/olap_data.xml b/addons/olap/data/olap_data.xml old mode 100755 new mode 100644 diff --git a/addons/olap/data/olap_demo.xml b/addons/olap/data/olap_demo.xml old mode 100755 new mode 100644 diff --git a/addons/olap/data/olap_fact_view.xml b/addons/olap/data/olap_fact_view.xml old mode 100755 new mode 100644 diff --git a/addons/olap/data/olap_security.xml b/addons/olap/data/olap_security.xml old mode 100755 new mode 100644 diff --git a/addons/olap/data/olap_view.xml b/addons/olap/data/olap_view.xml old mode 100755 new mode 100644 diff --git a/addons/olap/data/olap_wizard.xml b/addons/olap/data/olap_wizard.xml old mode 100755 new mode 100644 diff --git a/addons/olap/i18n/et.po b/addons/olap/i18n/et.po new file mode 100644 index 0000000000000000000000000000000000000000..365596a38c6af379360ed0ec9cda0a4ffbf0154a --- /dev/null +++ b/addons/olap/i18n/et.po @@ -0,0 +1,1399 @@ +# Estonian translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-11-26 05:24+0000\n" +"PO-Revision-Date: 2010-05-05 21:58+0000\n" +"Last-Translator: lyyser <logard.1961@gmail.com>\n" +"Language-Team: Estonian <et@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: olap +#: view:olap.database.columns:0 +#: view:olap.database.tables:0 +msgid "Hide" +msgstr "Peida" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_saved_query_form +#: model:ir.ui.menu,name:olap.menu_action_olap_saved_query_form +#: view:olap.saved.query:0 +msgid "Olap Saved Query" +msgstr "" + +#. module: olap +#: field:olap.query.logs,time:0 +#: field:olap.saved.query,time:0 +msgid "Time" +msgstr "Aeg" + +#. module: olap +#: view:bi.auto.configure.wizard:0 +msgid "Auto Configure Structure" +msgstr "" + +#. module: olap +#: view:olap.fact.database:0 +msgid "Olap fact database" +msgstr "" + +#. module: olap +#: help:olap.measure,value_sql:0 +msgid "" +"You can provide valid sql expression. Make sure it have function with fully " +"qualified column name like (sum,avg ...)(tablename.columnname (+,- ...) " +"tablename.columnname)" +msgstr "" + +#. module: olap +#: field:olap.cube.table,schema_id:0 +msgid "Schema id" +msgstr "" + +#. module: olap +#: field:olap.schema,database_id:0 +msgid "Database Connection" +msgstr "Andmebaasiühendus" + +#. module: olap +#: selection:olap.fact.database,type:0 +msgid "MySQL" +msgstr "MySQL" + +#. module: olap +#: field:olap.fact.database,db_password:0 +msgid "Database password" +msgstr "Andmebaasi parool" + +#. module: olap +#: view:olap.database.tables:0 +msgid "Olap database tables" +msgstr "" + +#. module: olap +#: view:olap.fact.database:0 +msgid "Connection url" +msgstr "" + +#. module: olap +#: view:olap.application.table:0 +msgid "Olap Application Table" +msgstr "" + +#. module: olap +#: field:olap.parameters.config.wizard,host_name:0 +msgid "Server Name" +msgstr "Serveri nimi" + +#. module: olap +#: help:olap.fact.database,db_password:0 +msgid "Password for the login." +msgstr "Salasõna logimiseks" + +#. module: olap +#: field:olap.application.field,application_id:0 +#: field:olap.application.table,application_id:0 +msgid "Application Id" +msgstr "" + +#. module: olap +#: model:ir.actions.todo,note:olap.config_auto_directory +msgid "This wizard will configure the URL of the web client" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_view_olap_fact_database_form +#: model:ir.ui.menu,name:olap.menu_bi_conf_fact +msgid "Fact Databases" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_browser_url +msgid "Cube Browser" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_action_olap_dimension_form +msgid "Olap Dimension" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_database_columns +msgid "Olap Database Columns" +msgstr "" + +#. module: olap +#: view:olap.parameters.config.wizard:0 +msgid "BI Web Client." +msgstr "" + +#. module: olap +#: help:olap.fact.database,db_port:0 +msgid " Port to be used in connection" +msgstr "" + +#. module: olap +#: field:olap.database.columns,primary_key:0 +msgid "Primary Key" +msgstr "Primaarvõti" + +#. module: olap +#: field:olap.database.columns,table_id:0 +msgid "Table Id" +msgstr "" + +#. module: olap +#: view:olap.parameters.config.wizard:0 +msgid "This wizard will automatically configure the web client for BI." +msgstr "" + +#. module: olap +#: field:olap.fact.database,type:0 +msgid "Database type" +msgstr "Andmebaasi tüüp" + +#. module: olap +#: wizard_view:olap.query_builder,back:0 +#: wizard_view:olap.query_builder,init:0 +msgid "Cube Fetcher" +msgstr "" + +#. module: olap +#: wizard_view:olap.load.table,info:0 +#: wizard_view:olap.load.table,ok:0 +msgid "Your database structure has been correctly loaded" +msgstr "Teie andmebaasi struktuuri on õigesti laetud" + +#. module: olap +#: model:ir.model,name:olap.model_olap_parameters_config_wizard +msgid "Olap Server Parameters" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_cube_table_form +msgid "Olap Cube Tables" +msgstr "" + +#. module: olap +#: field:olap.measure,formatstring:0 +msgid "Format string" +msgstr "" + +#. module: olap +#: wizard_button:olap.query_builder,exec,exec:0 +#: wizard_button:olap.query_builder,ok,exec:0 +msgid "Execute" +msgstr "" + +#. module: olap +#: wizard_button:olap.application.configuration,configure,end:0 +#: wizard_button:olap.fact.database.test_connection,init,end:0 +#: wizard_button:olap.load.table,info,end:0 +#: wizard_button:olap.query.logs.clear,info,end:0 +#: wizard_button:olap.query.logs.clear,ok,end:0 +#: view:olap.warehouse.wizard:0 +msgid "Ok" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_bi_conf_known_application +msgid "Known Application" +msgstr "" + +#. module: olap +#: wizard_field:olap.query_builder,exec,level:0 +#: wizard_field:olap.query_builder,ok,level:0 +msgid "Level" +msgstr "" + +#. module: olap +#: field:olap.level,column_id_name:0 +#: field:olap.measure,value_column_id_name:0 +msgid "Column ID" +msgstr "" + +#. module: olap +#: view:bi.load.db.wizard:0 +msgid "" +"We will load the complete structure of the database by introspection, so " +"that you will be able to work on it, and specify a better structure " +"according to your reporting needs." +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_view_olap_application_form +msgid "Olap Applicatiion" +msgstr "" + +#. module: olap +#: field:olap.saved.query,name:0 +msgid "Query Name" +msgstr "" + +#. module: olap +#: wizard_field:olap.query_builder,exec,mdx_query:0 +#: wizard_field:olap.query_builder,ok,mdx_query:0 +msgid "MDX Query" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_bi_auto_configure_wizard +msgid "bi.auto.configure.wizard" +msgstr "" + +#. module: olap +#: field:olap.hierarchy,primary_key:0 +msgid "Primary key" +msgstr "Primaarvõti" + +#. module: olap +#: model:ir.actions.act_window,name:olap.act_bi_auto_configure +msgid "Auto Configuration" +msgstr "" + +#. module: olap +#: field:olap.schema,note:0 +msgid "Schema description" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.act_bi_load_db_wizard +msgid "Load database Structure" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_level +#: view:olap.level:0 +msgid "Olap level" +msgstr "" + +#. module: olap +#: selection:olap.measure,formatstring:0 +msgid "None (0000.00)" +msgstr "" + +#. module: olap +#: field:olap.fact.database,db_host:0 +msgid "Database host" +msgstr "Andmebaasi host" + +#. module: olap +#: model:ir.model,name:olap.model_olap_fact_database +msgid "Olap Fact Database" +msgstr "" + +#. module: olap +#: view:bi.auto.configure.wizard:0 +msgid "Auto Congifuring Tables" +msgstr "" + +#. module: olap +#: field:olap.application,name:0 +msgid "Application name" +msgstr "Rakenduse nimi" + +#. module: olap +#: field:olap.cube.table,column_link_id:0 +msgid "Relational Column" +msgstr "" + +#. module: olap +#: field:olap.level,type:0 +msgid "Level class" +msgstr "" + +#. module: olap +#: field:olap.cube,name:0 +msgid "Cube name" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_view_olap_application_table_form +msgid "Olap Applicatiion Table" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_saved_query +msgid "olap.saved.query" +msgstr "" + +#. module: olap +#: field:olap.level,column_name:0 +msgid "Columns Name" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_hierarchy_form +msgid "Olap Hierarchies" +msgstr "" + +#. module: olap +#: field:olap.schema,ready:0 +msgid "Ready" +msgstr "Valmis" + +#. module: olap +#: selection:olap.measure,measure_type:0 +#: field:olap.measure,value_column:0 +msgid "Fact Table Column" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_view_olap_database_tables_form +#: field:olap.application,table_ids:0 +#: view:olap.fact.database:0 +#: field:olap.fact.database,table_ids:0 +msgid "Tables" +msgstr "Tabelid" + +#. module: olap +#: model:ir.model,name:olap.model_olap_application +msgid "Olap application" +msgstr "" + +#. module: olap +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "Vigane mudeli nimi toimingu definitsioonis." + +#. module: olap +#: selection:olap.schema,state:0 +msgid "Schema is ready to use" +msgstr "Skeem on kasutamiseks valmis" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_designer_url +msgid "Cube Designer" +msgstr "" + +#. module: olap +#: field:olap.fact.database,db_login:0 +msgid "Database login" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_view_olap_application_table_form +msgid "Application Table" +msgstr "Rakenduse tabel" + +#. module: olap +#: wizard_view:olap.query.logs.clear,info:0 +#: wizard_view:olap.query.logs.clear,ok:0 +msgid "Logs Cleared successfully" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_schema +#: model:ir.ui.menu,name:olap.menu_action_olap_schema_form +#: view:olap.schema:0 +msgid "Olap Schema" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_view_olap_application_form +msgid "Application" +msgstr "" + +#. module: olap +#: wizard_field:olap.query_builder,exec,mdx_query_output:0 +#: wizard_field:olap.query_builder,ok,mdx_query_output:0 +msgid "MDX Query Output" +msgstr "" + +#. module: olap +#: field:olap.hierarchy,primary_key_table:0 +msgid "Primary key table" +msgstr "" + +#. module: olap +#: help:olap.measure,table_name:0 +msgid "" +"The name of the table on which the column is defined. If False, take the " +"table from the cube." +msgstr "" + +#. module: olap +#: view:olap.warehouse.wizard:0 +msgid "Warehouse" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_dimension_form +msgid "Olap Dimensions" +msgstr "" + +#. module: olap +#: field:olap.query.logs,user_id:0 +msgid "Tiny ERP User" +msgstr "" + +#. module: olap +#: model:ir.actions.wizard,name:olap.bi_application_configuration +msgid "Configure from Application" +msgstr "" + +#. module: olap +#: field:olap.fact.database,db_port:0 +msgid "Database port" +msgstr "" + +#. module: olap +#: help:olap.parameters.config.wizard,host_port:0 +msgid "" +"Put the port for the server. Put 8080 if its not clear." +msgstr "" + +#. module: olap +#: selection:olap.schema,state:0 +msgid "The Structure is Loaded" +msgstr "" + +#. module: olap +#: field:olap.dimension,cube_id:0 +#: field:olap.measure,cube_id:0 +#: field:olap.query.logs,cube_id:0 +#: field:olap.saved.query,cube_id:0 +msgid "Cube" +msgstr "" + +#. module: olap +#: field:olap.cube.table,available_table_ids:0 +msgid "Available Tables" +msgstr "" + +#. module: olap +#: view:olap.schema:0 +msgid "Configure Manually" +msgstr "" + +#. module: olap +#: field:olap.database.columns,related_to:0 +msgid "Related To" +msgstr "" + +#. module: olap +#: view:olap.database.columns:0 +#: view:olap.database.tables:0 +msgid "Olap database columns" +msgstr "" + +#. module: olap +#: field:olap.cube.table.line,field_id:0 +msgid "Link Field" +msgstr "" + +#. module: olap +#: view:olap.schema:0 +msgid "Mark as Configured" +msgstr "" + +#. module: olap +#: view:olap.application.field:0 +msgid "Olap Application Field" +msgstr "" + +#. module: olap +#: selection:olap.measure,formatstring:0 +msgid "Comma Seperator (0,000)" +msgstr "" + +#. module: olap +#: field:olap.measure,agregator:0 +msgid "Agregator" +msgstr "" + +#. module: olap +#: wizard_view:olap.application.configuration,configure:0 +msgid "Your database structure (Open ERP) has been sucessfully configured." +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_bi_configuration +msgid "Configuration" +msgstr "" + +#. module: olap +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: olap +#: help:olap.parameters.config.wizard,host_name:0 +msgid "" +"Put here the server address or IP Put localhost if its not " +"clear." +msgstr "" + +#. module: olap +#: view:olap.database.tables:0 +msgid "Database tables" +msgstr "" + +#. module: olap +#: view:olap.schema:0 +msgid "Reload Structure" +msgstr "" + +#. module: olap +#: wizard_view:olap.application.configuration,init:0 +msgid "This will Auto Configure Application" +msgstr "" + +#. module: olap +#: view:bi.load.db.wizard:0 +msgid "Load Data Structure" +msgstr "" + +#. module: olap +#: view:bi.auto.configure.wizard:0 +#: view:bi.load.db.wizard:0 +#: wizard_button:olap.application.configuration,init,end:0 +#: wizard_button:olap.load.table,init,end:0 +#: view:olap.parameters.config.wizard:0 +#: wizard_button:olap.query.logs.clear,init,end:0 +#: wizard_button:olap.query_builder,exec,end:0 +#: wizard_button:olap.query_builder,ok,end:0 +msgid "Cancel" +msgstr "" + +#. module: olap +#: view:bi.load.db.wizard:0 +msgid "" +"After having loaded the structure, you will be able to hide/show or rename " +"tables and columns to simplify end-users interface. The following database " +"will be loaded:" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_level_form +#: model:ir.ui.menu,name:olap.menu_action_olap_level_form +#: view:olap.level:0 +msgid "Olap Level" +msgstr "" + +#. module: olap +#: field:olap.fact.database,loaded:0 +msgid "Loaded" +msgstr "" + +#. module: olap +#: help:olap.fact.database,db_name:0 +msgid "Name of the database to be used for analysis." +msgstr "" + +#. module: olap +#: help:olap.fact.database,db_login:0 +msgid "Login for the database name specified." +msgstr "" + +#. module: olap +#: field:olap.hierarchy,dimension_id:0 +#: wizard_field:olap.query_builder,exec,dimension:0 +#: wizard_field:olap.query_builder,ok,dimension:0 +msgid "Dimension" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_application_table +msgid "Olap application table" +msgstr "" + +#. module: olap +#: wizard_view:olap.load.table,init:0 +msgid "" +"We will load the complete structure of the database by introspection, " +"so that you will be able to work on it, and specify a better structure " +"according to your reporting needs." +msgstr "" + +#. module: olap +#: field:olap.saved.query,axis_keys:0 +msgid "Axis Keys" +msgstr "" + +#. module: olap +#: field:olap.cube,query_log:0 +msgid "Query Logging" +msgstr "" + +#. module: olap +#: field:olap.measure,measure_type:0 +msgid "Measure Type" +msgstr "" + +#. module: olap +#: field:olap.database.tables,fact_database_id:0 +msgid "Database Id" +msgstr "" + +#. module: olap +#: help:olap.fact.database,db_host:0 +msgid "Give hostname to make connection to the database." +msgstr "" + +#. module: olap +#: field:olap.level,hierarchy_id:0 +msgid "Hierarchy" +msgstr "" + +#. module: olap +#: selection:olap.schema,state:0 +msgid "The Structure is Configured." +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_schema_form +msgid "Olap Schemas" +msgstr "" + +#. module: olap +#: field:olap.cube,table_id:0 +msgid "Fact table" +msgstr "" + +#. module: olap +#: view:bi.auto.configure.wizard:0 +msgid "" +"This will Auto Configure Application. This will help to increase the " +"readability of the tables and columns by giving it meaningful and easy to " +"comprehend name. You can hides particular data and columns by reconfiguring " +"the structure option." +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_view_olap_application_field_form +msgid "Olap Applicatiion Field" +msgstr "" + +#. module: olap +#: field:olap.query.logs,query:0 +#: field:olap.saved.query,query:0 +#: view:olap.warehouse.wizard:0 +#: field:olap.warehouse.wizard,query:0 +msgid "Query" +msgstr "" + +#. module: olap +#: view:olap.schema:0 +msgid "Auto Application Configuration" +msgstr "" + +#. module: olap +#: selection:olap.measure,formatstring:0 +msgid "Postfix Default Currency(0000.00 EUR)" +msgstr "" + +#. module: olap +#: field:bi.load.db.wizard,db_name:0 +#: wizard_field:olap.load.table,init,db_name:0 +msgid "Database Name" +msgstr "" + +#. module: olap +#: field:olap.cube,measure_ids:0 +msgid "Measures" +msgstr "" + +#. module: olap +#: model:ir.actions.wizard,name:olap.bi_conf_cube_query_builder +#: wizard_view:olap.query_builder,exec:0 +#: wizard_view:olap.query_builder,ok:0 +msgid "Query Builder" +msgstr "" + +#. module: olap +#: field:olap.cube,dimension_ids:0 +msgid "Dimensions" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_cube +#: view:olap.cube:0 +msgid "Olap cube" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_warehouse +#: model:ir.model,name:olap.model_olap_warehouse_wizard +#: model:ir.ui.menu,name:olap.menu_bi_warehouse +msgid "Olap Warehouse" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_view_olap_application_field_form +msgid "Application Field" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_dimension +#: view:olap.dimension:0 +msgid "Olap dimension" +msgstr "" + +#. module: olap +#: field:olap.application.field,name:0 +msgid "Application field name" +msgstr "" + +#. module: olap +#: view:olap.fact.database:0 +msgid "Connection parameters" +msgstr "" + +#. module: olap +#: field:bi.auto.configure.wizard,name:0 +#: field:bi.load.db.wizard,fact_table:0 +#: wizard_field:olap.load.table,init,fact_table:0 +msgid "Fact Name" +msgstr "" + +#. module: olap +#: view:olap.database.columns:0 +msgid "Database columns" +msgstr "" + +#. module: olap +#: field:olap.application.table,table_name:0 +#: field:olap.cube.table,name:0 +#: field:olap.level,table_name:0 +#: field:olap.measure,table_name:0 +msgid "Table name" +msgstr "" + +#. module: olap +#: help:olap.measure,measure_type:0 +msgid "Select between auto column or sql expression for the measures" +msgstr "" + +#. module: olap +#: model:ir.actions.wizard,name:olap.bi_load_column +msgid "Open Columns" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_view_olap_database_columns_form +#: field:olap.database.tables,columns:0 +msgid "Columns" +msgstr "" + +#. module: olap +#: model:ir.actions.wizard,name:olap.bi_test_connection +#: view:olap.fact.database:0 +msgid "Test Connection" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_measure_form +#: model:ir.ui.menu,name:olap.menu_action_olap_measure_form +msgid "Olap Measures" +msgstr "" + +#. module: olap +#: wizard_button:olap.application.configuration,init,configure:0 +#: view:olap.parameters.config.wizard:0 +msgid "Configure" +msgstr "" + +#. module: olap +#: wizard_view:olap.load.table,init:0 +msgid "" +"After having loaded the structure, you will be able to hide/show or " +"rename tables and columns to simplify end-users interface. The following " +"database will be loaded:" +msgstr "" + +#. module: olap +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" + +#. module: olap +#: wizard_field:olap.query_builder,exec,hierarchy:0 +#: wizard_field:olap.query_builder,ok,hierarchy:0 +msgid "Hiearchy" +msgstr "" + +#. module: olap +#: selection:olap.measure,measure_type:0 +#: field:olap.measure,value_sql:0 +msgid "SQL Expression" +msgstr "" + +#. module: olap +#: model:ir.actions.wizard,name:olap.bi_menu_olap_load_table +msgid "Load Tables" +msgstr "" + +#. module: olap +#: field:olap.hierarchy,level_ids:0 +msgid "Levels" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_application_field +msgid "Olap application field" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_view_olap_database_columns_form +msgid "Database Columns" +msgstr "" + +#. module: olap +#: field:olap.database.columns,active:0 +#: field:olap.database.tables,active:0 +msgid "Active" +msgstr "" + +#. module: olap +#: selection:olap.measure,datatype:0 +msgid "Integer" +msgstr "" + +#. module: olap +#: wizard_view:olap.application.configuration,init:0 +msgid " Auto Configure " +msgstr "" + +#. module: olap +#: selection:olap.measure,agregator:0 +msgid "Sum" +msgstr "" + +#. module: olap +#: wizard_field:olap.query.logs.clear,init,user_name:0 +#: field:olap.saved.query,user_id:0 +msgid "User" +msgstr "" + +#. module: olap +#: field:olap.query.logs,count:0 +msgid "Count" +msgstr "" + +#. module: olap +#: field:olap.database.tables,name:0 +msgid "End-User Name" +msgstr "" + +#. module: olap +#: selection:olap.measure,formatstring:0 +msgid "Postfix Default Currency with comma seperator (0,000.00 EUR)" +msgstr "" + +#. module: olap +#: field:olap.measure,datatype:0 +msgid "Datatype" +msgstr "" + +#. module: olap +#: wizard_button:olap.query_builder,back,ok:0 +#: wizard_button:olap.query_builder,init,ok:0 +msgid "Fetch Data" +msgstr "" + +#. module: olap +#: selection:olap.measure,formatstring:0 +msgid "Prefix Default Currency with comma seperator (EUR 0,000.00)" +msgstr "" + +#. module: olap +#: wizard_view:olap.load.table,info:0 +#: wizard_view:olap.load.table,ok:0 +#: wizard_view:olap.query.logs.clear,info:0 +#: wizard_view:olap.query.logs.clear,ok:0 +msgid "Load Data" +msgstr "" + +#. module: olap +#: field:olap.cube,query_ids:0 +msgid "Queries" +msgstr "" + +#. module: olap +#: selection:olap.fact.database,type:0 +msgid "Oracle" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_cube_form +#: model:ir.ui.menu,name:olap.menu_action_olap_cube_form +#: model:ir.ui.menu,name:olap.menu_bi_conf_cubes +msgid "Olap Cubes" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_action_olap_cube_table_form +msgid "Olap Cubes Table" +msgstr "" + +#. module: olap +#: field:olap.measure,name:0 +msgid "Measure name" +msgstr "" + +#. module: olap +#: selection:olap.fact.database,connection_type:0 +msgid "Socket" +msgstr "" + +#. module: olap +#: field:olap.fact.database,connection_type:0 +msgid "Connection type" +msgstr "" + +#. module: olap +#: selection:olap.measure,agregator:0 +msgid "count" +msgstr "" + +#. module: olap +#: field:olap.fact.database,db_name:0 +msgid "Database name" +msgstr "" + +#. module: olap +#: field:olap.database.columns,type:0 +msgid "Type" +msgstr "" + +#. module: olap +#: view:olap.database.columns:0 +#: view:olap.database.tables:0 +msgid "Show" +msgstr "" + +#. module: olap +#: wizard_button:olap.query_builder,exec,back:0 +#: wizard_button:olap.query_builder,ok,back:0 +msgid "Change cube" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_view_olap_database_tables_form +#: view:olap.cube.table:0 +#: field:olap.cube.table,line_ids:0 +msgid "Database Tables" +msgstr "" + +#. module: olap +#: help:olap.level,table_name:0 +msgid "" +"The name of the table on which the column is defined. If False, take the " +"table from the hierarchy." +msgstr "" + +#. module: olap +#: selection:olap.schema,state:0 +msgid "Nothing has been Configured" +msgstr "" + +#. module: olap +#: field:olap.dimension,name:0 +msgid "Dimension name" +msgstr "" + +#. module: olap +#: wizard_button:olap.load.table,ok,end:0 +msgid "Continue and Configure Structure" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_measure +#: view:olap.measure:0 +msgid "Olap measure" +msgstr "" + +#. module: olap +#: help:olap.cube,table_id:0 +msgid "Table(s) for cube." +msgstr "" + +#. module: olap +#: wizard_field:olap.query_builder,exec,measure:0 +#: wizard_field:olap.query_builder,ok,measure:0 +msgid "Measure" +msgstr "" + +#. module: olap +#: field:olap.database.columns,column_db_name:0 +msgid "Column DBName" +msgstr "" + +#. module: olap +#: selection:olap.schema,state:0 +msgid "We Can Start building Cube" +msgstr "" + +#. module: olap +#: field:olap.cube.table.line,table_id:0 +msgid "Database Table" +msgstr "" + +#. module: olap +#: field:olap.schema,name:0 +msgid "Schema name" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_query_logs_my_form +#: model:ir.ui.menu,name:olap.menu_action_olap_query_logs_my_form +#: view:olap.query.logs:0 +msgid "My Logs" +msgstr "" + +#. module: olap +#: view:olap.fact.database:0 +msgid "Information" +msgstr "" + +#. module: olap +#: wizard_field:olap.query_builder,back,cube_schema:0 +#: wizard_field:olap.query_builder,init,cube_schema:0 +msgid "Select Cube" +msgstr "" + +#. module: olap +#: field:olap.hierarchy,table_id:0 +msgid "Fact table(s)" +msgstr "" + +#. module: olap +#: model:ir.actions.url,name:olap.menu_url_cube_designer +msgid "name_menu_url_cube_designer" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_config_bi_parameters +msgid "Parameters Configuration" +msgstr "" + +#. module: olap +#: view:olap.schema:0 +msgid "Connect to Database" +msgstr "" + +#. module: olap +#: selection:olap.schema,state:0 +msgid "Database Connected" +msgstr "" + +#. module: olap +#: field:olap.application.field,table_name:0 +#: field:olap.application.table,name:0 +msgid "Application table name" +msgstr "" + +#. module: olap +#: help:olap.hierarchy,table_id:0 +msgid "Table(s) to make hierarchy on the cube." +msgstr "" + +#. module: olap +#: view:olap.fact.database:0 +msgid "General information" +msgstr "" + +#. module: olap +#: field:olap.application,query:0 +msgid "Application Query" +msgstr "" + +#. module: olap +#: help:olap.cube,query_log:0 +msgid "Enabling this will log all the queries in the browser" +msgstr "" + +#. module: olap +#: field:olap.saved.query,mdx_id:0 +msgid "Module" +msgstr "" + +#. module: olap +#: field:olap.application.field,is_hidden:0 +#: field:olap.application.table,is_hidden:0 +#: field:olap.database.columns,hide:0 +#: field:olap.database.tables,hide:0 +msgid "Hidden" +msgstr "" + +#. module: olap +#: field:olap.dimension,hierarchy_ids:0 +msgid "Hierarchies" +msgstr "" + +#. module: olap +#: field:olap.query.logs,result_size:0 +msgid "Result Size" +msgstr "" + +#. module: olap +#: view:olap.application:0 +msgid "Olap Application" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_database_tables +msgid "Olap Database Tables" +msgstr "" + +#. module: olap +#: selection:olap.measure,formatstring:0 +msgid "Prefix Default Currency (EUR 0000.00)" +msgstr "" + +#. module: olap +#: view:olap.cube.table:0 +msgid "Olap cube_table" +msgstr "" + +#. module: olap +#: view:olap.parameters.config.wizard:0 +msgid "Parameters Configure" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_hierarchy +#: view:olap.hierarchy:0 +msgid "Olap hierarchy" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_cube_table +#: model:ir.model,name:olap.model_olap_cube_table_line +msgid "Olap cube table" +msgstr "" + +#. module: olap +#: field:olap.application.field,field_name:0 +msgid "Field name" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_olap_query_logs +msgid "Olap query logs" +msgstr "" + +#. module: olap +#: field:olap.fact.database,name:0 +msgid "Fact name" +msgstr "" + +#. module: olap +#: help:olap.measure,formatstring:0 +msgid " Let you specify how the measure to be displayed in cube browser" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_bi_server_parameters +msgid "Server Parameters" +msgstr "" + +#. module: olap +#: wizard_view:olap.load.table,init:0 +#: wizard_button:olap.load.table,init,ok:0 +#: view:olap.schema:0 +msgid "Load Database Structure" +msgstr "" + +#. module: olap +#: field:olap.level,name:0 +msgid "Level name" +msgstr "" + +#. module: olap +#: field:olap.cube,schema_id:0 +#: field:olap.query.logs,schema_id:0 +#: field:olap.saved.query,schema_id:0 +msgid "Schema" +msgstr "" + +#. module: olap +#: field:olap.fact.database,connection_url:0 +#: field:olap.schema,app_detect:0 +msgid "Connection URL" +msgstr "" + +#. module: olap +#: field:olap.schema,cube_ids:0 +msgid "Cubes" +msgstr "" + +#. module: olap +#: view:olap.schema:0 +msgid "ReConfigure Structure" +msgstr "" + +#. module: olap +#: field:olap.application,field_ids:0 +msgid "Fields" +msgstr "" + +#. module: olap +#: selection:olap.measure,agregator:0 +msgid "Average" +msgstr "" + +#. module: olap +#: view:bi.load.db.wizard:0 +msgid "Load Database Tables" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_action_olap_hierarchy_form +msgid "Olap Hierarchy" +msgstr "" + +#. module: olap +#: field:olap.cube.table.line,cube_table_id:0 +msgid "Cube Table" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_bi +msgid "Businesss Intelligence" +msgstr "" + +#. module: olap +#: model:ir.model,name:olap.model_bi_load_db_wizard +msgid "bi.load.db.wizard" +msgstr "" + +#. module: olap +#: model:ir.actions.url,name:olap.menu_url_cube_browser +msgid "name_menu_url_cube_browser" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_view_olap_fact_database_form +msgid "Databases" +msgstr "" + +#. module: olap +#: field:olap.hierarchy,name:0 +msgid "Hierarchy name" +msgstr "" + +#. module: olap +#: model:ir.module.module,description:olap.module_meta_information +msgid "" +"\n" +" Base module to manage Olap schemas. Cube designer.\n" +" " +msgstr "" + +#. module: olap +#: view:olap.cube.table:0 +msgid "Joined Tables" +msgstr "" + +#. module: olap +#: field:olap.schema,loaded:0 +msgid "Loading Datastructure" +msgstr "" + +#. module: olap +#: view:olap.cube.table:0 +msgid "Joined Table" +msgstr "" + +#. module: olap +#: selection:olap.fact.database,type:0 +msgid "PostgreSQL" +msgstr "" + +#. module: olap +#: wizard_view:olap.query.logs.clear,init:0 +msgid " To Load Data" +msgstr "" + +#. module: olap +#: field:olap.hierarchy,sequence:0 +#: field:olap.level,sequence:0 +msgid "Sequence" +msgstr "" + +#. module: olap +#: model:ir.ui.menu,name:olap.menu_bi_conf_tools +msgid "Tools" +msgstr "" + +#. module: olap +#: field:olap.schema,state:0 +msgid "Schema State" +msgstr "" + +#. module: olap +#: selection:olap.measure,datatype:0 +msgid "Float" +msgstr "" + +#. module: olap +#: model:ir.actions.act_window,name:olap.action_olap_query_logs_form +#: model:ir.ui.menu,name:olap.menu_action_olap_query_logs_form +#: view:olap.query.logs:0 +msgid "All Logs" +msgstr "" + +#. module: olap +#: selection:olap.fact.database,connection_type:0 +#: field:olap.parameters.config.wizard,host_port:0 +msgid "Port" +msgstr "" + +#. module: olap +#: view:olap.fact.database:0 +msgid "Fact database" +msgstr "" + +#. module: olap +#: model:ir.module.module,shortdesc:olap.module_meta_information +msgid "olap" +msgstr "" + +#. module: olap +#: field:olap.database.columns,name:0 +msgid "Column Name" +msgstr "" + +#. module: olap +#: field:olap.database.tables,table_db_name:0 +msgid "Table Name" +msgstr "" + +#. module: olap +#: wizard_view:olap.application.configuration,configure:0 +msgid "Auto Configure" +msgstr "" + +#. module: olap +#: field:olap.schema,configure:0 +msgid "Configuring Datastructure" +msgstr "" + +#. module: olap +#: model:ir.actions.wizard,name:olap.bi_load_configuration_table +msgid "Open Configuration" +msgstr "" + +#. module: olap +#: view:olap.schema:0 +msgid "Configure Automatically " +msgstr "" + +#. module: olap +#: model:ir.actions.wizard,name:olap.bi_clear_logs +#: model:ir.ui.menu,name:olap.menu_bi_clear_logs +#: wizard_button:olap.query.logs.clear,init,ok:0 +msgid "Clear Logs" +msgstr "" diff --git a/addons/olap/wizard/__init__.py b/addons/olap/wizard/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap/wizard/wizard_load_configured_table.py b/addons/olap/wizard/wizard_load_configured_table.py old mode 100755 new mode 100644 diff --git a/addons/olap/wizard/wizard_load_data.py b/addons/olap/wizard/wizard_load_data.py old mode 100755 new mode 100644 diff --git a/addons/olap/wizard/wizard_query_builder.py b/addons/olap/wizard/wizard_query_builder.py old mode 100755 new mode 100644 diff --git a/addons/olap/wizard/wizard_test_connection.py b/addons/olap/wizard/wizard_test_connection.py old mode 100755 new mode 100644 diff --git a/addons/olap_crm/__init__.py b/addons/olap_crm/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap_crm/i18n/de.po b/addons/olap_crm/i18n/de.po new file mode 100644 index 0000000000000000000000000000000000000000..f304ac7ea7f88250a396959c71f7e531af86f2b7 --- /dev/null +++ b/addons/olap_crm/i18n/de.po @@ -0,0 +1,31 @@ +# German translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-11-26 05:29+0000\n" +"PO-Revision-Date: 2010-05-01 20:41+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-05 03:48+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: olap_crm +#: model:ir.module.module,description:olap_crm.module_meta_information +msgid "" +"\n" +" Sale module will load the data in olap tables\n" +" " +msgstr "" + +#. module: olap_crm +#: model:ir.module.module,shortdesc:olap_crm.module_meta_information +msgid "olap_crm" +msgstr "" diff --git a/addons/olap_crm/olap_crm.xml b/addons/olap_crm/olap_crm.xml old mode 100755 new mode 100644 diff --git a/addons/olap_crm/olap_data.xml b/addons/olap_crm/olap_data.xml old mode 100755 new mode 100644 diff --git a/addons/olap_extract/__init__.py b/addons/olap_extract/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap_extract/i18n/et.po b/addons/olap_extract/i18n/et.po new file mode 100644 index 0000000000000000000000000000000000000000..8c1cc7cffa4f20748743dc08871b436d5588d948 --- /dev/null +++ b/addons/olap_extract/i18n/et.po @@ -0,0 +1,56 @@ +# Estonian translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-11-26 05:29+0000\n" +"PO-Revision-Date: 2010-05-05 21:38+0000\n" +"Last-Translator: lyyser <logard.1961@gmail.com>\n" +"Language-Team: Estonian <et@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: olap_extract +#: model:ir.module.module,shortdesc:olap_extract.module_meta_information +msgid "olap_extract" +msgstr "" + +#. module: olap_extract +#: wizard_button:olap.extract.schema,init,ok:0 +msgid "OK" +msgstr "OK" + +#. module: olap_extract +#: model:ir.actions.wizard,name:olap_extract.bi_olap_extract_schema +msgid "Olap Extract" +msgstr "" + +#. module: olap_extract +#: model:ir.module.module,description:olap_extract.module_meta_information +msgid "" +"\n" +" Extracts the schema structure.\n" +" " +msgstr "" + +#. module: olap_extract +#: wizard_field:olap.extract.schema,init,module_name:0 +msgid "Module Name" +msgstr "Mooduli nimi" + +#. module: olap_extract +#: wizard_button:olap.extract.schema,init,end:0 +msgid "Cancel" +msgstr "Katkesta" + +#. module: olap_extract +#: wizard_view:olap.extract.schema,init:0 +msgid "New Module Name" +msgstr "Uus mooduli nimi" diff --git a/addons/olap_extract/olap_extract_wizard.xml b/addons/olap_extract/olap_extract_wizard.xml old mode 100755 new mode 100644 diff --git a/addons/olap_extract/wizard_olap_extract.py b/addons/olap_extract/wizard_olap_extract.py old mode 100755 new mode 100644 diff --git a/addons/olap_sale/__init__.py b/addons/olap_sale/__init__.py old mode 100755 new mode 100644 diff --git a/addons/olap_sale/i18n/es.po b/addons/olap_sale/i18n/es.po new file mode 100644 index 0000000000000000000000000000000000000000..320a945f7122c3a4050f9a045f2f0a248e2b1010 --- /dev/null +++ b/addons/olap_sale/i18n/es.po @@ -0,0 +1,34 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-11-26 05:29+0000\n" +"PO-Revision-Date: 2010-04-28 19:27+0000\n" +"Last-Translator: Shay <Unknown>\n" +"Language-Team: Spanish <es@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-04-29 03:52+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: olap_sale +#: model:ir.module.module,description:olap_sale.module_meta_information +msgid "" +"\n" +" Sale module will load the data in olap tables\n" +" " +msgstr "" +"\n" +" El módulo de ventas cargará los datos en una tabla olap\n" +" " + +#. module: olap_sale +#: model:ir.module.module,shortdesc:olap_sale.module_meta_information +msgid "olap_sale" +msgstr "" diff --git a/addons/olap_sale/olap_data.xml b/addons/olap_sale/olap_data.xml old mode 100755 new mode 100644 diff --git a/addons/product/process/product_process.xml b/addons/product/process/product_process.xml old mode 100755 new mode 100644 diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml index 4d71b0d480a9b58a19017a3af3ff85d91d97a1cb..764e1277c93ecb577e865c28776bd59d405ea957 100644 --- a/addons/product/security/product_security.xml +++ b/addons/product/security/product_security.xml @@ -10,13 +10,10 @@ </record> - <record model="ir.rule.group" id="product_comp_rule_group"> - <field name="name" >Product multi-company</field> + <record id="product_comp_rule" model="ir.rule"> + <field name="name" >Product multi-company</field> <field name="model_id" ref="model_product_template"/> <field name="global" eval="True"/> - </record> - <record id="product_comp_rule" model="ir.rule"> - <field name="rule_group" ref="product_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> diff --git a/addons/profile_manufacturing/i18n/pt_BR.po b/addons/profile_manufacturing/i18n/pt_BR.po index b7ebdce281a8c1cb3dd723029a53e2809d66ccde..ca245a1e0dd4f2040842d1421cd1f0464a492e2f 100644 --- a/addons/profile_manufacturing/i18n/pt_BR.po +++ b/addons/profile_manufacturing/i18n/pt_BR.po @@ -7,24 +7,24 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-09-08 16:46+0000\n" -"Last-Translator: Aldo Giovani <aldogiovani@gmail.com>\n" +"PO-Revision-Date: 2010-05-01 19:21+0000\n" +"Last-Translator: sbrianti <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:16+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:48+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,mrp_operation:0 msgid "Manufacturing Operations" -msgstr "" +msgstr "Operações de Manufatura" #. module: profile_manufacturing #: model:ir.module.module,description:profile_manufacturing.module_meta_information msgid "Profile for manufacturing industries" -msgstr "" +msgstr "Perfil para indústrias de manufatura" #. module: profile_manufacturing #: constraint:ir.model:0 @@ -37,22 +37,22 @@ msgstr "" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,mrp_jit:0 msgid "Just in Time Scheduling" -msgstr "" +msgstr "Agendamento de Just in Time" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,sale_journal:0 msgid "Manage by Journals" -msgstr "" +msgstr "Gerenciamento por Diários" #. module: profile_manufacturing #: view:profile.manufacturing.config.install_modules_wizard:0 msgid "Relationship Management" -msgstr "" +msgstr "Gestão de Relacionamentos" #. module: profile_manufacturing #: help:profile.manufacturing.config.install_modules_wizard,portal:0 msgid "This module allows you to manage a Portal system." -msgstr "" +msgstr "Este módulo permite o gerenciamento de um sistema de portal." #. module: profile_manufacturing #: help:profile.manufacturing.config.install_modules_wizard,board_document:0 @@ -62,6 +62,11 @@ msgid "" "documents, printed reports, calendar system). It opens an FTP access for the " "users to easily browse association's document." msgstr "" +"O Sistema de Gerenciamento de Documentos do Open ERP permite que você " +"armazene, navegue, indexe automaticamente, busque e pré-visualize todos os " +"tipos de documentos (documentos internos, relatórios impressos, sistema de " +"calendário). Ele abre um acesso FTP para que os usuário naveguem com " +"facilidade pelos documentos." #. module: profile_manufacturing #: help:profile.manufacturing.config.install_modules_wizard,sale_journal:0 @@ -80,7 +85,7 @@ msgstr "" #: model:ir.actions.act_window,name:profile_manufacturing.action_config_install_module #: view:profile.manufacturing.config.install_modules_wizard:0 msgid "Manufacturing Profile: Install Extra Modules" -msgstr "" +msgstr "Perfil de manufatura: Instalar módulos extras" #. module: profile_manufacturing #: help:profile.manufacturing.config.install_modules_wizard,mrp_jit:0 @@ -101,17 +106,17 @@ msgstr "" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,board_document:0 msgid "Document Management" -msgstr "" +msgstr "Gerenciamento de Documentos" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,portal:0 msgid "Portal" -msgstr "" +msgstr "Portal" #. module: profile_manufacturing #: view:profile.manufacturing.config.install_modules_wizard:0 msgid "Stock & Manufacturing" -msgstr "" +msgstr "Estoque e Manufatura" #. module: profile_manufacturing #: help:profile.manufacturing.config.install_modules_wizard,mrp_repair:0 @@ -136,12 +141,12 @@ msgstr "" #. module: profile_manufacturing #: help:profile.manufacturing.config.install_modules_wizard,mrp_subproduct:0 msgid "This module allows you to add sub poducts in mrp bom." -msgstr "" +msgstr "Este módulo permite a inserção de subprodutos em um BoM de MRP." #. module: profile_manufacturing #: model:ir.module.module,shortdesc:profile_manufacturing.module_meta_information msgid "Manufacturing industry profile" -msgstr "" +msgstr "Perfil de indústria de manufatura" #. module: profile_manufacturing #: model:ir.model,name:profile_manufacturing.model_profile_manufacturing_config_install_modules_wizard @@ -159,12 +164,12 @@ msgstr "" #. module: profile_manufacturing #: view:profile.manufacturing.config.install_modules_wizard:0 msgid "Install" -msgstr "" +msgstr "Instalar" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,sale_crm:0 msgid "CRM and Calendars" -msgstr "" +msgstr "CRM e Calendários" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,mrp_repair:0 @@ -188,22 +193,22 @@ msgstr "" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,mrp_subproduct:0 msgid "Mrp Sub Product" -msgstr "" +msgstr "Subproduto de MRP" #. module: profile_manufacturing #: view:profile.manufacturing.config.install_modules_wizard:0 msgid "Sales Management" -msgstr "" +msgstr "Gerenciamento de Vendas" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,warning:0 msgid "Warning" -msgstr "" +msgstr "Aviso" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,sale_margin:0 msgid "Margins on Sales Order" -msgstr "" +msgstr "Margens em Ordens de Venda" #. module: profile_manufacturing #: help:profile.manufacturing.config.install_modules_wizard,stock_location:0 @@ -218,14 +223,14 @@ msgstr "" #. module: profile_manufacturing #: view:profile.manufacturing.config.install_modules_wizard:0 msgid "Cancel" -msgstr "" +msgstr "Cancelar" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,point_of_sale:0 msgid "Point of Sale" -msgstr "" +msgstr "Ponto de Venda" #. module: profile_manufacturing #: field:profile.manufacturing.config.install_modules_wizard,stock_location:0 msgid "Advanced Locations" -msgstr "" +msgstr "Locais Avançados" diff --git a/addons/project/i18n/pt_BR.po b/addons/project/i18n/pt_BR.po index 17b221b6285580ad234df04b6119485dd1bf4f31..7ec6b3a0dfdbc2c6e5e1640e8fe7ad2900cb1477 100644 --- a/addons/project/i18n/pt_BR.po +++ b/addons/project/i18n/pt_BR.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: pt_BR\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-02-22 19:37+0000\n" +"PO-Revision-Date: 2010-04-27 11:00+0000\n" "Last-Translator: Luiz Fernando M.França <Unknown>\n" "Language-Team: <pt@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n" +"X-Launchpad-Export-Date: 2010-04-28 03:44+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project @@ -461,7 +461,7 @@ msgstr "Tempo Planejado" #: view:project.task:0 #: view:project.task.work:0 msgid "Task Work" -msgstr "Trabalho na Tarefa" +msgstr "Tarefas realizadas" #. module: project #: selection:res.company,project_time_mode:0 diff --git a/addons/project/process/task_process.xml b/addons/project/process/task_process.xml old mode 100755 new mode 100644 diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 38a059cb352c0c6aa81f03b7d536b7b73fc5473d..fa795c12d6aef4a15d2bb9be70e7a2196cdc7593 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -443,6 +443,7 @@ <field name="view_mode">tree,form,calendar,gantt,graph</field> <field eval="False" name="filter"/> <field name="view_id" ref="view_task_tree2"/> + <field name="context">{"search_default_project_id":context.get('project_id',False)}</field> <field name="search_view_id" ref="view_task_search_form"/> </record> @@ -629,7 +630,7 @@ <field name="view_type">form</field> <field name="view_mode">tree,form</field> <field name="view_id" ref="view_project_message_tree"/> - <field name="context">{"search_default_my_msg":1}</field> + <field name="context">{"search_default_project_id":context.get('project_id',False), "search_default_my_msg":1}</field> <field name="search_view_id" ref="view_project_message_search"/> </record> diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml index 7fcb2e6fedb1a4bd625ee4eb8ad29cdf59a80fd1..447ee1af39e5d2515a6763100261abb3a488ca94 100644 --- a/addons/project/security/project_security.xml +++ b/addons/project/security/project_security.xml @@ -16,34 +16,25 @@ <field name="groups_id" eval="[(6,0,[ref('group_project_manager'), ref('group_project_finance')])]"/> </record> - <record model="ir.rule.group" id="project_comp_rule_group"> - <field name="name">Project multi-company</field> + <record model="ir.rule" id="project_comp_rule"> + <field name="name">Project multi-company</field> <field name="model_id" ref="model_project_project"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="project_comp_rule"> - <field name="rule_group" ref="project_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record model="ir.rule.group" id="task_comp_rule_group"> - <field name="name" >Task multi-company</field> + <record model="ir.rule" id="task_comp_rule"> + <field name="name" >Task multi-company</field> <field name="model_id" ref="model_project_task"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="task_comp_rule"> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="rule_group" ref="task_comp_rule_group"/> </record> - <record model="ir.rule.group" id="task_visibility_rule_group"> - <field name="name" >Tasks According to User and Project</field> + <record model="ir.rule" id="task_visibility_rule"> + <field name="name" >Tasks According to User and Project</field> <field name="model_id" ref="model_project_task"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="task_visibility_rule"> <field name="domain_force">['|','|','|',('user_id','=',False),('user_id','=',user.id),('project_id.members','=',user.id),('project_id.user_id','=',user.id)]</field> - <field name="rule_group" ref="task_visibility_rule_group"/> </record> </data> diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index b4ee058433ae7f60677a416382fb820abcd06e79..1615319c7b951eac3046b52b7bfd19b954425226 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -75,8 +75,8 @@ <field name="inherit_id" ref="project.view_task_tree2" /> <field name="arch" type="xml"> <field name="remaining_hours" position="after"> - <field name="timebox_id" groups="project_gtd.group_project_getting" invisible=" not context.get('set_visible',False)"/> - <button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open" groups="project_gtd.group_project_getting" invisible=" not context.get('set_visible',False)"/> + <field string="xxxxxx" name="timebox_id" groups="project_gtd.group_project_getting" invisible=" not context.get('set_visible',True)"/> + <button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open" groups="project_gtd.group_project_getting" invisible=" not context.get('set_visible',True)"/> <button name="next_timebox" type="object" icon="gtk-go-forward" string="Next" states="draft,pending,open" groups="project_gtd.group_project_getting" invisible=" not context.get('set_visible',False)"/> <button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert" help="For reopening the tasks" invisible="not context.get('set_visible',False)"/> </field> diff --git a/addons/project_issue/__init__.py b/addons/project_issue/__init__.py old mode 100755 new mode 100644 diff --git a/addons/project_issue/__openerp__.py b/addons/project_issue/__openerp__.py old mode 100755 new mode 100644 index 2bf67d4719133d02a4720fa50b105eb1a91669ff..b990142e1ea21c55b4ff440d7d1a9c98741a0421 --- a/addons/project_issue/__openerp__.py +++ b/addons/project_issue/__openerp__.py @@ -33,7 +33,6 @@ 'depends': [ 'crm', 'project', - 'hr_timesheet_sheet', ], 'init_xml': [ 'project_issue_data.xml' diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py old mode 100755 new mode 100644 index 74e1b5045bf007239598e72aee2a0f3f5141d7fe..3bf0bf397514df74080754ed6e76338a292f1140 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -128,16 +128,12 @@ class project_issue(osv.osv): 'day_close': fields.function(_compute_day, string='Days to Close', \ method=True, multi='day_close', type="integer", store=True), 'assigned_to' : fields.many2one('res.users', 'Assigned to'), - 'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'), - 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', - domain="[('partner_id', '=', partner_id)]", - required=True), } def _get_project(self, cr, uid, context): user = self.pool.get('res.users').browse(cr,uid,uid, context=context) if user.context_project_id: - return user.context_project_id + return user.context_project_id.id return False def convert_issue_task(self, cr, uid, ids, context=None): @@ -170,7 +166,7 @@ class project_issue(osv.osv): 'date': bug.date, 'project_id':bug.project_id.id, 'priority':bug.priority, - 'user_id':bug.user_id.id, + 'user_id':bug.assigned_to.id, 'planned_hours': 0.0, }) @@ -224,20 +220,3 @@ class project_issue(osv.osv): project_issue() -class account_analytic_line(osv.osv): - _inherit = 'account.analytic.line' - _columns = { - 'create_date' : fields.datetime('Create Date', readonly=True), - } - -account_analytic_line() - -class hr_analytic_issue(osv.osv): - _inherit = 'hr.analytic.timesheet' - - _columns = { - 'issue_id' : fields.many2one('project.issue', 'Issue'), - } - -hr_analytic_issue() - diff --git a/addons/project_issue/project_issue_data.xml b/addons/project_issue/project_issue_data.xml old mode 100755 new mode 100644 diff --git a/addons/project_issue/project_issue_demo.xml b/addons/project_issue/project_issue_demo.xml old mode 100755 new mode 100644 index 8794992b440c1ad309816bd8cfbb6fa3d7cb4180..7c7764a2e374896e6a855ff7df40978973300a2a --- a/addons/project_issue/project_issue_demo.xml +++ b/addons/project_issue/project_issue_demo.xml @@ -18,7 +18,6 @@ <field name="categ_id" ref="bug_categ"/> <field name="stage_id" ref="stage1"/> <field name="project_id" ref="project.project_project_22"/> - <field name="analytic_account_id" ref="account.analytic_agrolait"/> <field eval="15.0" name="duration"/> <field eval=""Bug in Accounts module"" name="name"/> <field eval=""agr@agrolait.com"" name="email_from"/> @@ -38,7 +37,6 @@ <field eval=""3"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_asus"/> - <field name="analytic_account_id" ref="account.analytic_asustek"/> <field eval=""done"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -55,8 +53,6 @@ <field name="type_id" ref="type1"/> <field eval=""4"" name="priority"/> <field name="user_id" ref="base.user_demo"/> - <field name="partner_id" ref="account.analytic_project_1"/> - <field name="analytic_account_id" ref="account.analytic_asustek"/> <field eval=""cancel"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -74,7 +70,6 @@ <field eval=""3"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_14"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""cancel"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -91,7 +86,6 @@ <field eval=""3"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_desertic_hispafuentes"/> - <field name="analytic_account_id" ref="account.analytic_desertic_hispafuentes"/> <field eval=""draft"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -109,7 +103,6 @@ <field eval=""3"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_5"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""pending"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -127,7 +120,6 @@ <field eval=""2"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_6"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""pending"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -145,7 +137,6 @@ <field eval=""2"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_6"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""pending"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -163,7 +154,6 @@ <field eval=""2"" name="priority"/> <field name="user_id" ref="base.user_demo"/> <field name="partner_id" ref="base.res_partner_5"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""open"" name="state"/> <field eval="1" name="active"/> <field eval="1.3" name="duration"/> @@ -180,7 +170,6 @@ <field eval=""2"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_2"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""open"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -198,7 +187,6 @@ <field eval=""4"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_maxtor"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""open"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -216,7 +204,6 @@ <field eval=""1"" name="priority"/> <field name="user_id" ref="base.user_demo"/> <field name="partner_id" ref="base.res_partner_9"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""done"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -235,7 +222,6 @@ <field eval=""3"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_10"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""cancel"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -256,7 +242,6 @@ <field eval=""3"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_6"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""draft"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -274,7 +259,6 @@ <field eval=""4"" name="priority"/> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_11"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""pending"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> @@ -292,7 +276,6 @@ <field eval=""2"" name="priority"/> <field name="user_id" ref="base.user_demo"/> <field name="partner_id" ref="base.res_partner_11"/> - <field name="analytic_account_id" ref="account.analytic_project_1"/> <field eval=""pending"" name="state"/> <field name="section_id" ref="crm.section_sales_department"/> <field eval="1" name="active"/> diff --git a/addons/project_issue/project_issue_menu.xml b/addons/project_issue/project_issue_menu.xml old mode 100755 new mode 100644 diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml old mode 100755 new mode 100644 index 343005d25d7ff1253ec528c74a4a888de09691eb..04168492d3896f95ad6ca6327da7b5fae61a2e7f --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -46,7 +46,6 @@ <field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/> <field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/> <field name="email_from"/> - <field name="analytic_account_id" /> </group> <group col="3" colspan="2"> <separator colspan="3" string="Status"/> @@ -132,24 +131,6 @@ context="{'mail':'new', 'model': 'project.issue'}" icon="gtk-go-forward" type="action" /> </page> - <page string="Worklogs"> - <separator string="Timesheets" colspan="4" /> - <field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : user_id, 'default_account_id' : analytic_account_id}"> - <tree editable="top" string="Timesheet"> - <field name="create_date" string="Date" /> - <field name="user_id" readonly="1" /> - <field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)"/> - <field name="name"/> - <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/> - - <field invisible="1" name="journal_id"/> - <field invisible="1" name="product_id"/> - <field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/> - <field invisible="1" name="amount"/> - <field invisible="1" name="general_account_id"/> - </tree> - </field> - </page> </notebook> </form> </field> diff --git a/addons/project_issue/report/__init__.py b/addons/project_issue/report/__init__.py old mode 100755 new mode 100644 diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py old mode 100755 new mode 100644 diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml old mode 100755 new mode 100644 diff --git a/addons/project_issue/security/project_issue_security.xml b/addons/project_issue/security/project_issue_security.xml old mode 100755 new mode 100644 index 6d87dd1a06f835853390055685569e8632d46f42..4f7c16cb70b55d13b7489753de221f4c83a58b54 --- a/addons/project_issue/security/project_issue_security.xml +++ b/addons/project_issue/security/project_issue_security.xml @@ -2,17 +2,12 @@ <openerp> <data noupdate="1"> - - - <record model="ir.rule.group" id="project_issue_rule_group"> - <field name="name">project.issue.rule.group</field> + <record id="project_issue_rule" model="ir.rule"> + <field name="name">project.issue.rule.group</field> <field name="model_id" search="[('model','=','project.issue')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record id="project_issue_rule" model="ir.rule"> <field name="domain_force">['|',('project_id','=',False),('project_id','=',user.context_project_id)]</field> - <field name="rule_group" ref="project_issue_rule_group"/> - </record> + </record> </data> </openerp> diff --git a/addons/project_issue_sheet/__init__.py b/addons/project_issue_sheet/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9af2040e50d3021a41bc0e8a3f46fe46541e30b --- /dev/null +++ b/addons/project_issue_sheet/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# 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, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +import project_issue_sheet +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_issue_sheet/__openerp__.py b/addons/project_issue_sheet/__openerp__.py new file mode 100644 index 0000000000000000000000000000000000000000..6fd6bebfe6c8ed09f50d6ae4c119167b81050313 --- /dev/null +++ b/addons/project_issue_sheet/__openerp__.py @@ -0,0 +1,47 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# 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, see <http://www.gnu.org/licenses/>. +# +############################################################################## + + +{ + 'name': 'Add the Timesheet support for Issue Management in Project Management', + 'version': '1.0', + 'category': 'Generic Modules/CRM & SRM', + 'description': """ + This module adds the Timesheet support for the Issues/Bugs Management in Project + """, + 'author': 'Tiny', + 'website': 'http://www.openerp.com', + 'depends': [ + 'project_issue', + 'hr_timesheet_sheet', + ], + 'init_xml': [ + ], + 'update_xml': [ + 'project_issue_sheet_view.xml', + ], + 'demo_xml': [ + ], + 'installable': True, + 'active': False, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_issue_sheet/project_issue_sheet.py b/addons/project_issue_sheet/project_issue_sheet.py new file mode 100644 index 0000000000000000000000000000000000000000..353fe6c28c1443d2a9fd2cf84a76f48a6a3a80bb --- /dev/null +++ b/addons/project_issue_sheet/project_issue_sheet.py @@ -0,0 +1,62 @@ + #-*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +import base64 +import os +import re +import time +import mx.DateTime +from datetime import datetime, timedelta + +import tools +from crm import crm +from osv import fields,osv,orm +from osv.orm import except_orm +from tools.translate import _ + +class project_issue(osv.osv): + _inherit = 'project.issue' + + _columns = { + 'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'), + 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', + domain="[('partner_id', '=', partner_id)]", + required=True), + } + +class account_analytic_line(osv.osv): + _inherit = 'account.analytic.line' + + _columns = { + 'create_date' : fields.datetime('Create Date', readonly=True), + } + +account_analytic_line() + +class hr_analytic_issue(osv.osv): + _inherit = 'hr.analytic.timesheet' + + _columns = { + 'issue_id' : fields.many2one('project.issue', 'Issue'), + } + +hr_analytic_issue() + diff --git a/addons/project_issue_sheet/project_issue_sheet_view.xml b/addons/project_issue_sheet/project_issue_sheet_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ed2e7fbdccfe874bef492522eefe02a466e9785 --- /dev/null +++ b/addons/project_issue_sheet/project_issue_sheet_view.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<openerp> + <data> + <record model="ir.ui.view" id="project_issue_form_view"> + <field name="name">Project Issue Tracker Form</field> + <field name="model">project.issue</field> + <field name="inherit_id" ref="project_issue.project_issue_form_view" /> + <field name="type">form</field> + <field name="arch" type="xml"> + <notebook colspan="4"> + <page string="Worklogs"> + <separator string="Timesheets" colspan="4" /> + <field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : user_id, 'default_account_id' : analytic_account_id}"> + <tree editable="top" string="Timesheet"> + <field name="create_date" string="Date" /> + <field name="user_id" readonly="1" /> + <field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)"/> + <field name="name"/> + <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/> + + <field invisible="1" name="journal_id"/> + <field invisible="1" name="product_id"/> + <field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/> + <field invisible="1" name="amount"/> + <field invisible="1" name="general_account_id"/> + </tree> + </field> + </page> + </notebook> + </field> + </record> + </data> +</openerp> diff --git a/addons/project_mrp/process/project_mrp_process.xml b/addons/project_mrp/process/project_mrp_process.xml old mode 100755 new mode 100644 diff --git a/addons/purchase/partner_view.xml b/addons/purchase/partner_view.xml index 1e88cf50e12addeeb172813e1e1a2aaee4bed787..58594493643b6c5a420a9a28f17235d10cc0fbd0 100644 --- a/addons/purchase/partner_view.xml +++ b/addons/purchase/partner_view.xml @@ -8,12 +8,12 @@ <field name="inherit_id" ref="base.view_partner_form"/> <field name="priority">36</field> <field name="arch" type="xml"> - <group name="sale_list" position="after" groups="base.group_extended"> - <group colspan="2" col="2" groups="base.group_extended"> + <page string="Sales & Purchases" position="inside"> + <group colspan="4" col="2" groups="base.group_extended"> <separator string="Purchases Properties" colspan="2"/> - <field name="property_product_pricelist_purchase"/> + <field name="property_product_pricelist_purchase" /> </group> - </group> + </page> </field> </record> diff --git a/addons/purchase/process/purchase_process.xml b/addons/purchase/process/purchase_process.xml old mode 100755 new mode 100644 diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index a9713776b4f72c96c2596d12de70c72a804ca04a..cd3e0dfb8fac97a5c9e299fe93167dc15c2dacb7 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -155,7 +155,7 @@ <td> <para style="terp_default_9">[[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]</para> <para style="terp_default_Bold_9">Shipping address :</para> - <para style="P1">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="P1">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="P1">[[ addr.title or '' ]] [[ addr.name ]]</para> <para style="P1">[[ addr.street ]]</para> <para style="P1">[[ addr.street2 or '' ]]</para> @@ -175,7 +175,7 @@ </para> </td> <td> - <para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="terp_default_9">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="terp_default_9">[[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]]</para> <para style="terp_default_9">[[ o.partner_address_id.street ]]</para> <para style="terp_default_9">[[ o.partner_address_id.street2 or '' ]]</para> diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml index c5f083bbf0535becb154740d83f29090e9bfe1c9..961ce8239b45283d7a780f69ac6db01f4f891c67 100644 --- a/addons/purchase/report/request_quotation.rml +++ b/addons/purchase/report/request_quotation.rml @@ -88,7 +88,7 @@ </para> </td> <td> - <para style="terp_default_9">[[ (order.partner_id and order.partner_id.title) or '' ]] [[ order.partner_id.name ]]</para> + <para style="terp_default_9">[[ order.partner_id.name ]] [[ order.partner_id.title or '' ]]</para> <para style="terp_default_9">[[ (order.partner_address_id and order.partner_address_id.title) or '' ]] [[ order.partner_address_id.name ]] </para> <para style="terp_default_9">[[ (order.partner_address_id and order.partner_address_id.street) or '']] [[ order.partner_address_id.street2 ]]</para> <para style="terp_default_9">[[ (order.partner_address_id and order.partner_address_id.zip) or '' ]] [[ (order.partner_address_id and order.partner_address_id.city) or '' ]]</para> diff --git a/addons/purchase/security/purchase_security.xml b/addons/purchase/security/purchase_security.xml index 2685e52d909eead3c246ff5f4e21b07a4817150c..320b5d4609d191efae1ccd0599e1e3536a50f255 100644 --- a/addons/purchase/security/purchase_security.xml +++ b/addons/purchase/security/purchase_security.xml @@ -10,25 +10,17 @@ </record> - <record model="ir.rule.group" id="purchase_order_comp_rule_group"> - <field name="name">Purchase Order multi-company</field> + <record model="ir.rule" id="purchase_order_comp_rule"> + <field name="name">Purchase Order multi-company</field> <field name="model_id" ref="model_purchase_order"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="purchase_order_comp_rule"> - <field name="field_id" search="[('model','=','purchase.order'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="purchase_order_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record model="ir.rule.group" id="purchase_order_line_comp_rule_group"> - <field name="name">Purchase Order Line multi-company</field> + <record model="ir.rule" id="purchase_order_line_comp_rule"> + <field name="name">Purchase Order Line multi-company</field> <field name="model_id" ref="model_purchase_order_line"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="purchase_order_line_comp_rule"> - <field name="field_id" search="[('model','=','purchase.order.line'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="purchase_order_line_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> diff --git a/addons/purchase_requisition/security/purchase_tender.xml b/addons/purchase_requisition/security/purchase_tender.xml index c8318ef01daf67accc7347d8923612c7e4b1bf8d..e56a2e69668afd60d7738236ee9f982b7346ed8a 100644 --- a/addons/purchase_requisition/security/purchase_tender.xml +++ b/addons/purchase_requisition/security/purchase_tender.xml @@ -9,26 +9,17 @@ <field name="name">Purchase Requisition / User</field> </record> - - <record model="ir.rule.group" id="purchase_requisition_comp_rule_group"> - <field name="name">Purchase Requisition multi-company</field> + <record model="ir.rule" id="purchase_requisition_comp_rule"> + <field name="name">Purchase Requisition multi-company</field> <field name="model_id" ref="model_purchase_requisition"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="purchase_requisition_comp_rule"> - <field name="field_id" search="[('model','=','purchase.requisition'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="purchase_requisition_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record model="ir.rule.group" id="purchase_requisition_line_comp_rule_group"> - <field name="name">Purchase requisition Line multi-company</field> + <record model="ir.rule" id="purchase_requisition_line_comp_rule"> + field name="name">Purchase requisition Line multi-company</field> <field name="model_id" ref="model_purchase_requisition_line"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="purchase_requisition_line_comp_rule"> - <field name="field_id" search="[('model','=','purchase.requisition.line'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="purchase_requisition_line_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> diff --git a/addons/report_intrastat/report/invoice.rml b/addons/report_intrastat/report/invoice.rml index 89b6448072e154ec56dbdff439205360c3f6a233..4c3bfd5d2c439af6a03c9e4e56d92725a54c6a03 100644 --- a/addons/report_intrastat/report/invoice.rml +++ b/addons/report_intrastat/report/invoice.rml @@ -245,7 +245,7 @@ </para> </td> <td> - <para style="terp_default_8">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="terp_default_8">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="terp_default_8">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para> <para style="terp_default_8">[[ o.address_invoice_id.street ]]</para> <para style="terp_default_8">[[ o.address_invoice_id.street2 or '' ]]</para> diff --git a/addons/report_purchase/i18n/pl.po b/addons/report_purchase/i18n/pl.po index 25e17d830dec7b31b33cd1d2a514d7f32523f060..8ddcba983bd351d2f3fcefbc50ac1cb44035c73c 100644 --- a/addons/report_purchase/i18n/pl.po +++ b/addons/report_purchase/i18n/pl.po @@ -7,20 +7,20 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-11-17 10:25+0000\n" -"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n" +"PO-Revision-Date: 2010-05-05 06:46+0000\n" +"Last-Translator: Wojtek Kubiak <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:54+0000\n" +"X-Launchpad-Export-Date: 2010-05-06 04:03+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: report_purchase #: field:report.purchase.order.category,price_average:0 #: field:report.purchase.order.product,price_average:0 msgid "Average Price" -msgstr "Cena przeciÄ™tna" +msgstr "Åšrednia cena" #. module: report_purchase #: field:report.purchase.order.category,state:0 @@ -49,7 +49,7 @@ msgstr "Zakupy wg produktów" #. module: report_purchase #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "" +msgstr "NieprawidÅ‚owa nazwa modelu w definicji akcji." #. module: report_purchase #: model:ir.ui.menu,name:report_purchase.next_id_75 diff --git a/addons/resource/__init__.py b/addons/resource/__init__.py old mode 100755 new mode 100644 diff --git a/addons/resource/__openerp__.py b/addons/resource/__openerp__.py old mode 100755 new mode 100644 diff --git a/addons/resource/faces/task.py b/addons/resource/faces/task.py old mode 100755 new mode 100644 diff --git a/addons/resource/resource.py b/addons/resource/resource.py old mode 100755 new mode 100644 diff --git a/addons/resource/resource_view.xml b/addons/resource/resource_view.xml old mode 100755 new mode 100644 diff --git a/addons/sale/process/sale_process.xml b/addons/sale/process/sale_process.xml old mode 100755 new mode 100644 diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml index fa03eb1624bf459898ab817fe5f911dae76db8f3..1c205b6c2567fa2d57ec564a025c6176d8869844 100644 --- a/addons/sale/report/order.rml +++ b/addons/sale/report/order.rml @@ -134,7 +134,7 @@ <tr> <td> <para style="terp_default_Bold_9">Shipping address :</para> - <para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="terp_default_9">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="terp_default_9">[[ o.partner_shipping_id.title or '' ]] [[ o.partner_shipping_id.name ]]</para> <para style="terp_default_9">[[ o.partner_shipping_id.street ]]</para> <para style="terp_default_9">[[ o.partner_shipping_id.street2 or '' ]]</para> @@ -155,7 +155,7 @@ </para> </td> <td> - <para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para> + <para style="terp_default_9">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para> <para style="terp_default_9">[[ o.partner_order_id.title or '' ]] [[ o.partner_order_id.name ]]</para> <para style="terp_default_9">[[ o.partner_order_id.street ]]</para> <para style="terp_default_9">[[ o.partner_order_id.street2 or '' ]]</para> diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml index 590a849ab9a7f209687b84e8a8a1dd92d4ed89f5..fd8b3e0d3c70858d9ed80eb6d061363523324287 100644 --- a/addons/sale/security/sale_security.xml +++ b/addons/sale/security/sale_security.xml @@ -13,25 +13,17 @@ <field name="groups_id" eval="[(6,0,[ref('group_sale_manager')])]"/> </record> - <record model="ir.rule.group" id="sale_order_comp_rule_group"> - <field name="name">Sale Order multi-company</field> + <record model="ir.rule" id="sale_order_comp_rule"> + <field name="name">Sale Order multi-company</field> <field name="model_id" ref="model_sale_order"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="sale_order_comp_rule"> - <field name="field_id" search="[('model','=','sale.order'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="sale_order_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record model="ir.rule.group" id="sale_order_line_comp_rule_group"> - <field name="name">Sale Order Line multi-company</field> + <record model="ir.rule" id="sale_order_line_comp_rule"> + <field name="name">Sale Order Line multi-company</field> <field name="model_id" ref="model_sale_order_line"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="sale_order_line_comp_rule"> - <field name="field_id" search="[('model','=','sale.order.line'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="sale_order_line_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> diff --git a/addons/sale_crm/process/sale_crm_process.xml b/addons/sale_crm/process/sale_crm_process.xml old mode 100755 new mode 100644 diff --git a/addons/scrum/__openerp__.py b/addons/scrum/__openerp__.py index 33a114a3040b648f91848f5529819cb783979e48..19facdbaed38210f4b057676f328321b1108b51c 100644 --- a/addons/scrum/__openerp__.py +++ b/addons/scrum/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -52,9 +52,10 @@ 'update_xml': [ 'security/ir.model.access.csv', 'scrum_report.xml', - 'scrum_wizard.xml', + 'wizard/scrum_backlog_create_task_view.xml', 'scrum_view.xml', - 'process/scrum_process.xml' + 'process/scrum_process.xml', + 'wizard/scrum_backlog_sprint_view.xml', ], 'demo_xml': ['scrum_demo.xml'], 'installable': True, diff --git a/addons/scrum/process/scrum_process.xml b/addons/scrum/process/scrum_process.xml old mode 100755 new mode 100644 diff --git a/addons/scrum/scrum_view.xml b/addons/scrum/scrum_view.xml index 39f8bfc75db326951d73d9602dafd162c43b3ce8..9ea4c8592a93fd18e18ca7a3c61100ca759a90d3 100644 --- a/addons/scrum/scrum_view.xml +++ b/addons/scrum/scrum_view.xml @@ -45,7 +45,7 @@ <field name="expected_hours" sum="Expected hours" widget="float_time"/> <field name="state"/> <button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/> - <button type="action" string="Convert to Task" name="%(wizard_scrum_backlog_task)d" states="pending" icon="gtk-execute"/> + <button type="action" string="Convert to Task" name="%(action_scrum_backlog_to_task)d" states="pending" icon="gtk-execute"/> <button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/> <button type="object" string="Close" name="button_close" states="open,pending" icon="gtk-jump-to"/> <button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/> @@ -86,7 +86,7 @@ <group col="8" colspan="4"> <field name="state" select="1" readonly="1"/> <button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/> - <button type="action" string="Convert to Task" name="%(wizard_scrum_backlog_task)d" states="pending" icon="gtk-execute"/> + <button type="action" string="Convert to Task" name="%(action_scrum_backlog_to_task)d" states="pending" icon="gtk-execute"/> <button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/> <button type="object" string="Close" name="button_close" states="open,pending" icon="gtk-jump-to"/> <button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/> diff --git a/addons/scrum/scrum_wizard.xml b/addons/scrum/scrum_wizard.xml deleted file mode 100644 index 171d30ba37f0be22204c5534eadfa9561369bba5..0000000000000000000000000000000000000000 --- a/addons/scrum/scrum_wizard.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<openerp> - <data> - <wizard id="wizard_scrum_backlog_task" model="scrum.product.backlog" name="scrum.product.backlog.task.create" string="Create Tasks"/> - <wizard id="wizard_scrum_backlog_sprint" model="scrum.product.backlog" name="scrum.product.backlog.sprint.assign" string="Assign Sprint"/> - </data> -</openerp> diff --git a/addons/scrum/wizard/__init__.py b/addons/scrum/wizard/__init__.py index 117e64dcea7e91e6cece6463e2dadd44044e8783..6e0d739f88906c5fcf7f27181cb815288821c1c0 100644 --- a/addons/scrum/wizard/__init__.py +++ b/addons/scrum/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,12 +15,12 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## -import backlog_to_task -import assign_backlog_to_sprint +import scrum_backlog_create_task +import scrum_backlog_sprint # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/scrum/wizard/assign_backlog_to_sprint.py b/addons/scrum/wizard/assign_backlog_to_sprint.py deleted file mode 100644 index fe36344976c4c42a73bd6123b55976509778ff26..0000000000000000000000000000000000000000 --- a/addons/scrum/wizard/assign_backlog_to_sprint.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import ir -from mx.DateTime import now -import pooler -import netsvc - -bts_form = """<?xml version="1.0" ?> -<form string="Assign Sprint"> - <group> - <field name="sprint_id" colspan="2"/> - </group> - <newline/> - <separator colspan="2"/> - <newline/> - <group> - <field name="state_open" colspan="1"/> - <field name="convert_to_task" colspan="1"/> - </group> -</form>""" - -bts_fields = { - 'sprint_id' : {'string':'Sprint Name', 'type':'many2one', 'relation':'scrum.sprint', 'required':True}, - 'state_open' : {'string':'Set Open', 'type':'boolean', 'default': lambda *a: True}, - 'convert_to_task' : {'string':'Convert To Task', 'type':'boolean', 'default': lambda *a: True} -} - -def _assign_sprint(self, cr, uid, data, context): - pool = pooler.get_pool(cr.dbname) - backlog_obj = pool.get('scrum.product.backlog') - task = pool.get('project.task') - state_open = data['form']['state_open'] - convert_to_task = data['form']['convert_to_task'] - for backlog in backlog_obj.browse(cr, uid, data['ids'], context=context): - backlog_obj.write(cr, uid, backlog.id, {'sprint_id':data['form']['sprint_id']}, context=context) - if convert_to_task: - task.create(cr, uid, { - 'product_backlog_id': backlog.id, - 'name': backlog.name, - 'description': backlog.note, - 'project_id': backlog.project_id.id, - 'user_id': False, - 'planned_hours':backlog.planned_hours, - 'remaining_hours':backlog.expected_hours, - }) - if state_open: - if backlog.state == "draft": - backlog_obj.write(cr, uid, backlog.id, {'state':'open'}) - return {} - -class wiz_bts(wizard.interface): - states = { - 'init':{ - 'actions': [], - 'result': {'type':'form', 'arch':bts_form, 'fields':bts_fields, 'state':[('end', 'Cancel'), ('assign', 'Assign Sprint')] }, - }, - 'assign':{ - 'actions': [], - 'result': {'type':'action', 'action': _assign_sprint, 'state':'end'}, - }, - } -wiz_bts('scrum.product.backlog.sprint.assign') - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/scrum/wizard/backlog_to_task.py b/addons/scrum/wizard/backlog_to_task.py deleted file mode 100644 index 2602b108fdabd7d73a3390630458c2d00d7f3b1f..0000000000000000000000000000000000000000 --- a/addons/scrum/wizard/backlog_to_task.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -############################################################################## - -import wizard -import ir -from mx.DateTime import now -import pooler -import netsvc - -btt_form = """<?xml version="1.0" ?> -<form string="Create Tasks"> - <field name="user_id"/> -</form>""" - -btt_fields = { - 'user_id' : {'string':'Assign To', 'type':'many2one', 'relation':'res.users'}, -} - -def _do_create(self, cr, uid, data, context={}): - pool = pooler.get_pool(cr.dbname) - backlogs = pool.get('scrum.product.backlog').browse(cr, uid, data['ids'], context=context) - mod_obj = pool.get('ir.model.data') - result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form') - id = mod_obj.read(cr, uid, result, ['res_id']) - ids = [] - for backlog in backlogs: - task = pooler.get_pool(cr.dbname).get('project.task') - ids.append(task.create(cr, uid, { - 'product_backlog_id': backlog.id, - 'name': backlog.name, - 'description': backlog.note, - 'project_id': backlog.project_id.id, - 'user_id': data['form']['user_id'] or False, - 'planned_hours': backlog.planned_hours, - 'remaining_hours':backlog.expected_hours, - 'sequence':backlog.sequence, - })) - value = { - 'domain': "[('product_backlog_id','in',["+','.join(map(str,data['ids']))+"])]", - 'name': 'Open Backlog Tasks', - 'res_id': ids, - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'project.task', - 'view_id': False, - 'type': 'ir.actions.act_window', - 'search_view_id': id['res_id'], - } - return value - -class wiz_btt(wizard.interface): - states = { - 'init':{ - 'actions': [], - 'result': {'type':'form', 'arch':btt_form, 'fields':btt_fields, 'state':[('end', 'Cancel'), ('create', 'Create Tasks')] }, - }, - 'create':{ - 'actions': [], - 'result': {'type':'action', 'action': _do_create, 'state':'end'}, - }, - } -wiz_btt('scrum.product.backlog.task.create') - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/scrum/wizard/scrum_backlog_create_task.py b/addons/scrum/wizard/scrum_backlog_create_task.py new file mode 100644 index 0000000000000000000000000000000000000000..71493a1c1a2c67e874a4eb74140b90d27398e52a --- /dev/null +++ b/addons/scrum/wizard/scrum_backlog_create_task.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +from osv import osv, fields + +class backlog_create_task(osv.osv_memory): + _name = 'backlog.create.task' + _description = 'Create Tasks from Product Backlogs' + _columns = { + 'user_id': fields.many2one('res.users', 'Assign To') + } + + def do_create(self, cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.model.data') + task = self.pool.get('project.task') + backlog_id = self.pool.get('scrum.product.backlog') + ids_task = [] + + if context is None: + context = {} + data = self.read(cr, uid, ids, [], context=context)[0] + backlogs = backlog_id.browse(cr, uid, context['active_ids'], context=context) + result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form') + id = mod_obj.read(cr, uid, result, ['res_id']) + + for backlog in backlogs: + ids_task.append(task.create(cr, uid, { + 'product_backlog_id': backlog.id, + 'name': backlog.name, + 'description': backlog.note, + 'project_id': backlog.project_id.id, + 'user_id': data['user_id'] or False, + 'planned_hours': backlog.planned_hours, + 'remaining_hours':backlog.expected_hours, + 'sequence':backlog.sequence, + })) + + return { + 'domain': "[('product_backlog_id','in',["+','.join(map(str, context['active_ids']))+"])]", + 'name': 'Open Backlog Tasks', + 'res_id': ids_task, + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'project.task', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'search_view_id': id['res_id'], + } + +backlog_create_task() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/scrum/wizard/scrum_backlog_create_task_view.xml b/addons/scrum/wizard/scrum_backlog_create_task_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..25cc78b873fd777220af426f5bf1bd8d7af1b57d --- /dev/null +++ b/addons/scrum/wizard/scrum_backlog_create_task_view.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="view_scrum_backlog_to_task" model="ir.ui.view"> + <field name="name">backlog.create.task.form</field> + <field name="model">backlog.create.task</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Create Tasks"> + <group col="4" colspan="6"> + <field name="user_id"/> + </group> + <separator colspan="4"/> + <group col="2" colspan="4"> + <button special="cancel" string="Cancel" icon='gtk-cancel'/> + <button name="do_create" string="Create Tasks" colspan="1" type="object" icon="gtk-execute"/> + </group> + </form> + </field> + </record> + + <record id="action_scrum_backlog_to_task" model="ir.actions.act_window"> + <field name="name">Create Tasks</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">backlog.create.task</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <record model="ir.values" id="scrum_backlog_to_task_values"> + <field name="model_id" ref="model_scrum_product_backlog" /> + <field name="object" eval="1" /> + <field name="name">Create Tasks</field> + <field name="key2">client_action_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_scrum_backlog_to_task'))" /> + <field name="key">action</field> + <field name="model">scrum.product.backlog</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/scrum/wizard/scrum_backlog_sprint.py b/addons/scrum/wizard/scrum_backlog_sprint.py new file mode 100644 index 0000000000000000000000000000000000000000..8125df1ba53bafd0e9399cb79c365594e787ae89 --- /dev/null +++ b/addons/scrum/wizard/scrum_backlog_sprint.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## +from osv import osv, fields + +class backlog_sprint_assign(osv.osv_memory): + _name = 'backlog.assign.sprint' + _description = 'Assign sprint to backlogs' + _columns = { + 'sprint_id': fields.many2one('scrum.sprint', 'Sprint Name', required=True), + 'state_open': fields.boolean('Set Open', help="Change the state of product backlogs to open if its in draft state"), + 'convert_to_task': fields.boolean('Convert To Task', help="Create Task for Product Backlog") + } + _defaults = { + 'state_open': True, + 'convert_to_task': True, + } + + def assign_sprint(self, cr, uid, ids, context=None): + backlog_obj = self.pool.get('scrum.product.backlog') + task = self.pool.get('project.task') + backlog_ids = [] + if context is None: + context = {} + data = self.read(cr, uid, ids, [], context=context)[0] + for backlog in backlog_obj.browse(cr, uid, context['active_ids'], context=context): + backlog_ids.append(backlog.id) + if data['convert_to_task']: + task.create(cr, uid, { + 'product_backlog_id': backlog.id, + 'name': backlog.name, + 'description': backlog.note, + 'project_id': backlog.project_id.id, + 'user_id': False, + 'planned_hours':backlog.planned_hours, + 'remaining_hours':backlog.expected_hours, + }) + if data['state_open'] and backlog.state == "draft": + backlog_obj.write(cr, uid, backlog.id, {'state':'open'}) + backlog_obj.write(cr, uid, backlog_ids, {'sprint_id': data['sprint_id']}, context=context) + return {} + +backlog_sprint_assign() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/scrum/wizard/scrum_backlog_sprint_view.xml b/addons/scrum/wizard/scrum_backlog_sprint_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..20fedbb6978bd6e2237e5b70a25710360f115fd2 --- /dev/null +++ b/addons/scrum/wizard/scrum_backlog_sprint_view.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <record id="view_scrum_backlog_to_sprint" model="ir.ui.view"> + <field name="name">backlog.assign.sprint.form</field> + <field name="model">backlog.assign.sprint</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Assign Sprint"> + <group col="4" colspan="6"> + <field name="sprint_id" colspan="2"/> + </group> + <newline/> + <separator colspan="2"/> + <newline/> + <group> + <field name="state_open" colspan="1"/> + <field name="convert_to_task" colspan="1"/> </group> + <separator colspan="4"/> + <group col="2" colspan="4"> + <button special="cancel" string="Cancel" icon='gtk-cancel'/> + <button name="assign_sprint" string="Assign Sprint" colspan="1" type="object" icon="gtk-execute"/> + </group> + </form> + </field> + </record> + + <record id="action_scrum_backlog_to_sprint" model="ir.actions.act_window"> + <field name="name">Assign Sprint</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">backlog.assign.sprint</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <record model="ir.values" id="scrum_backlog_to_sprint_values"> + <field name="model_id" ref="model_scrum_product_backlog" /> + <field name="object" eval="1" /> + <field name="name">Assign Sprint</field> + <field name="key2">client_action_multi</field> + <field name="value" eval="'ir.actions.act_window,' + str(ref('action_scrum_backlog_to_sprint'))" /> + <field name="key">action</field> + <field name="model">scrum.product.backlog</field> + </record> + + </data> +</openerp> \ No newline at end of file diff --git a/addons/smtpclient/i18n/ca.po b/addons/smtpclient/i18n/ca.po index 5bbd228f8ba41e9ffa516184a91a18a1ebe60112..5caaa7b3da449557c1628a8804e616fbaf07307c 100644 --- a/addons/smtpclient/i18n/ca.po +++ b/addons/smtpclient/i18n/ca.po @@ -1,20 +1,20 @@ -# Translation of OpenERP Server. -# This file containt the translation of the following modules: -# * smtpclient +# Catalan translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 5.0.0-rc1\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2009-11-26 06:00+0000\n" -"PO-Revision-Date: 2010-01-19 05:22+0000\n" -"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " -"<jesteve@zikzakmedia.com>\n" -"Language-Team: \n" +"PO-Revision-Date: 2010-04-28 15:19+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Catalan <ca@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-25 05:00+0000\n" +"X-Launchpad-Export-Date: 2010-04-29 03:52+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: smtpclient @@ -854,15 +854,3 @@ msgstr "res.company.address" #: field:email.smtpclient.queue,state:0 msgid "Message Status" msgstr "" - -#~ msgid "The Email is sent successfully to corresponding address" -#~ msgstr "El correu ha estat enviat correctament a la direcció corresponent" - -#~ msgid "Servers" -#~ msgstr "Servidors" - -#~ msgid "Verification Information" -#~ msgstr "Informació de verificació" - -#~ msgid "Report name and Resources ids are required!" -#~ msgstr "Nom d'informe i ids de registres són necessaris!" diff --git a/addons/smtpclient/i18n/es.po b/addons/smtpclient/i18n/es.po index d3bee99f6f5cc727d8e4917782811c4ac143e2f0..bee10094fe66da572e4682fd3cccc35f1135b591 100644 --- a/addons/smtpclient/i18n/es.po +++ b/addons/smtpclient/i18n/es.po @@ -1,20 +1,20 @@ -# Translation of OpenERP Server. -# This file containt the translation of the following modules: -# * smtpclient +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 5.0.0-rc1\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2009-11-26 06:00+0000\n" -"PO-Revision-Date: 2010-01-19 05:21+0000\n" -"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " -"<jesteve@zikzakmedia.com>\n" -"Language-Team: \n" +"PO-Revision-Date: 2010-04-28 15:19+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Spanish <es@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-25 05:00+0000\n" +"X-Launchpad-Export-Date: 2010-04-29 03:52+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: smtpclient @@ -855,16 +855,3 @@ msgstr "res.company.address" #: field:email.smtpclient.queue,state:0 msgid "Message Status" msgstr "" - -#~ msgid "The Email is sent successfully to corresponding address" -#~ msgstr "" -#~ "El correo ha sido enviado correctamente a la dirección correspondiente" - -#~ msgid "Servers" -#~ msgstr "Servidores" - -#~ msgid "Verification Information" -#~ msgstr "Información de verificación" - -#~ msgid "Report name and Resources ids are required!" -#~ msgstr "¡Nombre de informe y ids de registros son necesarios!" diff --git a/addons/smtpclient/i18n/fr.po b/addons/smtpclient/i18n/fr.po index 59083df5805040423e3a0488ae9f1c5d4b07d911..ef3aa9624d60463e8f19ad1fefc07bafed685916 100644 --- a/addons/smtpclient/i18n/fr.po +++ b/addons/smtpclient/i18n/fr.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2009-11-26 06:00+0000\n" -"PO-Revision-Date: 2010-04-07 13:57+0000\n" +"PO-Revision-Date: 2010-04-28 15:19+0000\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: French <fr@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-13 03:42+0000\n" +"X-Launchpad-Export-Date: 2010-04-29 03:52+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: smtpclient diff --git a/addons/smtpclient/smtpclient.py b/addons/smtpclient/smtpclient.py index eff5e240dff8ecd21b0187d236035bbe38c50569..6b0a2393cd1f1c90669dc9b600b823f5bed3abd2 100644 --- a/addons/smtpclient/smtpclient.py +++ b/addons/smtpclient/smtpclient.py @@ -68,7 +68,9 @@ class smtpclient(osv.osv): _columns = { 'name' : fields.char('Server Name', size=256, required=True), 'from_email' : fields.char('Email From', size=256), - 'email' : fields.char('Email Address', size=256, required=True, readonly=True, states={'new':[('readonly',False)]}), + 'email':fields.char('Email Address', size=256, required=True, readonly=True, states={'new':[('readonly',False)]}), + 'cc_to':fields.char('Send copy to', size=256, readonly=True, states={'new':[('readonly',False)]}, help="use comma to supply multiple address. email@domain.com, email2@domain.com"), + 'bcc_to':fields.char('Send blind copy to', size=256, readonly=True, states={'new':[('readonly',False)]}, help="use comma to supply multiple address. email@domain.com, email2@domain.com"), 'user' : fields.char('User Name', size=256, readonly=True, states={'new':[('readonly',False)]}), 'password' : fields.char('Password', size=1024, invisible=True, readonly=True, states={'new':[('readonly',False)]}), 'server' : fields.char('SMTP Server', size=256, required=True, readonly=True, states={'new':[('readonly',False)]}), @@ -300,7 +302,10 @@ class smtpclient(osv.osv): if self.server[serverid]['auth']: password = self.server[serverid]['password'] - password = base64.b64decode(password) + try: + password = base64.b64decode(password) + except: + pass self.smtpServer[serverid].login(str(self.server[serverid]['user']), password) except Exception, e: @@ -386,7 +391,7 @@ class smtpclient(osv.osv): emailto = [emailto] ir_pool = self.pool.get('ir.attachment') - + for to in emailto: msg = MIMEMultipart() msg['Subject'] = tools.ustr(subject) @@ -420,7 +425,13 @@ class smtpclient(osv.osv): msg['X-OpenERP-Server-Host'] = socket.gethostname() msg['X-OpenERP-Server-Version'] = release.version msg['Message-Id'] = "<%s-openerp-@%s>" % (time.time(), socket.gethostname()) - + + if smtp_server.cc_to: + msg['Cc'] = smtp_server.cc_to + + if smtp_server.bcc_to: + msg['Bcc'] = smtp_server.bcc_to + #attach files from disc for file in attachments: part = MIMEBase('application', "octet-stream") @@ -442,8 +453,8 @@ class smtpclient(osv.osv): data = { 'to':to, 'server_id':server_id, - 'cc':False, - 'bcc':False, + 'cc':smtp_server.cc_to or False, + 'bcc':smtp_server.bcc_to or False, 'name':subject, 'body':body, 'serialized_message':message, @@ -499,7 +510,7 @@ class smtpclient(osv.osv): self.open_connection(cr, uid, ids, email.server_id.id) try: - self.smtpServer[email.server_id.id].sendmail(email.server_id.email, email.to, tools.ustr(email.serialized_message)) + self.smtpServer[email.server_id.id].sendmail(email.server_id.email, [email.to, email.cc, email.bcc], tools.ustr(email.serialized_message)) message = "message sent successfully to %s from %s server" % (email.to, email.server_id.name) logger.notifyChannel('smtp', netsvc.LOG_INFO, message) except Exception, e: @@ -531,7 +542,7 @@ class smtpclient(osv.osv): sids = queue.search(cr, uid, [('state','not in',['send','sending']), ('server_id','in',ids)], order="priority", limit=30) message = "" - if len(ids) > 0: + if len(ids) > 1: message = "sending %s emails from message queuq !" % (len(ids)) logger.notifyChannel('smtp', netsvc.LOG_INFO, message) @@ -539,6 +550,7 @@ class smtpclient(osv.osv): return result def set_to_draft(self, cr, uid, ids, context={}): + self.stop_process(cr, uid, ids, context) self.write(cr, uid, ids, {'state':'new', 'code':False}) return True @@ -555,17 +567,19 @@ class smtpclient(osv.osv): 'interval_type':'minutes', 'user_id':uid, 'numbercall':-1, - 'doall':False + 'doall':False, + 'active':False } id = self.pool.get('ir.cron').create(cr, uid, res) self.write(cr, uid, ids, {'process_id':id}) + return True def start_process(self, cr, uid, ids, context={}): process = self.browse(cr, uid, ids[0], context) - if not process.process_id: + if not process.process_id or process.state != 'confirm': raise osv.except_osv(_('SMTP Server Error !'), _('Server is not Verified, Please Verify the Server !')) - + pid = process.process_id.id self.pool.get('ir.cron').write(cr, uid, [pid], {'active':True}) self.write(cr, uid, ids, {'pstate':'running'}) diff --git a/addons/smtpclient/smtpclient_view.xml b/addons/smtpclient/smtpclient_view.xml index 1704afc23dc3120b362ce36c18e4251a0d557720..503ad6fafa474caf8cda8ba898c0ec088871fd88 100644 --- a/addons/smtpclient/smtpclient_view.xml +++ b/addons/smtpclient/smtpclient_view.xml @@ -77,6 +77,12 @@ <field name="delete_queue" select="2" /> <field name="delete_queue_period" select="2" attrs="{'readonly':[('delete_queue','not in',['content','all'])]}"/> </group> + <group col="2" colspan="2"> + <separator string="Email Copy Configuration" colspan="2" /> + <field name="cc_to" select="2" /> + <field name="bcc_to" select="2" /> + </group> + <newline/> <separator string="Server Information" colspan="4"/> <group col="3" colspan="4"> diff --git a/addons/smtpclient/wizard/verifycode.py b/addons/smtpclient/wizard/verifycode.py index 096523c6b6974ec4c0e2f02ac008d12af8ec1433..85ca03b1b10750be71904f75cf08feb0d6ff8f14 100644 --- a/addons/smtpclient/wizard/verifycode.py +++ b/addons/smtpclient/wizard/verifycode.py @@ -48,7 +48,7 @@ class verifycode(wizard.interface): if code == data['form']['code']: if server_pool.create_process(cr, uid, [data['id']], context={}): server_pool.write(cr, uid, [data['id']], {'state':'confirm', 'pstate':'running'}) - print 'process created' + server_pool.start_process(cr, uid, [data['id']], context) else: raise osv.except_osv(_('Error'), _('Verification failed. Invalid Verification Code!')) diff --git a/addons/stock/i18n/es.po b/addons/stock/i18n/es.po index 2fcb9a24dfd38efcfd9bd3c4dae3fc83e722026d..3673eeebe690b838dd41aafb418621049de6c51e 100644 --- a/addons/stock/i18n/es.po +++ b/addons/stock/i18n/es.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-02-22 23:58+0000\n" -"Last-Translator: Rodrigo Testa <rod-95@live.com>\n" +"PO-Revision-Date: 2010-04-29 11:22+0000\n" +"Last-Translator: Shay <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:56+0000\n" +"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: stock @@ -1411,6 +1411,20 @@ msgid "" "* Traceability (upstream/downstream, production lots, serial number, ...)\n" " " msgstr "" +"El modulo de OpenERP que gestiona el inventario puede administrar más " +"almacenes y estructuras de almacenamiento múltiples y complejas.\n" +"Gracias a la gestión de doble acceso, el control sobre el inventario es " +"potente y flexible:\n" +"* Historial y planificación de los movimientos\n" +"* Diversos métodos de hacer inventario (FIFO, LIFO,...)\n" +"* Estima del almacenamiento ( precio estándar o medio, ...)\n" +"* Robustez frente a divergencias del inventario\n" +"* Normas de reordenación automática (niveles del almacen, JIT, ...)\n" +"* Soporte de códigos de barras\n" +"* Revelación rápida de los errores gracias al sistema de acceso doble\n" +"* Localización (upstream/downstream, lotes de producción, números de serie, " +"...)\n" +" " #. module: stock #: selection:stock.location,chained_location_type:0 diff --git a/addons/stock/i18n/zh_CN.po b/addons/stock/i18n/zh_CN.po index 7829e5d48760d6c4e524a1237d21f8a0fb3d23e4..ad942d8a06160a8f6dd1a11165e9203c9e621788 100644 --- a/addons/stock/i18n/zh_CN.po +++ b/addons/stock/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.6\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-03-29 01:06+0000\n" +"PO-Revision-Date: 2010-05-06 03:59+0000\n" "Last-Translator: digitalsatori <Unknown>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 03:56+0000\n" +"X-Launchpad-Export-Date: 2010-05-06 04:03+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: stock @@ -141,7 +141,7 @@ msgstr "业务伙伴" #. module: stock #: help:product.product,track_incoming:0 msgid "Force to use a Production Lot during receptions" -msgstr "接收强制的生产批次" +msgstr "在接收时强制使用生产批å·" #. module: stock #: field:stock.move,move_history_ids:0 @@ -184,7 +184,7 @@ msgstr "状æ€" #. module: stock #: field:stock.location,stock_real_value:0 msgid "Real Stock Value" -msgstr "实时库å˜å€¼" +msgstr "实际库å˜é¢" #. module: stock #: view:stock.move:0 @@ -201,7 +201,7 @@ msgstr "å¯ç”¨" #. module: stock #: view:stock.move:0 msgid "Make Parcel" -msgstr "打å°åŒ…" +msgstr "装箱" #. module: stock #: wizard_view:stock.partial_picking,end2:0 @@ -211,27 +211,27 @@ msgstr "包装结果" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_QUIT" -msgstr "退出" +msgstr "STOCK_QUIT" #. module: stock #: field:stock.warehouse,lot_output_id:0 msgid "Location Output" -msgstr "库ä½å‡º" +msgstr "输出库å˜ä½" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_GOTO_TOP" -msgstr "顶" +msgstr "STOCK_GOTO_TOP" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_ABOUT" -msgstr "关于" +msgstr "STOCK_ABOUT" #. module: stock #: selection:stock.location,icon:0 msgid "terp-hr" -msgstr "人力资æº" +msgstr "terp-hr" #. module: stock #: field:stock.location,usage:0 @@ -241,7 +241,7 @@ msgstr "库ä½ç±»åž‹" #. module: stock #: selection:stock.location,icon:0 msgid "terp-purchase" -msgstr "采è´" +msgstr "terp-purchase" #. module: stock #: selection:stock.location,icon:0 @@ -256,12 +256,12 @@ msgstr "[" #. module: stock #: view:stock.picking:0 msgid "Products Sent" -msgstr "产å“å‘出" +msgstr "å·²å‘出产å“" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_GOTO_FIRST" -msgstr "开始" +msgstr "STOCK_GOTO_FIRST" #. module: stock #: model:ir.actions.act_window,name:stock.action_picking_tree6 @@ -272,7 +272,7 @@ msgstr "内部调拨" #. module: stock #: field:stock.move,product_packaging:0 msgid "Packaging" -msgstr "包装" +msgstr "装箱" #. module: stock #: rml:stock.picking.list:0 @@ -300,12 +300,12 @@ msgstr "客户退货" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_FLOPPY" -msgstr "软驱" +msgstr "STOCK_FLOPPY" #. module: stock #: view:stock.production.lot.revision:0 msgid "Production Lot Revisions" -msgstr "生产批次修改" +msgstr "" #. module: stock #: view:stock.location:0 @@ -321,7 +321,7 @@ msgstr "库ä½å称" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_UNINDENT" -msgstr "ä¸ç¼©è¿›" +msgstr "STOCK_UNINDENT" #. module: stock #: view:stock.move:0 @@ -349,12 +349,12 @@ msgstr "客户" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_UNDERLINE" -msgstr "下划线" +msgstr "STOCK_UNDERLINE" #. module: stock #: view:stock.picking.move.wizard:0 msgid "Move Lines" -msgstr "调拨线路" +msgstr "å‡è¯æ˜Žç»†" #. module: stock #: wizard_field:stock.fill_inventory,init,recursive:0 @@ -385,22 +385,22 @@ msgstr "跟踪明细" #. module: stock #: field:stock.location,child_ids:0 msgid "Contains" -msgstr "å«" +msgstr "包å«" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_BOLD" -msgstr "粗体" +msgstr "STOCK_BOLD" #. module: stock #: selection:stock.location,icon:0 msgid "terp-graph" -msgstr "图åƒ" +msgstr "terp-graph" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_PREFERENCES" -msgstr "å爱" +msgstr "STOCK_PREFERENCES" #. module: stock #: rml:lot.location:0 @@ -434,12 +434,12 @@ msgstr "库å˜å±‚1" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_MEDIA_REWIND" -msgstr "倒回" +msgstr "STOCK_MEDIA_REWIND" #. module: stock #: field:stock.warehouse,lot_input_id:0 msgid "Location Input" -msgstr "库ä½è¿›" +msgstr "输入库ä½" #. module: stock #: view:res.partner:0 @@ -475,7 +475,7 @@ msgstr "产å“ID" #. module: stock #: view:res.partner:0 msgid "Sales & Purchases" -msgstr "销售&采è´" +msgstr "销售与采è´" #. module: stock #: selection:stock.invoice_onshipping,init,type:0 @@ -490,12 +490,12 @@ msgstr "盘å˜åº“ä½" #. module: stock #: help:product.product,track_production:0 msgid "Force to use a Production Lot during production order" -msgstr "生产å•å¼ºåˆ¶çš„生产批次" +msgstr "在录入生产å•æ—¶å¼ºåˆ¶ä½¿ç”¨ç”Ÿäº§æ‰¹å·" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_CUT" -msgstr "剪贴" +msgstr "STOCK_CUT" #. module: stock #: help:product.template,property_stock_inventory:0 @@ -513,7 +513,7 @@ msgstr "用于记录出库价值科目" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_ZOOM_FIT" -msgstr "放大到适åˆ" +msgstr "STOCK_ZOOM_FIT" #. module: stock #: help:product.category,property_stock_journal:0 @@ -540,7 +540,7 @@ msgstr "库å˜åº“ä½" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_SAVE_AS" -msgstr "å¦å˜åˆ°" +msgstr "STOCK_SAVE_AS" #. module: stock #: model:ir.model,name:stock.model_stock_report_prodlots @@ -550,7 +550,7 @@ msgstr "库å˜ç”Ÿäº§æ‰¹æ¬¡æŠ¥è¡¨" #. module: stock #: field:stock.location,stock_virtual:0 msgid "Virtual Stock" -msgstr "虚拟库å˜" +msgstr "è´¦é¢åº“å˜" #. module: stock #: selection:stock.location,usage:0 @@ -560,7 +560,7 @@ msgstr "视图" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_DIALOG_ERROR" -msgstr "错误" +msgstr "STOCK_DIALOG_ERROR" #. module: stock #: field:stock.location,parent_left:0 @@ -575,12 +575,12 @@ msgstr "最近盘å˜æ—¥æœŸ" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_INDEX" -msgstr "索引" +msgstr "STOCK_INDEX" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_GOTO_BOTTOM" -msgstr "底" +msgstr "STOCK_GOTO_BOTTOM" #. module: stock #: model:ir.actions.act_window,name:stock.action_picking_form @@ -614,27 +614,27 @@ msgstr "跟踪批次" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_GO_FORWARD" -msgstr "å‘å‰" +msgstr "STOCK_GO_FORWARD" #. module: stock #: field:stock.production.lot.revision,author_id:0 msgid "Author" -msgstr "建立者" +msgstr "作者" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_UNDELETE" -msgstr "æ¢å¤" +msgstr "STOCK_UNDELETE" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_EXECUTE" -msgstr "执行" +msgstr "STOCK_EXECUTE" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_DIALOG_QUESTION" -msgstr "ç–‘é—®" +msgstr "STOCK_DIALOG_QUESTION" #. module: stock #: selection:stock.location,chained_auto_packing:0 @@ -664,12 +664,12 @@ msgstr "跟踪å·/åºå·" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_SELECT_FONT" -msgstr "选择å—体" +msgstr "STOCK_SELECT_FONT" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_PASTE" -msgstr "粘贴" +msgstr "STOCK_PASTE" #. module: stock #: model:stock.location,name:stock.stock_location_locations_partner @@ -680,7 +680,7 @@ msgstr "业务伙伴库ä½" #: help:stock.move,tracking_id:0 msgid "" "Tracking lot is the code that will be put on the logistical unit/pallet" -msgstr "跟踪批次是代ç 将放入逻辑å•ä½/托æ¿" +msgstr "跟踪批次å·æ˜¯å¸–在货è¿åŒ…装或托æ¿ä¸Šçš„代ç " #. module: stock #: view:stock.tracking:0 @@ -695,7 +695,7 @@ msgstr "欧洲客户" #. module: stock #: selection:stock.location,icon:0 msgid "terp-stock" -msgstr "库å˜" +msgstr "terp-stock" #. module: stock #: rml:stock.picking.list:0 @@ -705,12 +705,12 @@ msgstr "包装å•:" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_MEDIA_RECORD" -msgstr "记录" +msgstr "STOCK_MEDIA_RECORD" #. module: stock #: view:stock.picking:0 msgid "Calendar View" -msgstr "日程表视图" +msgstr "日历视图" #. module: stock #: wizard_field:stock.location.products,init,from_date:0 @@ -725,7 +725,7 @@ msgstr "é‡é‡" #. module: stock #: rml:stock.picking.list:0 msgid "Non Assigned Products:" -msgstr "没指定产å“" +msgstr "未分派的产å“" #. module: stock #: view:stock.picking:0 @@ -735,12 +735,12 @@ msgstr "å‘票控制" #. module: stock #: model:ir.model,name:stock.model_stock_production_lot_revision msgid "Production lot revisions" -msgstr "生产批次次修订" +msgstr "生产批次修订" #. module: stock #: view:stock.picking:0 msgid "Packing Done" -msgstr "打包装完æˆ" +msgstr "装箱完æˆ" #. module: stock #: selection:stock.move,state:0 @@ -754,7 +754,7 @@ msgstr "ç‰å¾…ä¸" #: model:ir.ui.menu,name:stock.menu_action_picking_tree7 #: model:ir.ui.menu,name:stock.menu_picking_waiting msgid "Available Packing" -msgstr "å¯åŒ…装" +msgstr "" #. module: stock #: model:ir.model,name:stock.model_stock_warehouse @@ -765,7 +765,7 @@ msgstr "仓库" #. module: stock #: selection:stock.location,icon:0 msgid "terp-report" -msgstr "报表" +msgstr "terp-report" #. module: stock #: wizard_field:stock.invoice_onshipping,init,type:0 @@ -780,12 +780,12 @@ msgstr "一般IT供应商" #. module: stock #: model:ir.actions.report.xml,name:stock.report_location_overview_all msgid "Location Content (With children)" -msgstr "货物内容(å库ä½)" +msgstr "库å˜åœ°ç‚¹ï¼ˆåŒ…括å项)" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_FILE" -msgstr "文件" +msgstr "STOCK_FILE" #. module: stock #: field:report.stock.lines.date,id:0 @@ -795,35 +795,35 @@ msgstr "盘å˜æ˜Žç»†ID" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_EDIT" -msgstr "编辑" +msgstr "STOCK_EDIT" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_CONNECT" -msgstr "连接" +msgstr "STOCK_CONNECT" #. module: stock #: model:ir.actions.act_window,name:stock.action_picking_all #: model:ir.ui.menu,name:stock.menu_action_picking_all #: wizard_field:stock.picking.make,init,pickings:0 msgid "Packing" -msgstr "包装" +msgstr "装箱" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_GO_DOWN" -msgstr "å‘下" +msgstr "STOCK_GO_DOWN" #. module: stock #: field:res.partner,property_stock_customer:0 #: selection:stock.location,usage:0 msgid "Customer Location" -msgstr "客户库ä½" +msgstr "客户å˜è´§åœ°ç‚¹" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_OK" -msgstr "好" +msgstr "STOCK_OK" #. module: stock #: model:ir.actions.act_window,name:stock.action_picking_tree9 @@ -876,7 +876,7 @@ msgstr "所有库å˜è°ƒæ‹¨" #. module: stock #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" -msgstr "æ— æ•ˆXML视图结构!" +msgstr "æ述视图结构的XMLæ–‡ä»¶æ— æ•ˆ" #. module: stock #: field:res.partner,property_stock_supplier:0 @@ -887,7 +887,7 @@ msgstr "供货商库ä½" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_HELP" -msgstr "帮助" +msgstr "STOCK_HELP" #. module: stock #: selection:stock.move,priority:0 @@ -897,12 +897,12 @@ msgstr "紧急" #. module: stock #: help:product.category,property_stock_account_input_categ:0 msgid "This account will be used to value the input stock" -msgstr "用于记录入库的价值科目" +msgstr "æ¤ç§‘目用于记录入库库å˜é‡‘é¢" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_DIALOG_INFO" -msgstr "ä¿¡æ¯" +msgstr "STOCK_DIALOG_INFO" #. module: stock #: field:stock.move,date:0 @@ -928,7 +928,7 @@ msgstr "已创建å˜è´§è°ƒæ‹¨" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_GO_BACK" -msgstr "åŽé€€" +msgstr "STOCK_GO_BACK" #. module: stock #: selection:stock.picking,invoice_state:0 @@ -944,7 +944,7 @@ msgstr "对应库ä½å±žæ€§" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_JUSTIFY_FILL" -msgstr "两端对é½" +msgstr "STOCK_JUSTIFY_FILL" #. module: stock #: view:stock.move:0 @@ -965,7 +965,7 @@ msgstr "分é…方法" #. module: stock #: selection:stock.location,icon:0 msgid "terp-administration" -msgstr "管ç†å‘˜" +msgstr "terp-administration" #. module: stock #: field:stock.warehouse,lot_stock_id:0 @@ -975,12 +975,12 @@ msgstr "库ä½åº“å˜" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_APPLY" -msgstr "应用" +msgstr "STOCK_APPLY" #. module: stock #: wizard_view:stock.partial_picking,end2:0 msgid "The packing has been successfully made !" -msgstr "这包装创建æˆåŠŸ!" +msgstr "装箱已完æˆï¼" #. module: stock #: field:stock.move,address_id:0 @@ -997,23 +997,23 @@ msgstr "定期盘å˜" #. module: stock #: selection:stock.location,icon:0 msgid "terp-crm" -msgstr "客户关系管ç†" +msgstr "terp-crm" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_STRIKETHROUGH" -msgstr "åŠ åˆ é™¤çº¿" +msgstr "STOCK_STRIKETHROUGH" #. module: stock #: rml:lot.stock.overview_all:0 #: field:stock.incoterms,code:0 msgid "Code" -msgstr "代ç " +msgstr "ç¼–ç " #. module: stock #: selection:stock.location,icon:0 msgid "terp-partner" -msgstr "业务伙伴" +msgstr "terp-partner" #. module: stock #: model:ir.actions.act_window,name:stock.action_inventory_form_draft @@ -1060,12 +1060,12 @@ msgstr "ä¿¡æ¯" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_MISSING_IMAGE" -msgstr "图åƒ" +msgstr "STOCK_MISSING_IMAGE" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_SPELL_CHECK" -msgstr "检查" +msgstr "STOCK_SPELL_CHECK" #. module: stock #: model:ir.model,name:stock.model_stock_tracking @@ -1082,7 +1082,7 @@ msgstr "å•ä»·" #. module: stock #: view:stock.picking:0 msgid "Process Later" -msgstr "最åŽå¤„ç†" +msgstr "ç¨å€™å¤„ç†" #. module: stock #: help:res.partner,property_stock_supplier:0 @@ -1115,7 +1115,7 @@ msgstr "å¯è°ƒæ‹¨" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_HARDDISK" -msgstr "硬盘" +msgstr "STOCK_HARDDISK" #. module: stock #: model:ir.actions.act_window,name:stock.act_relate_picking @@ -1128,7 +1128,7 @@ msgstr "相关领料/æè´§" #: field:stock.picking.move.wizard,name:0 #: field:stock.warehouse,name:0 msgid "Name" -msgstr "3" +msgstr "å称" #. module: stock #: view:stock.inventory.line:0 @@ -1159,7 +1159,7 @@ msgstr "包装å•" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_COPY" -msgstr "å¤åˆ¶" +msgstr "STOCK_COPY" #. module: stock #: selection:stock.invoice_onshipping,init,type:0 @@ -1180,7 +1180,7 @@ msgstr "出库科目" #. module: stock #: selection:stock.location,chained_auto_packing:0 msgid "Automatic No Step Added" -msgstr "自动没æ¥éª¤å¢žåŠ " +msgstr "自动,ä¸åŠ å…¥æ¥éª¤" #. module: stock #: wizard_view:stock.location.products,init:0 @@ -1190,7 +1190,7 @@ msgstr "库å˜åº“ä½åˆ†æž" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_CDROM" -msgstr "光驱" +msgstr "STOCK_CDROM" #. module: stock #: selection:stock.picking,invoice_state:0 @@ -1215,12 +1215,12 @@ msgstr "内部å‚考" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_REFRESH" -msgstr "æ¢å¤" +msgstr "STOCK_REFRESH" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_STOP" -msgstr "åœæ¢" +msgstr "STOCK_STOP" #. module: stock #: wizard_view:stock.move.track,init:0 @@ -1230,27 +1230,27 @@ msgstr "跟踪调拨" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_FIND_AND_REPLACE" -msgstr "替æ¢" +msgstr "STOCK_FIND_AND_REPLACE" #. module: stock #: view:stock.picking:0 msgid "Validate" -msgstr "确认" +msgstr "å®¡æ ¸" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_DIALOG_WARNING" -msgstr "è¦å‘Š" +msgstr "STOCK_DIALOG_WARNING" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_ZOOM_IN" -msgstr "缩å°" +msgstr "STOCK_ZOOM_IN" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_CONVERT" -msgstr "修改" +msgstr "STOCK_CONVERT" #. module: stock #: field:stock.move,note:0 @@ -1284,27 +1284,27 @@ msgstr "产å“" #. module: stock #: field:stock.picking,move_type:0 msgid "Delivery Method" -msgstr "交货方å¼" +msgstr "è¿è¾“æ–¹å¼" #. module: stock #: model:ir.actions.wizard,name:stock.partial_picking msgid "Partial packing" -msgstr "部分包装" +msgstr "部分装箱" #. module: stock #: selection:stock.location,icon:0 msgid "terp-calendar" -msgstr "日程表" +msgstr "terp-calendar" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_ITALIC" -msgstr "斜体" +msgstr "STOCK_ITALIC" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_YES" -msgstr "是" +msgstr "STOCK_YES" #. module: stock #: model:ir.actions.act_window,name:stock.act_stock_picking_move_wizard @@ -1325,7 +1325,7 @@ msgstr "新的定期盘å˜" #. module: stock #: field:stock.production.lot,revisions:0 msgid "Revisions" -msgstr "修改" +msgstr "修订记录" #. module: stock #: selection:stock.location,allocation_method:0 @@ -1370,7 +1370,7 @@ msgstr "å•ä½" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_JUSTIFY_LEFT" -msgstr "左对é½" +msgstr "STOCK_JUSTIFY_LEFT" #. module: stock #: view:stock.inventory:0 @@ -1420,7 +1420,7 @@ msgstr "固定库ä½" #: constraint:ir.model:0 msgid "" "The Object name must start with x_ and not contain any special character !" -msgstr "对象åå¿…é¡»è¦ä»¥X_开头并且ä¸èƒ½å«æœ‰ç‰¹æ®Šå—符!" +msgstr "对象å必须以“x_â€å¼€å§‹ä¸”ä¸èƒ½åŒ…å«ä»»ä½•ç‰¹æ®Šå—符ï¼" #. module: stock #: field:stock.picking,min_date:0 @@ -1436,7 +1436,7 @@ msgstr "å‘出的产å“" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_COLOR_PICKER" -msgstr "颜色包" +msgstr "STOCK_COLOR_PICKER" #. module: stock #: model:ir.actions.report.xml,name:stock.report_lot_location @@ -1446,7 +1446,7 @@ msgstr "库ä½æ‰¹æ¬¡" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_DELETE" -msgstr "åˆ é™¤" +msgstr "STOCK_DELETE" #. module: stock #: model:account.journal,name:stock.stock_journal @@ -1456,7 +1456,7 @@ msgstr "库å˜åˆ†ç±»å¸" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_CLEAR" -msgstr "清空" +msgstr "STOCK_CLEAR" #. module: stock #: field:stock.production.lot,date:0 @@ -1486,7 +1486,7 @@ msgstr "产å“库å˜è§†å›¾" #. module: stock #: selection:stock.location,icon:0 msgid "terp-mrp" -msgstr "生产资æºè®¡åˆ’" +msgstr "terp-mrp" #. module: stock #: model:ir.actions.act_window,name:stock.action_picking_tree3_delivery @@ -1497,12 +1497,12 @@ msgstr "未æ¥çš„é€è´§å•" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_GO_UP" -msgstr "å‘上" +msgstr "STOCK_GO_UP" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_SORT_DESCENDING" -msgstr "é™åº" +msgstr "STOCK_SORT_DESCENDING" #. module: stock #: model:ir.actions.act_window,name:stock.action_tracking_form @@ -1523,17 +1523,17 @@ msgstr "库å˜æ¸…å•" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_HOME" -msgstr "首页" +msgstr "STOCK_HOME" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_PROPERTIES" -msgstr "属性" +msgstr "STOCK_PROPERTIES" #. module: stock #: field:stock.location,stock_real:0 msgid "Real Stock" -msgstr "实时库å˜" +msgstr "实际库å˜" #. module: stock #: model:ir.actions.wizard,name:stock.wizard_fill_inventory @@ -1576,7 +1576,7 @@ msgstr "包装处ç†" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_MEDIA_STOP" -msgstr "åœæ¢" +msgstr "STOCK_MEDIA_STOP" #. module: stock #: view:stock.move:0 @@ -1587,7 +1587,7 @@ msgstr "设为å¯ç”¨" #: model:ir.actions.wizard,name:stock.make_picking #: wizard_view:stock.picking.make,init:0 msgid "Make packing" -msgstr "进行创建分拣å•" +msgstr "装箱" #. module: stock #: field:stock.picking,backorder_id:0 @@ -1597,12 +1597,12 @@ msgstr "æ‹–æ¬ è®¢å•" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_DND_MULTIPLE" -msgstr "å€æ•°" +msgstr "STOCK_DND_MULTIPLE" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_REMOVE" -msgstr "移除" +msgstr "STOCK_REMOVE" #. module: stock #: field:stock.incoterms,active:0 @@ -1610,7 +1610,7 @@ msgstr "移除" #: field:stock.picking,active:0 #: field:stock.tracking,active:0 msgid "Active" -msgstr "生效" +msgstr "有效" #. module: stock #: view:product.template:0 @@ -1634,12 +1634,12 @@ msgstr "åˆè®¡:" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_DIALOG_AUTHENTICATION" -msgstr "确定" +msgstr "STOCK_DIALOG_AUTHENTICATION" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_ZOOM_OUT" -msgstr "放大" +msgstr "STOCK_ZOOM_OUT" #. module: stock #: wizard_field:stock.move.track,init,tracking_prefix:0 @@ -1654,22 +1654,22 @@ msgstr "最近" #. module: stock #: wizard_field:stock.location.products,init,to_date:0 msgid "To" -msgstr "到" +msgstr "至" #. module: stock #: field:stock.production.lot.revision,name:0 msgid "Revision Name" -msgstr "修改å称" +msgstr "修订版å称" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_SELECT_COLOR" -msgstr "选择颜色" +msgstr "STOCK_SELECT_COLOR" #. module: stock #: view:stock.inventory:0 msgid "Confirm Inventory" -msgstr "库å˜ç¡®å®š" +msgstr "盘点确认" #. module: stock #: view:product.category:0 @@ -1679,7 +1679,7 @@ msgstr "会计库å˜å±žæ€§" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_NO" -msgstr "å¦" +msgstr "STOCK_NO" #. module: stock #: model:stock.location,name:stock.stock_location_workshop @@ -1701,7 +1701,7 @@ msgstr "虚拟库ä½" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_REDO" -msgstr "é‡åš" +msgstr "STOCK_REDO" #. module: stock #: model:stock.location,name:stock.stock_location_company @@ -1721,7 +1721,7 @@ msgstr "ä¸ç´§æ€¥" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_CLOSE" -msgstr "å…³é—" +msgstr "STOCK_CLOSE" #. module: stock #: model:ir.actions.act_window,name:stock.action_warehouse_form @@ -1732,7 +1732,7 @@ msgstr "仓库" #. module: stock #: help:product.product,track_outgoing:0 msgid "Force to use a Production Lot during deliveries" -msgstr "é€è´§å¼ºåˆ¶çš„生产批次" +msgstr "在è¿è¾“时强制使用生产批次" #. module: stock #: view:stock.picking:0 @@ -1796,7 +1796,7 @@ msgstr "系列型å·" #. module: stock #: field:stock.location,posx:0 msgid "Corridor (X)" -msgstr "走廊(X)" +msgstr "通é“(X)" #. module: stock #: model:stock.location,name:stock.stock_location_suppliers @@ -1806,12 +1806,12 @@ msgstr "供应商" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_JUMP_TO" -msgstr "跳到" +msgstr "STOCK_JUMP_TO" #. module: stock #: selection:stock.location,icon:0 msgid "terp-tools" -msgstr "工具" +msgstr "terp-tools" #. module: stock #: model:ir.actions.report.xml,name:stock.report_location_overview @@ -1826,7 +1826,7 @@ msgstr "产å“库ä½" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_UNDO" -msgstr "å–消" +msgstr "STOCK_UNDO" #. module: stock #: model:ir.actions.wizard,name:stock.move_split @@ -1836,7 +1836,7 @@ msgstr "分割调拨明细" #. module: stock #: selection:stock.location,icon:0 msgid "terp-sale" -msgstr "销售" +msgstr "terp-sale" #. module: stock #: field:stock.production.lot,name:0 @@ -1846,7 +1846,7 @@ msgstr "åºå·" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_ADD" -msgstr "å¢žåŠ " +msgstr "STOCK_ADD" #. module: stock #: field:stock.location,chained_delay:0 @@ -1856,17 +1856,17 @@ msgstr "è¿žé”延迟(天)" #. module: stock #: field:stock.move,location_id:0 msgid "Source Location" -msgstr "æºè´§ä½" +msgstr "æºåº“ä½" #. module: stock #: view:product.template:0 msgid "Accounting Entries" -msgstr "å‡è¯" +msgstr "会计分录" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_MEDIA_PAUSE" -msgstr "æš‚åœ" +msgstr "STOCK_MEDIA_PAUSE" #. module: stock #: view:product.product:0 @@ -1894,12 +1894,12 @@ msgstr "盘å˜æ—¥æœŸ" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_PRINT_PREVIEW" -msgstr "打å°é¢„览" +msgstr "STOCK_PRINT_PREVIEW" #. module: stock #: selection:stock.location,icon:0 msgid "STOCK_FIND" -msgstr "查找" +msgstr "STOCK_FIND" #. module: stock #: view:stock.inventory:0 diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml index 1ea74cea1ef692481b234cf743a317cbac97bc00..4dad60a3c9758a024e0282500d4c03a27e384e13 100644 --- a/addons/stock/security/stock_security.xml +++ b/addons/stock/security/stock_security.xml @@ -19,75 +19,46 @@ <!-- multi --> - <record model="ir.rule.group" id="stock_picking_rule_group"> - <field name="name">stock_picking multi-company</field> + <record model="ir.rule" id="stock_picking_rule"> + <field name="name">stock_picking multi-company</field> <field name="model_id" search="[('model','=','stock.picking')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="stock_picking_rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','stock.picking'),('name','=','company_id')]"/> <field name="domain_force">['|',('company_id','=',False),('company_id','=',False)]</field> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> - <field name="rule_group" ref="stock_picking_rule_group"/> </record> - <record model="ir.rule.group" id="stock_warehouse_comp_rule_group"> - <field name="name">Warehouse multi-company</field> + <record model="ir.rule" id="stock_warehouse_comp_rule"> + <field name="name">Warehouse multi-company</field> <field name="model_id" ref="model_stock_warehouse"/> <field name="global" eval="True"/> - </record> - - <record model="ir.rule" id="stock_warehouse_comp_rule"> - <field name="field_id" search="[('model','=','stock.warehouse'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="stock_warehouse_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record model="ir.rule.group" id="stock_location_comp_rule_group"> - <field name="name">Location multi-company</field> + <record model="ir.rule" id="stock_location_comp_rule"> + <field name="name">Location multi-company</field> <field name="model_id" ref="model_stock_location"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="stock_location_comp_rule"> - <field name="field_id" search="[('model','=','stock.location'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="stock_location_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record model="ir.rule.group" id="stock_move_rule_group"> - <field name="name">stock_move multi-company</field> + <record model="ir.rule" id="stock_move_rule"> + <field name="name">stock_move multi-company</field> <field name="model_id" search="[('model','=','stock.move')]" model="ir.model"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="stock_move_rule"> - <field model="ir.model.fields" name="field_id" search="[('model','=','stock.move'),('name','=','company_id')]"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - <field name="operator">child_of</field> - <field name="operand">user.company_id.id</field> - <field name="rule_group" ref="stock_move_rule_group"/> </record> - <record model="ir.rule.group" id="stock_inventory_line_comp_rule_group"> - <field name="name">Inventory Line multi-company</field> + <record model="ir.rule" id="stock_inventory_line_comp_rule"> + <field name="name">Inventory Line multi-company</field> <field name="model_id" ref="model_stock_inventory_line"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="stock_inventory_line_comp_rule"> - <field name="field_id" search="[('model','=','stock.inventory.line'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="stock_inventory_line_comp_rule_group"/> <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> - <record model="ir.rule.group" id="stock_inventory_comp_rule_group"> - <field name="name">Inventory multi-company</field> + <record model="ir.rule" id="stock_inventory_comp_rule"> + <field name="name">Inventory multi-company</field> <field name="model_id" ref="model_stock_inventory"/> <field name="global" eval="True"/> - </record> - <record model="ir.rule" id="stock_inventory_comp_rule"> - <field name="field_id" search="[('model','=','stock.inventory'),('name','=','company_id')]" model="ir.model.fields"/> - <field name="rule_group" ref="stock_inventory_comp_rule_group"/> - <field name="domain_force">[('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> + <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> </record> </data> diff --git a/addons/stock/wizard/stock_change_standard_price.py b/addons/stock/wizard/stock_change_standard_price.py index a18136fcac89a54b34daa1e89b3913cac452eee5..d83b2c1d14026ce8fadf444a6097200d20aaf743 100644 --- a/addons/stock/wizard/stock_change_standard_price.py +++ b/addons/stock/wizard/stock_change_standard_price.py @@ -91,68 +91,16 @@ class change_standard_price(osv.osv_memory): """ rec_id = context and context.get('active_id', False) - prod_obj = self.pool.get('product.template') - location_obj = self.pool.get('stock.location') - lot_obj = self.pool.get('stock.report.prodlots') - move_obj = self.pool.get('account.move') - move_line_obj = self.pool.get('account.move.line') - data_obj = self.pool.get('ir.model.data') - - res = self.read(cr, uid, ids[0], ['new_price']) - new_price = res.get('new_price',[]) - data = prod_obj.browse(cr, uid, rec_id) - diff = data.standard_price - new_price - prod_obj.write(cr, uid, rec_id, {'standard_price': new_price}) - - loc_ids = location_obj.search(cr, uid, [('account_id','<>',False),('usage','=','internal')]) - lot_ids = lot_obj.search(cr, uid, [('location_id', 'in', loc_ids),('product_id','=',rec_id)]) - qty = 0 - debit = 0.0 - credit = 0.0 - stock_input_acc = data.property_stock_account_input.id or data.categ_id.property_stock_account_input_categ.id - stock_output_acc = data.property_stock_account_output.id or data.categ_id.property_stock_account_output_categ.id - - for lots in lot_obj.browse(cr, uid, lot_ids): - qty += lots.name - - if stock_input_acc and stock_output_acc and lot_ids: - move_id = move_obj.create(cr, uid, {'journal_id': data.categ_id.property_stock_journal.id}) - if diff > 0: - credit = qty * diff - move_line_obj.create(cr, uid, { - 'name': data.name, - 'account_id': stock_input_acc, - 'credit': credit, - 'move_id': move_id - }) - for lots in lot_obj.browse(cr, uid, lot_ids): - credit = lots.name * diff - move_line_obj.create(cr, uid, { - 'name': 'Expense', - 'account_id': lots.location_id.account_id.id, - 'debit': credit, - 'move_id': move_id - }) - elif diff < 0: - debit = qty * -diff - move_line_obj.create(cr, uid, { - 'name': data.name, - 'account_id': stock_output_acc, - 'debit': debit, - 'move_id': move_id - }) - for lots in lot_obj.browse(cr, uid, lot_ids): - debit = lots.name * -diff - move_line_obj.create(cr, uid, { - 'name': 'Income', - 'account_id': lots.location_id.account_id.id, - 'credit': debit, - 'move_id': move_id - }) - else: - raise osv.except_osv(_('Warning!'),_('No Change in Price.')) - else: - pass + assert rec_id, _('Active ID is not set in Context') + prod_obj = self.pool.get('product.product') + res = self.browse(cr, uid, ids) + datas = { + 'new_price' : res[0].new_price, + 'stock_output_account' : res[0].stock_account_output.id, + 'stock_input_account' : res[0].stock_account_input.id, + 'stock_journal' : res[0].stock_journal.id + } + prod_obj.do_change_standard_price(cr, uid, [rec_id], datas, context) return {} change_standard_price() diff --git a/addons/stock/wizard/stock_location_product.py b/addons/stock/wizard/stock_location_product.py old mode 100755 new mode 100644 diff --git a/addons/survey/report/__init__.py b/addons/survey/report/__init__.py old mode 100755 new mode 100644 diff --git a/addons/survey/report/survey_analysis_report.py b/addons/survey/report/survey_analysis_report.py old mode 100755 new mode 100644 diff --git a/addons/survey/wizard/__init__.py b/addons/survey/wizard/__init__.py old mode 100755 new mode 100644 diff --git a/addons/thunderbird/__init__.py b/addons/thunderbird/__init__.py index 5b7582a98f09849cdb3a9c721d905301c444e097..4ab5861f126f1c78289cce763b1b0c4f1e97044c 100644 --- a/addons/thunderbird/__init__.py +++ b/addons/thunderbird/__init__.py @@ -47,4 +47,4 @@ ############################################################################## import partner - +import installer diff --git a/addons/thunderbird/__openerp__.py b/addons/thunderbird/__openerp__.py index 2cb470bf8863bb35a96fac927b7440597844a99a..5e60f6508cc934dad66726d91e7200e9990d0f2c 100644 --- a/addons/thunderbird/__openerp__.py +++ b/addons/thunderbird/__openerp__.py @@ -39,7 +39,8 @@ Select a section for which you want to create case.''', "init_xml" : [], "demo_xml" : [], - "update_xml" : ['security/ir.model.access.csv'], + "update_xml" : ['thunderbird_installer.xml', + 'security/ir.model.access.csv'], "active": False, "installable": True } diff --git a/addons/thunderbird/i18n/en_GB.po b/addons/thunderbird/i18n/en_GB.po new file mode 100644 index 0000000000000000000000000000000000000000..5d51db5a9a170d86ae77729f346199c910c3d472 --- /dev/null +++ b/addons/thunderbird/i18n/en_GB.po @@ -0,0 +1,86 @@ +# English (United Kingdom) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-11-26 06:05+0000\n" +"PO-Revision-Date: 2010-04-28 19:32+0000\n" +"Last-Translator: Shay <Unknown>\n" +"Language-Team: English (United Kingdom) <en_GB@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-04-29 03:52+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: thunderbird +#: field:tinythunderbird.partner,copy_to:0 +msgid "Copy To" +msgstr "Copy To" + +#. module: thunderbird +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"The Object name must start with x_ and not contain any special characters!" + +#. module: thunderbird +#: field:tinythunderbird.partner,description:0 +msgid "Description" +msgstr "Description" + +#. module: thunderbird +#: field:tinythunderbird.partner,reference:0 +msgid "Reference" +msgstr "Reference" + +#. module: thunderbird +#: model:ir.model,name:thunderbird.model_tinythunderbird_partner +msgid "Thunderbid mails" +msgstr "Thunderbid mails" + +#. module: thunderbird +#: field:tinythunderbird.partner,attachments:0 +msgid "Attached Files" +msgstr "Attached Files" + +#. module: thunderbird +#: field:tinythunderbird.partner,res_user_id:0 +msgid "User" +msgstr "User" + +#. module: thunderbird +#: field:tinythunderbird.partner,receiver:0 +msgid "Receiver" +msgstr "Receiver" + +#. module: thunderbird +#: field:tinythunderbird.partner,date:0 +msgid "Date" +msgstr "Date" + +#. module: thunderbird +#: field:tinythunderbird.partner,title:0 +msgid "Subject" +msgstr "Subject" + +#. module: thunderbird +#: code:addons/thunderbird/partner/partner.py:0 +#, python-format +msgid "Archive" +msgstr "Archive" + +#. module: thunderbird +#: model:ir.module.module,shortdesc:thunderbird.module_meta_information +msgid "Thunderbird Interface" +msgstr "Thunderbird Interface" + +#. module: thunderbird +#: field:tinythunderbird.partner,sender:0 +msgid "Sender" +msgstr "Sender" diff --git a/addons/thunderbird/i18n/es.po b/addons/thunderbird/i18n/es.po new file mode 100644 index 0000000000000000000000000000000000000000..fa718bb8456950c036370bcd6998426b2dd5bbe7 --- /dev/null +++ b/addons/thunderbird/i18n/es.po @@ -0,0 +1,86 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-11-26 06:05+0000\n" +"PO-Revision-Date: 2010-04-28 19:31+0000\n" +"Last-Translator: Shay <Unknown>\n" +"Language-Team: Spanish <es@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-04-29 03:52+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: thunderbird +#: field:tinythunderbird.partner,copy_to:0 +msgid "Copy To" +msgstr "Copiar a" + +#. module: thunderbird +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"¡El objeto debe empezar con x_ y no puede contener ningún carácter especial!" + +#. module: thunderbird +#: field:tinythunderbird.partner,description:0 +msgid "Description" +msgstr "Descripción" + +#. module: thunderbird +#: field:tinythunderbird.partner,reference:0 +msgid "Reference" +msgstr "Referencia" + +#. module: thunderbird +#: model:ir.model,name:thunderbird.model_tinythunderbird_partner +msgid "Thunderbid mails" +msgstr "Correo Thunderbid" + +#. module: thunderbird +#: field:tinythunderbird.partner,attachments:0 +msgid "Attached Files" +msgstr "Archivos Adjuntos" + +#. module: thunderbird +#: field:tinythunderbird.partner,res_user_id:0 +msgid "User" +msgstr "Usuario" + +#. module: thunderbird +#: field:tinythunderbird.partner,receiver:0 +msgid "Receiver" +msgstr "Destinatario" + +#. module: thunderbird +#: field:tinythunderbird.partner,date:0 +msgid "Date" +msgstr "Fecha" + +#. module: thunderbird +#: field:tinythunderbird.partner,title:0 +msgid "Subject" +msgstr "Asunto" + +#. module: thunderbird +#: code:addons/thunderbird/partner/partner.py:0 +#, python-format +msgid "Archive" +msgstr "Archivar" + +#. module: thunderbird +#: model:ir.module.module,shortdesc:thunderbird.module_meta_information +msgid "Thunderbird Interface" +msgstr "Interfaz Thunderbird" + +#. module: thunderbird +#: field:tinythunderbird.partner,sender:0 +msgid "Sender" +msgstr "Remitente" diff --git a/addons/thunderbird/i18n/zh_CN.po b/addons/thunderbird/i18n/zh_CN.po new file mode 100644 index 0000000000000000000000000000000000000000..265639d5f98b939120a80823e0741714e96e21d4 --- /dev/null +++ b/addons/thunderbird/i18n/zh_CN.po @@ -0,0 +1,85 @@ +# Chinese (Simplified) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2009-11-26 06:05+0000\n" +"PO-Revision-Date: 2010-04-28 19:35+0000\n" +"Last-Translator: Shay <Unknown>\n" +"Language-Team: Chinese (Simplified) <zh_CN@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-04-29 03:52+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: thunderbird +#: field:tinythunderbird.partner,copy_to:0 +msgid "Copy To" +msgstr "å¤åˆ¶åˆ°" + +#. module: thunderbird +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "对象å必须是以x_开头并且ä¸èƒ½å«æœ‰ç‰¹æ®Šå—符" + +#. module: thunderbird +#: field:tinythunderbird.partner,description:0 +msgid "Description" +msgstr "æè¿°" + +#. module: thunderbird +#: field:tinythunderbird.partner,reference:0 +msgid "Reference" +msgstr "å‚考" + +#. module: thunderbird +#: model:ir.model,name:thunderbird.model_tinythunderbird_partner +msgid "Thunderbid mails" +msgstr "Thunderbid邮件" + +#. module: thunderbird +#: field:tinythunderbird.partner,attachments:0 +msgid "Attached Files" +msgstr "æ·»åŠ é™„ä»¶" + +#. module: thunderbird +#: field:tinythunderbird.partner,res_user_id:0 +msgid "User" +msgstr "用户" + +#. module: thunderbird +#: field:tinythunderbird.partner,receiver:0 +msgid "Receiver" +msgstr "收件人" + +#. module: thunderbird +#: field:tinythunderbird.partner,date:0 +msgid "Date" +msgstr "日期" + +#. module: thunderbird +#: field:tinythunderbird.partner,title:0 +msgid "Subject" +msgstr "主题" + +#. module: thunderbird +#: code:addons/thunderbird/partner/partner.py:0 +#, python-format +msgid "Archive" +msgstr "å˜æ¡£" + +#. module: thunderbird +#: model:ir.module.module,shortdesc:thunderbird.module_meta_information +msgid "Thunderbird Interface" +msgstr "Thunderbird接å£" + +#. module: thunderbird +#: field:tinythunderbird.partner,sender:0 +msgid "Sender" +msgstr "å‘件人" diff --git a/addons/thunderbird/installer.py b/addons/thunderbird/installer.py new file mode 100644 index 0000000000000000000000000000000000000000..4e0f4435d3127d41154c7e1ca99eecaefb7f2ff5 --- /dev/null +++ b/addons/thunderbird/installer.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +from osv import fields +from osv import osv +from tools import config + +import base64 + +class thunderbird_installer(osv.osv_memory): + _name = 'thunderbird.installer' + _inherit = 'res.config.installer' + + def process_plugin(self, cr, uid, ids, context): + """ + Default Attach Thunderbird Plug-in File. + """ + data = {} + file = open(config['addons_path'] + "/thunderbird/plugin/tiny_plugin-2.0.xpi", 'r') + data['plugin_file'] = base64.encodestring(file.read()) + self.write(cr, uid, ids, data) + return False + + def process_pdf_file(self, cr, uid, ids, context): + """ + Default Attach Thunderbird Plug-in Installation File. + """ + data = {} + pdf_file = open(config['addons_path'] + "/thunderbird/doc/Installation Guide to OpenERP Thunderbid Plug-in.pdf", 'r') + data['pdf_file'] = base64.encodestring(pdf_file.read()) + self.write(cr, uid, ids, data) + return False + + _columns = { + 'name':fields.char('File name', size=34), + 'pdf_name':fields.char('File name', size=64), + 'thunderbird':fields.boolean('Thunderbird Module ', help="Allows you to select an object that you’d like to add to your email and its attachments."), + 'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbir."), + 'pdf_file':fields.binary('Thunderbird Plug-in Installation File', help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True), + } + + _defaults = { + 'thunderbird' : True, + 'name' : 'tiny_plugin-2.0.xpi', + 'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf', + } + +thunderbird_installer() diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py index 3d6782899888aab9b39a5e19355c476d3aa3ef4c..a94aaa30c2d8cef97c616ee5fc52f807138b61aa 100644 --- a/addons/thunderbird/partner/partner.py +++ b/addons/thunderbird/partner/partner.py @@ -92,9 +92,6 @@ class tinythunderbird_partner(osv.osv): partner=add_obj.read(cr,user,partner_ids,['partner_id']) if partner: dictcreate.update({'partner_id':partner[0]['partner_id'][0]}) - search_id = self.pool.get('res.request.link').search(cr,user,[('object','=',dictcreate['ref'].split(',')[0])]) - if not search_id: - create_link_id = self.pool.get('res.request.link').create(cr,user,{'name':dictcreate['ref'].split(',')[0],'object':dictcreate['ref'].split(',')[0]}) create_id = self.pool.get(dictcreate.get('object','crm.case')).create(cr, user, dictcreate) cases=case_pool.browse(cr,user,[create_id]) case_pool._history(cr, user, cases, _('Archive'), history=True, email=False) @@ -162,12 +159,15 @@ class tinythunderbird_partner(osv.osv): dictcreate = dict(vals) datas = [dictcreate['datas']] name = [dictcreate['name']] + f_name = [dictcreate['datas_fname']] if(dictcreate['datas'].__contains__(',')): name = dictcreate['name'].split(',') datas = dictcreate['datas'].split(',') + f_name = dictcreate['datas_fname'].split(',') for i in range(0,datas.__len__()): dictcreate['name'] = name[i] dictcreate['datas'] = datas[i] + dictcreate['datas_fname'] = f_name[i] create_id = self.pool.get('ir.attachment').create(cr,user,dictcreate) return 0 diff --git a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi index 1ec2f9daa0cc19d6766cc3c1a34a20106700bea4..e24f66e8e9439ea9eed467595880935131bbf74f 100644 Binary files a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi and b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi differ diff --git a/addons/thunderbird/thunderbird_installer.xml b/addons/thunderbird/thunderbird_installer.xml new file mode 100644 index 0000000000000000000000000000000000000000..59e0cc4f604394a2d047cffc422c24ebd0bf926f --- /dev/null +++ b/addons/thunderbird/thunderbird_installer.xml @@ -0,0 +1,107 @@ +<openerp> + <data> + + <record id="view_thunderbird_installer" model="ir.ui.view"> + <field name="name">thunderbird.installer.view</field> + <field name="model">thunderbird.installer</field> + <field name="type">form</field> + <field name="inherit_id" ref="base.res_config_installer"/> + <field name="arch" type="xml"> + <data> + <form position="attributes"> + <attribute name="string">Thunderbird Module Installation</attribute> + </form> + <separator string="title" position="attributes"> + <attribute name="string">Configure Thunderbird Module</attribute> + </separator> + <xpath expr="//label[@string='description']" position="attributes"> + <attribute name="string">This module is required for the thuderbird plug-in to work properly.This allows you to select an object that you had like to add to your email and its attachments. You can select a partner, a task, a project, an analytical account, or any other object and attach selected mail as .eml file in attachment of selected record.</attribute> + </xpath> + <group colspan="8"> + <separator string="Thunderbird" colspan="4"/> + <field name="thunderbird"/> + <field name="name" invisible="1"/> + <field name="pdf_name" invisible="1"/> + <newline/> + + <field name="plugin_file" filename="name"/> + <button name="process_plugin" icon="gtk-execute" string="Get Plugin File" type="object"/> + <newline/> + <field name="pdf_file" filename="pdf_name"/> + <button name="process_pdf_file" icon="gtk-execute" string="Get Plugin Installation File" type="object"/> + <newline/> + <separator string="Thunderbird plugin installation note." colspan="4"/> + <label colspan="8" string="Save The thunderbird plugÂin Follow the following step to install thunderbird plugÂin ? 1. From Menu Bar, Open Tools Â> Add ons. 2. Now click on install button and a browser window will appear. 3. Just select the (.xpi) file from thunderbird/plugin directory and click ok, a new software installation window will appear and within a short time Install Now button will be enabled. 4. Click on Install Now and restart Thunderbird. 5. Now Thunderbird plugÂin is installed."/> + </group> + </data> + </field> + </record> + + <record id="action_thunderbird_installer" model="ir.actions.act_window"> + <field name="name">Thunderbird Module Installation</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">thunderbird.installer</field> + <field name="view_id" ref="view_thunderbird_installer"/> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <record id="thunderbird_installer_todo" model="ir.actions.todo"> + <field name="action_id" ref="action_thunderbird_installer"/> + <field name="sequence">3</field> + </record> + + <!-- Configuration wizard. --> + + <record id="view_thunderbird_wizard" model="ir.ui.view"> + <field name="name">thunderbird.wizard</field> + <field name="model">thunderbird.installer</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string= "Thunderbird Installation"> + <group colspan="4"> + <separator string="Configure Thunderbird Module" colspan="4"/> + <group colspan="4" col="10"> + <group colspan="2"> + <image name="gtk-dialog-info"/> + <newline/> + <label align="0.0" string="This module is required for the thuderbird plug-in to work properly.This allows you to select an object that you had like to add to your email and its attachments. You can select a partner, a task, a project, an analytical account, or any other object and attach selected mail as .eml file in attachment of selected record." width="200"/> + </group> + <group colspan="8"> + <separator string="Thunderbird" colspan="4"/> + <field name="thunderbird"/> + <field name="name" invisible="1"/> + <newline/> + <field name="plugin_file"/> + <button name="process_plugin" icon="gtk-execute" string="Get Plugin File" type="object"/> + <newline/> + <separator string="Thunderbird plugin installation note." colspan="4"/> + <label colspan="8" string="Save The thunderbird plugÂin Follow the following step to install thunderbird plugÂin ? 1. From Menu Bar, Open Tools Â> Add ons. 2. Now click on install button and a browser window will appear. 3. Just select the (.xpi) file from thunderbird/plugin directory and click ok, a new software installation window will appear and within a short time Install Now button will be enabled. 4. Click on Install Now and restart Thunderbird. 5. Now Thunderbird plugÂin is installed."/> + </group> + </group> + </group> + <separator string="" colspan="4"/> + <group colspan="4"> + <label align="0.0" string="" colspan="3"/> + <button colspan="1" icon="gtk-cancel" special="cancel" string="Cancel"/> + </group> + </form> + </field> + </record> + + <record id="action_thunderbird_wizard" model="ir.actions.act_window"> + <field name="name">Thunderbird Module Installation</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">thunderbird.installer</field> + <field name="view_id" ref="view_thunderbird_wizard"/> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + + <menuitem id="menu_base_config_plugins" name="Plugins" parent="base.menu_base_config" sequence="10" /> + <menuitem id="menu_base_config_plugins_thunderbird" action="action_thunderbird_wizard" name="Thunderbird" parent="menu_base_config_plugins" sequence="10" /> + + </data> +</openerp>