From c2c2f9e4fca86c4b091f3376896f17f97e99839d Mon Sep 17 00:00:00 2001 From: Kunjal Date: Mon, 22 Jan 2018 18:58:04 +0530 Subject: [PATCH 1/3] [FIX]: Multi branch improvement. --- .../security/branch_security.xml | 7 +++-- .../views/res_branch_view.xml | 29 +++++++++++++++++-- addons/mail/__init__.py | 7 +++++ addons/mail/__manifest__.py | 1 + addons/stock/security/stock_security.xml | 14 ++++----- 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/addons/base_branch_company/security/branch_security.xml b/addons/base_branch_company/security/branch_security.xml index c35a3964..902c1a2d 100644 --- a/addons/base_branch_company/security/branch_security.xml +++ b/addons/base_branch_company/security/branch_security.xml @@ -1,6 +1,5 @@ - - + Branch @@ -17,4 +16,8 @@ + + Multi Branch + + diff --git a/addons/base_branch_company/views/res_branch_view.xml b/addons/base_branch_company/views/res_branch_view.xml index 9c508303..c7fb3aa3 100644 --- a/addons/base_branch_company/views/res_branch_view.xml +++ b/addons/base_branch_company/views/res_branch_view.xml @@ -4,7 +4,7 @@ res.branch.form res.branch -
+
-
+
Branch:

diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index c7178ddd..ab9649bb 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -48,7 +48,7 @@ Reference:

-
+
Branch:

diff --git a/addons/account/views/report_partnerledger.xml b/addons/account/views/report_partnerledger.xml index 5482d71f..6e067fce 100644 --- a/addons/account/views/report_partnerledger.xml +++ b/addons/account/views/report_partnerledger.xml @@ -24,7 +24,7 @@

All Entries

All Posted Entries

-
+
Branch:

diff --git a/addons/account/wizard/account_report_aged_partner_balance_view.xml b/addons/account/wizard/account_report_aged_partner_balance_view.xml index c1653124..cb9f9944 100644 --- a/addons/account/wizard/account_report_aged_partner_balance_view.xml +++ b/addons/account/wizard/account_report_aged_partner_balance_view.xml @@ -12,7 +12,7 @@ - + diff --git a/addons/account/wizard/account_report_common_view.xml b/addons/account/wizard/account_report_common_view.xml index 13b137a3..46c3a8b8 100644 --- a/addons/account/wizard/account_report_common_view.xml +++ b/addons/account/wizard/account_report_common_view.xml @@ -14,7 +14,7 @@ - + diff --git a/addons/account_voucher/views/account_voucher_views.xml b/addons/account_voucher/views/account_voucher_views.xml index ea2f3371..e2808e14 100644 --- a/addons/account_voucher/views/account_voucher_views.xml +++ b/addons/account_voucher/views/account_voucher_views.xml @@ -233,7 +233,7 @@ - + @@ -347,7 +347,7 @@ - + diff --git a/addons/analytic/views/analytic_account_views.xml b/addons/analytic/views/analytic_account_views.xml index 6a2763fa..eff0109b 100644 --- a/addons/analytic/views/analytic_account_views.xml +++ b/addons/analytic/views/analytic_account_views.xml @@ -51,7 +51,7 @@ - + @@ -113,7 +113,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -232,7 +232,7 @@ - + diff --git a/addons/base_branch_company/demo/branch_data.xml b/addons/base_branch_company/demo/branch_data.xml index 449982bf..3f65ac15 100644 --- a/addons/base_branch_company/demo/branch_data.xml +++ b/addons/base_branch_company/demo/branch_data.xml @@ -3,7 +3,7 @@ - your company + Your Company YC 80 Broad St @@ -14,7 +14,6 @@ +1 485 123 8989 - diff --git a/addons/base_branch_company/views/res_branch_view.xml b/addons/base_branch_company/views/res_branch_view.xml index c7fb3aa3..3e2b8078 100644 --- a/addons/base_branch_company/views/res_branch_view.xml +++ b/addons/base_branch_company/views/res_branch_view.xml @@ -88,7 +88,7 @@ - + diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index 3edfb58b..b52bfd6a 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -89,7 +89,7 @@ - + @@ -493,7 +493,7 @@ - + @@ -652,7 +652,7 @@ - + diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 89bc736b..7d13142b 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -137,7 +137,7 @@ - + @@ -446,7 +446,7 @@ - + @@ -943,7 +943,7 @@

