diff --git a/addons/account/account.py b/addons/account/account.py index 280d4135c21..83838f5f545 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -3422,7 +3422,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): # Create Bank journals self._create_bank_journals_from_o2m(cr, uid, obj_wizard, company_id, acc_template_ref, context=context) - return True + return {'type' : 'ir.actions.act_window_close'} def _prepare_bank_journal(self, cr, uid, line, current_num, default_account_id, company_id, context=None): ''' diff --git a/addons/account_asset/__openerp__.py b/addons/account_asset/__openerp__.py index 5ae0629c4eb..a8745fa088b 100644 --- a/addons/account_asset/__openerp__.py +++ b/addons/account_asset/__openerp__.py @@ -34,8 +34,11 @@ ], "demo_xml" : [ 'account_asset_demo.xml' ], - 'test': ['test/account_asset.yml', - ], + 'test': [ + 'test/account_asset_demo.yml', + 'test/account_asset.yml', + 'test/account_asset_wizard.yml', + ], "update_xml" : [ "security/account_asset_security.xml", "security/ir.model.access.csv", @@ -45,7 +48,6 @@ "account_asset_view.xml", "account_asset_invoice_view.xml", "report/account_asset_report_view.xml", - ], "active": False, "installable": True, diff --git a/addons/account_asset/test/account_asset.yml b/addons/account_asset/test/account_asset.yml index b56aa028c61..e9f75737eba 100644 --- a/addons/account_asset/test/account_asset.yml +++ b/addons/account_asset/test/account_asset.yml @@ -1,55 +1,35 @@ - - In order to test Account Asset I create Asset and confirm it and check it's Depriciation lines -- - I Create an Asset Category -- - !record {model: account.asset.category, id: account_asset_category_landbuildings0}: - account_asset_id: account.xfa - account_depreciation_id: account.xfa - account_expense_depreciation_id: account.a_expense - journal_id: account.expenses_journal - name: Land & Buildings -- - I Create an Account Asset -- - !record {model: account.asset.asset, id: account_asset_asset_Land0}: - category_id: account_asset_category_landbuildings0 - code: land - name: Land - partner_id: base.res_partner_14 - purchase_value: 5000.0 - state: draft -- - I check Initially that Account Asset is in the "Draft" state -- - !assert {model: account.asset.asset, id: account_asset_asset_Land0}: - - state == 'draft' -- - I Confirm Account Asset using Confirm Asset button + In order to test the process of Account Asset, I perform a action to confirm Account Asset. - !python {model: account.asset.asset}: | - self.validate(cr, uid, [ref("account_asset_asset_Land0")]) + self.validate(cr, uid, [ref("account_asset_asset_vehicles0")]) - - I check Asset is in running state after pressing Confirm button on asset + I check Asset is now in Open state. - - !assert {model: account.asset.asset, id: account_asset_asset_Land0}: + !assert {model: account.asset.asset, id: account_asset_asset_vehicles0, severity: error, string: Asset should be in Open state}: - state == 'open' - - I Compute Account Asset using Compute button and check the number of depreciation lines created + I compute depreciation lines for asset of CEO's Car . - !python {model: account.asset.asset}: | - self.compute_depreciation_board(cr, uid, [ref("account_asset_asset_Land0")]) + self.compute_depreciation_board(cr, uid, [ref("account_asset_asset_vehicles0")]) # pressing computation button can be remove if creation of depreciation lines while asset is created - value = self.browse(cr, uid, [ref("account_asset_asset_Land0")])[0] - assert value.method_number == len(value.depreciation_line_ids) + value = self.browse(cr, uid, [ref("account_asset_asset_vehicles0")])[0] + assert value.method_number == len(value.depreciation_line_ids), 'Depreciation lines not created correctly' - - I Create Account Move using create move button on depreciation lines + I create account move for all depreciation lines. - !python {model: account.asset.depreciation.line}: | - ids = self.search(cr, uid, [('asset_id','=',ref('account_asset_asset_Land0'))]) + ids = self.search(cr, uid, [('asset_id','=',ref('account_asset_asset_vehicles0'))]) self.create_move(cr, uid, ids) - - I Check that After creating all the moves of depreciation lines the state is in "Close" state + I check the move line is created. - - !assert {model: account.asset.asset, id: account_asset_asset_Land0}: + !python {model: account.asset.asset}: | + asset = self.browse(cr, uid, [ref("account_asset_asset_vehicles0")])[0] + assert len(asset.depreciation_line_ids) == len(asset.account_move_line_ids), 'Move lines not created correctly' +- + I Check that After creating all the moves of depreciation lines the state "Close". +- + !assert {model: account.asset.asset, id: account_asset_asset_vehicles0}: - state == 'close' diff --git a/addons/account_asset/test/account_asset_demo.yml b/addons/account_asset/test/account_asset_demo.yml new file mode 100644 index 00000000000..c0871d05268 --- /dev/null +++ b/addons/account_asset/test/account_asset_demo.yml @@ -0,0 +1,9 @@ +- + !record {model: account.asset.category, id: account_asset_category_fixedassets0}: + account_asset_id: account.xfa +- + !record {model: account.asset.asset, id: account_asset_asset_vehicles0}: + category_id: account_asset_category_sale +- + !record {model: account.asset.asset, id: account_asset_asset_vehicles0}: + method_number: 10 diff --git a/addons/account_asset/test/account_asset_wizard.yml b/addons/account_asset/test/account_asset_wizard.yml new file mode 100644 index 00000000000..7b77e5cfdda --- /dev/null +++ b/addons/account_asset/test/account_asset_wizard.yml @@ -0,0 +1,27 @@ +- + I create a record to change the duration of asset for calculating depreciation. +- + !record {model: asset.modify, id: asset_modify_number_0, context: "{'active_id': ref('account_asset_asset_office0')}"}: + method_number: 10.0 +- + I change the duration. +- + !python {model: asset.modify}: | + context = {"active_id":ref('account_asset_asset_office0')} + self.modify(cr, uid, [ref("asset_modify_number_0")], context=context) +- + I check the proper depreciation lines created. +- + !assert {model: account.asset.asset, id: account_asset.account_asset_asset_office0}: + - method_number == len(depreciation_line_ids) -1 +- + I create a period to compute a asset on period. +- + !record {model: asset.depreciation.confirmation.wizard, id: asset_compute_period_0}: + {} +- + I compute a asset on period. +- + !python {model: asset.depreciation.confirmation.wizard}: | + context = {"active_ids": [ref("menu_asset_depreciation_confirmation_wizard")], "active_id":ref('menu_asset_depreciation_confirmation_wizard')} + self.asset_compute(cr, uid, [ref("asset_compute_period_0")], context=context) diff --git a/addons/account_followup/__openerp__.py b/addons/account_followup/__openerp__.py index 3fe52186f03..c8a548db9e8 100644 --- a/addons/account_followup/__openerp__.py +++ b/addons/account_followup/__openerp__.py @@ -57,7 +57,10 @@ Note that if you want to check the followup level for a given partner/account en 'account_followup_data.xml', ], 'demo_xml': [], - 'test': ['test/account_followup.yml'], + 'test': [ + 'test/account_followup.yml', + 'test/account_followup_report.yml', + ], 'installable': True, 'active': False, 'certificate': '0072481076453', diff --git a/addons/account_followup/test/account_followup.yml b/addons/account_followup/test/account_followup.yml index 2650a40a7ad..da7da258d21 100644 --- a/addons/account_followup/test/account_followup.yml +++ b/addons/account_followup/test/account_followup.yml @@ -1,91 +1,25 @@ - - In order to test account followup module in OpenERP I create a FollowUp structure + In order to test account followup module in OpenERP, I change the state of invoice to "open". - - !record {model: res.company, id: ymltest_company_2}: - name: Acme 2 + !record {model: account.invoice, id: account.demo_invoice_0}: + check_total: 14.0 - - !record {model: account_followup.followup, id: account_followup_followup_testfollowups0}: - description: First letter after 15 net days, 30 net days and 45 days end of month levels. - company_id: ymltest_company_2 - followup_line: - - delay: 15 - name: 'level 0: 15 days' - sequence: 0 - start: days - description: Dear %(partner_name)s,\n\nException made if there was a mistake - of ours, it seems that the following amount staid unpaid. Please, take appropriate - measures in order to carry out this payment in the next 1 days.\n\nWould your - payment have been carried out after this mail was sent, please consider the - present one as void. Do not hesitate to contact our accounting department at - (+32).10.68.94.39.\n\nBest Regards,\n - - delay: 30 - name: 'level1: 30 days' - sequence: 1 - start: days - description: Dear %(partner_name)s,\n\nException made if there was a mistake - of ours, it seems that the following amount staid unpaid. Please, take appropriate - measures in order to carry out this payment in the next 2 days.\n\nWould your - payment have been carried out after this mail was sent, please consider the - present one as void. Do not hesitate to contact our accounting department at - (+32).10.68.94.39.\n\nBest Regards,\n - - delay: 45 - name: 'level 2: 45 days' - sequence: 2 - start: days - description: Dear %(partner_name)s,\n\nException made if there was a mistake - of ours, it seems that the following amount staid unpaid. Please, take appropriate - measures in order to carry out this payment in the next 3 days.\n\nWould your - payment have been carried out after this mail was sent, please consider the - present one as void. Do not hesitate to contact our accounting department at - (+32).10.68.94.39.\n\nBest Regards, - name: My followups - + !workflow {model: account.invoice, action: invoice_open, ref: account.demo_invoice_0} - - I create an invoice -- - !record {model: account.invoice, id: account_invoice_followup}: - account_id: account.a_recv - address_contact_id: base.res_partner_address_3000 - address_invoice_id: base.res_partner_address_3000 - company_id: base.main_company - currency_id: base.EUR - invoice_line: - - account_id: account.a_sale - name: '[PC1] Basic PC' - price_unit: 450.0 - quantity: 1.0 - product_id: product.product_product_pc1 - uos_id: product.product_uom_unit - journal_id: account.sales_journal - partner_id: base.res_partner_desertic_hispafuentes - reference_type: none - - -- - I change the state of the invoice using create button -- - !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_followup} - -- - I create a send followup record + I create a followup. - !record {model: account.followup.print, id: account_followup_print_0}: - date: !eval time.strftime('%Y-%m-%d') - followup_id: account_followup_followup_testfollowups0 - - + {} - - I Select Followup and clicked on Continue Button + I select the followup to send it to the partner. - !python {model: account.followup.print}: | self.do_continue(cr, uid, [ref("account_followup_print_0")], {"lang": 'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("account_followup.account_followup_print_menu")], "tz": False, "active_id": ref("account_followup.account_followup_print_menu"), }) - - - - I select partners whom I want to send followups + I select partners whom I want to send followups. - !record {model: account.followup.print.all, id: account_followup_print_all_0}: email_body: 'Date : %(date)s\n\nDear %(partner_name)s,\n\nPlease find in attachment @@ -95,15 +29,12 @@ partner_ids: - base.res_partner_desertic_hispafuentes partner_lang: 1 - - - - I clicked on Print Follow Ups to print Followups reports + I send a followup mail to partner. - !python {model: account.followup.print.all}: | import time - self.do_print(cr, uid, [ref("account_followup_print_all_0")], {"lang": 'en_US', + self.do_mail(cr, uid, [ref("account_followup_print_all_0")], {"lang": 'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("account_followup.account_followup_print_menu")], - "tz": False, "date": time.strftime('%Y-%m-%d'), "followup_id": ref("account_followup_followup_testfollowups0"), "active_id": ref("account_followup.account_followup_print_menu"), - "company_id": ref('base.main_company'), + "tz": False, "date": time.strftime('%Y-%m-%d'), "followup_id": ref("account_followup.demo_followup1"), "active_id": ref("account_followup.account_followup_print_menu"), }) diff --git a/addons/account_followup/test/account_followup_report.yml b/addons/account_followup/test/account_followup_report.yml new file mode 100644 index 00000000000..1aab384dc3b --- /dev/null +++ b/addons/account_followup/test/account_followup_report.yml @@ -0,0 +1,10 @@ +- + In order to test the report I print followup report. +- + !python {model: account.followup.print.all}: | + import time + ctx = {'form_view_ref':'account_followup.view_account_followup_print_all', 'followup_id': ref('account_followup.demo_followup1'),'date': time.strftime('%Y-%m-%d'),'model': 'account_followup.followup','active_ids':[ref('account_followup_print_all_0')], 'company_id':ref('base.main_company')} + data_dict = {'email_conf': 1} + from tools import test_reports + test_reports.try_report_action(cr, uid, 'action_account_followup_print_all', context=ctx, wiz_data=data_dict,wiz_buttons=["Print Follow Ups"], our_module='account_followup') + diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 0e82dd24da5..69186cea00c 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -368,8 +368,6 @@ class account_voucher(osv.osv): line_ids = resolve_o2m_operations(cr, uid, line_pool, line_ids, ["amount"], context) - total = 0.0 - total_tax = 0.0 for line in line_ids: line_amount = 0.0 line_amount = line.get('amount',0.0) @@ -830,8 +828,6 @@ class account_voucher(osv.osv): :return: mapping between fieldname and value of account move line to create :rtype: dict ''' - move_line_obj = self.pool.get('account.move.line') - currency_obj = self.pool.get('res.currency') voucher_brw = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context) debit = credit = 0.0 # TODO: is there any other alternative then the voucher type ?? @@ -870,7 +866,6 @@ class account_voucher(osv.osv): :return: mapping between fieldname and value of account move to create :rtype: dict ''' - move_obj = self.pool.get('account.move') seq_obj = self.pool.get('ir.sequence') voucher_brw = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context) if voucher_brw.number: @@ -1119,7 +1114,6 @@ class account_voucher(osv.osv): :return: mapping between fieldname and value of account move line to create :rtype: dict ''' - move_line_obj = self.pool.get('account.move.line') currency_obj = self.pool.get('res.currency') move_line = {} @@ -1181,9 +1175,6 @@ class account_voucher(osv.osv): context = {} move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') - currency_pool = self.pool.get('res.currency') - tax_obj = self.pool.get('account.tax') - seq_obj = self.pool.get('ir.sequence') for voucher in self.browse(cr, uid, ids, context=context): if voucher.move_id: continue @@ -1213,7 +1204,7 @@ class account_voucher(osv.osv): # Create the writeoff line if needed ml_writeoff = self.writeoff_move_line_get(cr, uid, voucher.id, line_total, move_id, name, company_currency, current_currency, context) if ml_writeoff: - ml_writeoff_id = move_line_pool.create(cr, uid, ml_writeoff, context) + move_line_pool.create(cr, uid, ml_writeoff, context) # We post the voucher. self.write(cr, uid, [voucher.id], { 'move_id': move_id, diff --git a/addons/audittrail/security/ir.model.access.csv b/addons/audittrail/security/ir.model.access.csv index 25bba6a00b1..1d2198fd661 100644 --- a/addons/audittrail/security/ir.model.access.csv +++ b/addons/audittrail/security/ir.model.access.csv @@ -1,4 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_audittrail_rule_all_users,audittrail rule all,model_audittrail_rule,base.group_user,1,0,0,0 +access_audittrail_rule_all_users,audittrail rule all,model_audittrail_rule,base.group_system,1,1,1,0 +access_audittrail_rule_all_access,audittrail rule all,model_audittrail_rule,base.group_erp_manager,1,1,1,0 access_audittrail_log_all_users,audittrail log all,model_audittrail_log,base.group_user,1,0,1,0 access_audittrail_log_line_all_users,audittrail log line all,model_audittrail_log_line,base.group_user,1,0,1,0 diff --git a/addons/base_contact/base_contact_view.xml b/addons/base_contact/base_contact_view.xml index 3e5edd201ac..475d85a5c1e 100644 --- a/addons/base_contact/base_contact_view.xml +++ b/addons/base_contact/base_contact_view.xml @@ -38,7 +38,7 @@ - + @@ -52,7 +52,7 @@
- + diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 83b0354912a..23f84606c29 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,6 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/lead2opportunity2win.yml', 'test/process/merge_opportunity.yml', 'test/process/cancel_lead.yml', + 'test/process/action_rule.yml', 'test/process/segmentation.yml', 'test/ui/crm_demo.yml', 'test/ui/duplicate_lead.yml', diff --git a/addons/crm/crm.py b/addons/crm/crm.py index bee1e48ada2..03cdb31832d 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -468,12 +468,10 @@ class crm_case(crm_base): self._action(cr, uid, cases, state) return True - #DEAD Code def remind_partner(self, cr, uid, ids, context=None, attach=False): return self.remind_user(cr, uid, ids, context, attach, destination=False) - #DEAD Code def remind_user(self, cr, uid, ids, context=None, attach=False, destination=True): mail_message = self.pool.get('mail.message') for case in self.browse(cr, uid, ids, context=context): diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index e9c77b3bdc6..b508b7d17a5 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -450,7 +450,8 @@