From 5fb732bf91d3fd9019444589138b1eea0420c004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 29 Mar 2017 10:48:53 +0200 Subject: [PATCH 1/4] [REV] revert commit 0f17d3a348b602f62409e49fdbf925cc799f44d1 Indeed this causes issues for people installing issue with project having been installed before that commit. ChsNote: Do not forward-port. --- addons/project/views/project_views.xml | 12 ------------ addons/project_issue/views/project_issue_views.xml | 4 ---- 2 files changed, 16 deletions(-) diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index eeba7d224cc..08f3b80c8c7 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -631,18 +631,6 @@ action = model.activate_sample_project() action="project_task_action_activity" sequence="25"/> - - - Activity Types - mail.activity.type - form - tree,form - ['|', ('res_model_id', '=', False), ('res_model_id.model', '=', 'project.task')] - - - Overpassed Tasks project.task diff --git a/addons/project_issue/views/project_issue_views.xml b/addons/project_issue/views/project_issue_views.xml index 78e04595e22..5eb5e5b7170 100644 --- a/addons/project_issue/views/project_issue_views.xml +++ b/addons/project_issue/views/project_issue_views.xml @@ -372,8 +372,4 @@ parent="project.menu_project_management" action="project_issue_action_activity" sequence="25"/> - - - ['|', ('res_model_id', '=', False), ('res_model_id.model', 'in', ['project.task', 'project.issue'])] - From c168830b663fa0696d2010484a4a92baf47d2b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 29 Mar 2017 10:49:36 +0200 Subject: [PATCH 2/4] [REV] revert commit 83e8ae43b09256609567a00677fe0de8422417cc Indeed people installing modules depending on sales team with sales team not being updated before that commit. ChsNote: Do not forward-port. --- addons/crm/views/crm_team_views.xml | 4 ---- addons/sale/views/sales_team_views.xml | 4 ---- addons/sale_crm/views/crm_lead_views.xml | 4 ---- addons/sales_team/views/crm_team_views.xml | 13 ------------- 4 files changed, 25 deletions(-) diff --git a/addons/crm/views/crm_team_views.xml b/addons/crm/views/crm_team_views.xml index 23698ecc36c..7b007b8a531 100644 --- a/addons/crm/views/crm_team_views.xml +++ b/addons/crm/views/crm_team_views.xml @@ -242,8 +242,4 @@ - - ['|', ('res_model_id', '=', False), ('res_model_id.model', 'in', ['crm.lead', 'res.partner'])] - - diff --git a/addons/sale/views/sales_team_views.xml b/addons/sale/views/sales_team_views.xml index c1fec1d76d4..b10d6b55764 100644 --- a/addons/sale/views/sales_team_views.xml +++ b/addons/sale/views/sales_team_views.xml @@ -137,8 +137,4 @@ - - ['|', ('res_model_id', '=', False), ('res_model_id.model', 'in', ['sale.order', 'res.partner', 'product.template', 'product.product'])] - - diff --git a/addons/sale_crm/views/crm_lead_views.xml b/addons/sale_crm/views/crm_lead_views.xml index 2f3f7883fe7..a85f89b796a 100644 --- a/addons/sale_crm/views/crm_lead_views.xml +++ b/addons/sale_crm/views/crm_lead_views.xml @@ -45,8 +45,4 @@ {'default_type': 'opportunity', 'default_user_id': uid, 'needaction_menu_ref': 'sale.menu_sale_quotations'} - - ['|', ('res_model_id', '=', False), ('res_model_id.model', 'in', ['crm.lead', 'sale.order', 'res.partner', 'product.template', 'product.product'])] - - diff --git a/addons/sales_team/views/crm_team_views.xml b/addons/sales_team/views/crm_team_views.xml index cab20d5b5fc..a6deb5ac49d 100644 --- a/addons/sales_team/views/crm_team_views.xml +++ b/addons/sales_team/views/crm_team_views.xml @@ -196,18 +196,5 @@ parent="sales_team.menu_sale_config" action="sales_team_config_action"/> - - Activity Types - mail.activity.type - form - tree,form - ['|', ('res_model_id', '=', False), ('res_model_id.model', '=', 'res.partner')] - - - From c04dfec0234f9464d70418005a4a4190bb0dee53 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 29 Mar 2017 12:26:11 +0200 Subject: [PATCH 3/4] [FIX] web: make the domain field a "block" field The domain field needs space to be rendered. Even with its "in_dialog" option activated, the readonly representation can take some space. If there is not enough space, it will be a mess to read it and the "-> x records" button can also overflow the "Add filter" button. This commit makes the field to be rendered as a "block", which fixes the problem in all current cases. --- addons/web/static/src/less/form_view_layout.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/less/form_view_layout.less b/addons/web/static/src/less/form_view_layout.less index 7e108b6af2c..111805c7325 100644 --- a/addons/web/static/src/less/form_view_layout.less +++ b/addons/web/static/src/less/form_view_layout.less @@ -162,7 +162,7 @@ } // Block fields - .note-editor, .oe_form_field_html, .oe_form_field_html_text, .oe_form_field_text, .o_view_manager_content { + .note-editor, .oe_form_field_html, .oe_form_field_html_text, .oe_form_field_text, .o_view_manager_content, .o_form_field_domain { display: block; } From 0ff9af64ef5d64f3f3a9bdce072f925b8e93f2a5 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 29 Mar 2017 12:11:48 +0200 Subject: [PATCH 4/4] [FIX] hr_expense: Creation of entries from several expense lines When posting journal entries for an hr.expense.sheet with several expense lines (by clicking on the button "Post journal entries"), all the account move lines created for the same sheet must be linked to the same account move because the model hr.expense.sheet has just a field "account_move_id" to access all the entries (by clicking on button "Accounting Entries") This commit reverts f97eb0ac2b38d4efacb156bdd9e4ed499d2834c5 opw:715523,709930,725798,716239 --- addons/hr_expense/models/hr_expense.py | 29 +++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 11a9e35ff1b..261eb577461 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -172,24 +172,19 @@ class HrExpense(models.Model): ''' main function that is called when trying to create the accounting entries related to an expense ''' - move_group_by_sheet = {} for expense in self: journal = expense.sheet_id.bank_journal_id if expense.payment_mode == 'company_account' else expense.sheet_id.journal_id #create the move that will contain the accounting entries acc_date = expense.sheet_id.accounting_date or expense.date - if not expense.sheet_id.id in move_group_by_sheet: - move = self.env['account.move'].create({ - 'journal_id': journal.id, - 'company_id': self.env.user.company_id.id, - 'date': acc_date, - 'ref': expense.sheet_id.name, - # force the name to the default value, to avoid an eventual 'default_name' in the context - # to set it to '' which cause no number to be given to the account.move when posted. - 'name': '/', - }) - move_group_by_sheet[expense.sheet_id.id] = move - else: - move = move_group_by_sheet[expense.sheet_id.id] + move = self.env['account.move'].create({ + 'journal_id': journal.id, + 'company_id': self.env.user.company_id.id, + 'date': acc_date, + 'ref': expense.sheet_id.name, + # force the name to the default value, to avoid an eventual 'default_name' in the context + # to set it to '' which cause no number to be given to the account.move when posted. + 'name': '/', + }) company_currency = expense.company_id.currency_id diff_currency_p = expense.currency_id != company_currency #one account.move.line per expense (+taxes..) @@ -240,10 +235,9 @@ class HrExpense(models.Model): lines = map(lambda x: (0, 0, expense._prepare_move_line(x)), move_lines) move.with_context(dont_create_taxes=True).write({'line_ids': lines}) expense.sheet_id.write({'account_move_id': move.id}) + move.post() if expense.payment_mode == 'company_account': expense.sheet_id.paid_expense_sheets() - for move in move_group_by_sheet.values(): - move.post() return True @api.multi @@ -540,6 +534,7 @@ class HrExpenseSheet(models.Model): @api.multi def action_open_journal_entries(self): res = self.env['ir.actions.act_window'].for_xml_id('account', 'action_move_journal_line') - res['domain'] = [('id', 'in', self.mapped('account_move_id').ids)] + #DO NOT FORWARD-PORT + res['domain'] = [('ref', 'in', self.mapped('name'))] res['context'] = {} return res