- +
diff --git a/addons/project_scrum/reports/release_planning_template.xml b/addons/project_scrum/reports/release_planning_template.xml index c1bc7f2d..54ee5000 100755 --- a/addons/project_scrum/reports/release_planning_template.xml +++ b/addons/project_scrum/reports/release_planning_template.xml @@ -50,7 +50,7 @@ Project Assigned To Sprint - Branch + Branch Start Date End Date Actual End Date @@ -71,7 +71,7 @@ - + diff --git a/addons/project_scrum/views/other_views.xml b/addons/project_scrum/views/other_views.xml index 149999f5..e2ad26fa 100755 --- a/addons/project_scrum/views/other_views.xml +++ b/addons/project_scrum/views/other_views.xml @@ -13,7 +13,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -123,7 +123,7 @@ - + diff --git a/addons/project_scrum/views/project_sprint_views.xml b/addons/project_scrum/views/project_sprint_views.xml index 3384ef5b..23f1a650 100755 --- a/addons/project_scrum/views/project_sprint_views.xml +++ b/addons/project_scrum/views/project_sprint_views.xml @@ -67,7 +67,7 @@ attrs="{'readonly': [('state', '!=', 'draft')]}"/> - - + @@ -151,7 +151,7 @@ - + - diff --git a/addons/project_scrum/views/project_story_views.xml b/addons/project_scrum/views/project_story_views.xml index 3eefe0e6..b5cdfd84 100755 --- a/addons/project_scrum/views/project_story_views.xml +++ b/addons/project_scrum/views/project_story_views.xml @@ -24,7 +24,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -69,7 +69,7 @@ - + diff --git a/addons/project_scrum/views/project_team_views.xml b/addons/project_scrum/views/project_team_views.xml index 922db188..a7ad0293 100755 --- a/addons/project_scrum/views/project_team_views.xml +++ b/addons/project_scrum/views/project_team_views.xml @@ -16,7 +16,7 @@ - + @@ -41,7 +41,7 @@ - + diff --git a/addons/project_scrum/views/release_planning_views.xml b/addons/project_scrum/views/release_planning_views.xml index 07bda89d..9e4281fa 100755 --- a/addons/project_scrum/views/release_planning_views.xml +++ b/addons/project_scrum/views/release_planning_views.xml @@ -10,7 +10,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/addons/project_scrum/views/retrospective_views.xml b/addons/project_scrum/views/retrospective_views.xml index 03bd2041..01d1c16b 100755 --- a/addons/project_scrum/views/retrospective_views.xml +++ b/addons/project_scrum/views/retrospective_views.xml @@ -16,7 +16,7 @@ - + @@ -41,7 +41,7 @@ - + diff --git a/addons/purchase/report/purchase_order_templates.xml b/addons/purchase/report/purchase_order_templates.xml index 5990449c..d1b965f5 100644 --- a/addons/purchase/report/purchase_order_templates.xml +++ b/addons/purchase/report/purchase_order_templates.xml @@ -42,7 +42,7 @@ Order Date:

-

+
Branch:

diff --git a/addons/purchase/report/purchase_quotation_templates.xml b/addons/purchase/report/purchase_quotation_templates.xml index 28839a73..957d944e 100644 --- a/addons/purchase/report/purchase_quotation_templates.xml +++ b/addons/purchase/report/purchase_quotation_templates.xml @@ -27,7 +27,7 @@
-
+
Branch:

diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml index f8236770..0dea4c3e 100644 --- a/addons/purchase/views/purchase_views.xml +++ b/addons/purchase/views/purchase_views.xml @@ -284,7 +284,7 @@ - + @@ -390,7 +390,7 @@ - + diff --git a/addons/sale/report/sale_report_templates.xml b/addons/sale/report/sale_report_templates.xml index 566fff4f..6c0f3230 100644 --- a/addons/sale/report/sale_report_templates.xml +++ b/addons/sale/report/sale_report_templates.xml @@ -60,7 +60,7 @@ Payment Terms:

-
+
Branch:

diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml index 620e5aca..4b6a68bc 100644 --- a/addons/sale/views/sale_views.xml +++ b/addons/sale/views/sale_views.xml @@ -381,7 +381,7 @@ - + diff --git a/addons/stock/report/report_deliveryslip.xml b/addons/stock/report/report_deliveryslip.xml index 1de1244f..477fe778 100644 --- a/addons/stock/report/report_deliveryslip.xml +++ b/addons/stock/report/report_deliveryslip.xml @@ -31,7 +31,7 @@ Date - Branch + Branch @@ -47,7 +47,7 @@ - + diff --git a/addons/stock/report/report_stockinventory.xml b/addons/stock/report/report_stockinventory.xml index d0d65880..fc97fc15 100644 --- a/addons/stock/report/report_stockinventory.xml +++ b/addons/stock/report/report_stockinventory.xml @@ -13,7 +13,7 @@ Inventory Date - Branch + Branch @@ -24,7 +24,7 @@ - + diff --git a/addons/stock/report/report_stockpicking_operations.xml b/addons/stock/report/report_stockpicking_operations.xml index e259d1d3..14f060d0 100644 --- a/addons/stock/report/report_stockpicking_operations.xml +++ b/addons/stock/report/report_stockpicking_operations.xml @@ -51,7 +51,7 @@ State Commitment Date Scheduled Date - Branch + Branch @@ -68,7 +68,7 @@ - + diff --git a/addons/stock/views/stock_inventory_views.xml b/addons/stock/views/stock_inventory_views.xml index 248031ee..b743879c 100644 --- a/addons/stock/views/stock_inventory_views.xml +++ b/addons/stock/views/stock_inventory_views.xml @@ -140,7 +140,7 @@ - + diff --git a/addons/stock/views/stock_location_views.xml b/addons/stock/views/stock_location_views.xml index 7eb3d0fa..b033ab32 100644 --- a/addons/stock/views/stock_location_views.xml +++ b/addons/stock/views/stock_location_views.xml @@ -36,7 +36,7 @@ - + diff --git a/addons/stock/views/stock_move_views.xml b/addons/stock/views/stock_move_views.xml index 8d6fb208..24321c38 100644 --- a/addons/stock/views/stock_move_views.xml +++ b/addons/stock/views/stock_move_views.xml @@ -12,7 +12,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -116,7 +116,7 @@ - + @@ -224,7 +224,7 @@ - + diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml index 73aad012..1872f137 100644 --- a/addons/stock/views/stock_picking_views.xml +++ b/addons/stock/views/stock_picking_views.xml @@ -319,7 +319,7 @@ - + diff --git a/addons/stock/views/stock_quant_views.xml b/addons/stock/views/stock_quant_views.xml index 47c17565..fcd05c2f 100644 --- a/addons/stock/views/stock_quant_views.xml +++ b/addons/stock/views/stock_quant_views.xml @@ -48,7 +48,7 @@ - + diff --git a/addons/stock/views/stock_scrap_views.xml b/addons/stock/views/stock_scrap_views.xml index e60d7d7e..fcd61f6d 100644 --- a/addons/stock/views/stock_scrap_views.xml +++ b/addons/stock/views/stock_scrap_views.xml @@ -52,7 +52,7 @@
- + diff --git a/addons/stock/views/stock_warehouse_views.xml b/addons/stock/views/stock_warehouse_views.xml index 8b7616d2..aeb831e5 100644 --- a/addons/stock/views/stock_warehouse_views.xml +++ b/addons/stock/views/stock_warehouse_views.xml @@ -26,7 +26,7 @@ - + From 9b7034a258270a7be068a7af2b495f46bdb0f904 Mon Sep 17 00:00:00 2001 From: Haresh Chavda Date: Tue, 23 Jan 2018 12:50:05 +0530 Subject: [PATCH 3/3] [IMP] Mail test cases --- addons/mail/tests/test_mail_features.py | 2 +- addons/mail/tests/test_mail_gateway.py | 14 +++++++------- addons/mail/tests/test_mail_message.py | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/mail/tests/test_mail_features.py b/addons/mail/tests/test_mail_features.py index c5dfa8ad..47b5d1bf 100644 --- a/addons/mail/tests/test_mail_features.py +++ b/addons/mail/tests/test_mail_features.py @@ -180,7 +180,7 @@ class TestMessagePost(TestMail): self.assertEqual(msg.parent_id.id, parent_msg.id) self.assertEqual(msg.partner_ids, self.partner_1) # self.assertEqual(parent_msg.partner_ids, self.partner_1) # TDE FIXME: to check - self.assertTrue(all('openerp-%d-mail.test' % self.test_pigs.id in m['references'] for m in self._mails)) + self.assertTrue(all('flectra-%d-mail.test' % self.test_pigs.id in m['references'] for m in self._mails)) new_msg = self.test_pigs.sudo(self.user_employee).message_post( body=_body, subject=_subject, message_type='comment', subtype='mt_comment', parent_id=msg.id) diff --git a/addons/mail/tests/test_mail_gateway.py b/addons/mail/tests/test_mail_gateway.py index 92767c25..3fffe9a9 100644 --- a/addons/mail/tests/test_mail_gateway.py +++ b/addons/mail/tests/test_mail_gateway.py @@ -51,7 +51,7 @@ Content-Transfer-Encoding: quoted-printable MAIL_TEMPLATE_PLAINTEXT = """Return-Path: To: {to} -Received: by mail1.openerp.com (Postfix, from userid 10002) +Received: by mail1.flectra.com (Postfix, from userid 10002) id 5DF9ABFB2A; Fri, 10 Aug 2012 16:16:39 +0200 (CEST) From: Sylvie Lelitre Subject: {subject} @@ -78,7 +78,7 @@ X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from mail-ie0-f173.google.com (mail-ie0-f173.google.com [209.85.223.173]) by mail1.grosbedon.com (Postfix) with ESMTPS id 9BBD7BFAAA - for ; Fri, 23 Aug 2013 13:17:55 +0200 (CEST) + for ; Fri, 23 Aug 2013 13:17:55 +0200 (CEST) Received: by mail-ie0-f173.google.com with SMTP id qd12so575130ieb.4 for ; Fri, 23 Aug 2013 04:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; @@ -327,7 +327,7 @@ class TestMailgateway(TestMail): 'subject': 'Public Discussion', 'message_type': 'email', 'author_id': self.partner_1.id, - 'message_id': '<123456-openerp-%s-mail.test@%s>' % (self.test_public.id, socket.gethostname()), + 'message_id': '<123456-flectra-%s-mail.test@%s>' % (self.test_public.id, socket.gethostname()), }) @mute_logger('flectra.addons.mail.models.mail_thread') @@ -608,7 +608,7 @@ class TestMailgateway(TestMail): self.format_and_process, MAIL_TEMPLATE, email_from='valid.lelitre@agrolait.com', to='noone@example.com', subject='spam', - extra='In-Reply-To: <12321321-openerp-%d-mail.test@%s>' % (self.test_public.id, socket.gethostname()), + extra='In-Reply-To: <12321321-flectra-%d-mail.test@%s>' % (self.test_public.id, socket.gethostname()), msg_id='<1198923581.41972151344608186802.JavaMail.diff1@agrolait.com>') # when 6.1 messages are present, compat mode is available @@ -621,7 +621,7 @@ class TestMailgateway(TestMail): MAIL_TEMPLATE, email_from='other5@gmail.com', msg_id='<1.2.JavaMail.new@agrolait.com>', to='noone@example.com>', subject='spam', - extra='In-Reply-To: <12321321-openerp-%d-mail.test@%s>' % (self.test_public.id, socket.gethostname())) + extra='In-Reply-To: <12321321-flectra-%d-mail.test@%s>' % (self.test_public.id, socket.gethostname())) # 3''. 6.1 compat mode should not work if hostname does not match! # Flectra 10 update: compat mode has been removed and should not work anymore and does not depend from hostname @@ -630,7 +630,7 @@ class TestMailgateway(TestMail): MAIL_TEMPLATE, email_from='other5@gmail.com', msg_id='<1.3.JavaMail.new@agrolait.com>', to='noone@example.com>', subject='spam', - extra='In-Reply-To: <12321321-openerp-%d-mail.test@neighbor.com>' % self.test_public.id) + extra='In-Reply-To: <12321321-flectra-%d-mail.test@neighbor.com>' % self.test_public.id) # Test created messages self.assertEqual(len(self.test_public.message_ids), 1) @@ -740,7 +740,7 @@ class TestMailgateway(TestMail): self.assertEqual(msg.model, False, 'message_post: private discussion: context key "thread_model" not correctly ignored when having no res_id') # Test: message-id - self.assertIn('openerp-private', msg.message_id, 'message_post: private discussion: message-id should contain the private keyword') + self.assertIn('flectra-private', msg.message_id, 'message_post: private discussion: message-id should contain the private keyword') # Do: Bert replies through mailgateway (is a customer) self.format_and_process( diff --git a/addons/mail/tests/test_mail_message.py b/addons/mail/tests/test_mail_message.py index 3622d7c6..5a70b97a 100644 --- a/addons/mail/tests/test_mail_message.py +++ b/addons/mail/tests/test_mail_message.py @@ -57,7 +57,7 @@ class TestMailMessage(TestMail): 'model': 'mail.test', 'res_id': self.test_pigs.id }) - self.assertIn('-openerp-%d-mail.test' % self.test_pigs.id, msg.message_id, 'mail_message: message_id for a void message should be a "private" one') + self.assertIn('-flectra-%d-mail.test' % self.test_pigs.id, msg.message_id, 'mail_message: message_id for a void message should be a "private" one') self.assertEqual(msg.reply_to, '%s <%s>' % (self.user_employee.name, self.user_employee.email)) self.assertEqual(msg.email_from, '%s <%s>' % (self.user_employee.name, self.user_employee.email)) @@ -70,7 +70,7 @@ class TestMailMessage(TestMail): 'model': 'mail.test', 'res_id': self.test_pigs.id }) - self.assertIn('-openerp-%d-mail.test' % self.test_pigs.id, msg.message_id, 'mail_message: message_id for a void message should be a "private" one') + self.assertIn('-flectra-%d-mail.test' % self.test_pigs.id, msg.message_id, 'mail_message: message_id for a void message should be a "private" one') self.assertEqual(msg.reply_to, '%s %s <%s@%s>' % (self.env.user.company_id.name, self.test_pigs.name, self.test_pigs.alias_name, alias_domain)) self.assertEqual(msg.email_from, '%s <%s>' % (self.user_employee.name, self.user_employee.email)) @@ -84,7 +84,7 @@ class TestMailMessage(TestMail): 'model': 'mail.test', 'res_id': self.test_pigs.id }) - self.assertIn('-openerp-%d-mail.test' % self.test_pigs.id, msg.message_id, 'mail_message: message_id for a void message should be a "private" one') + self.assertIn('-flectra-%d-mail.test' % self.test_pigs.id, msg.message_id, 'mail_message: message_id for a void message should be a "private" one') self.assertEqual(msg.reply_to, '%s %s <%s@%s>' % (self.env.user.company_id.name, self.test_pigs.name, self.test_pigs.alias_name, alias_domain)) self.assertEqual(msg.email_from, '%s <%s>' % (self.user_employee.name, self.user_employee.email))