Skip to content
Snippets Groups Projects
  1. Jun 12, 2019
  2. Jun 07, 2019
    • Lucas Lefèvre's avatar
      [FIX] hr_holidays: Display approve button when needed · 92d04194
      Lucas Lefèvre authored
      
      This commit reverts commit 492764c5
      
      *Note for forward port*
      This commit will conflict with 76ee0afb. Keep this version.
      
      TL;DR: the fix had unintended effects and the original problem has been
      fixed by b5c20041 in the mean time.
      
      Why the original commit?
      ------------------------
      To know if the current user has the rights to approve/delete a leave,
      two boolean fields are computed (respectively `can_approve`
      and `can_reset`). Associated buttons are shown in the form view according to
      the field values.
      In the compute methods, the `check_approval_update(state)` method is called.
      This method checks various conditions, including `ir.rules` by calling the ORM
      method `self.check_access_rule('write')`. If one condition or one `ir.rule`
      is not met, an Error is raised.
      
      If the method raises, the user does not have the rights.
      The exception is catched and the field `can_approve|reset` is set to False.
      
      However, an unexpected behaviour happens when fields are re-computed
      in the context of an onchange. In an onchange, `self.ids` is an empty list.
      When checking ir.rules, the `_filter_access_rules()` method is used
      to retrieve valid records in self by checking every record against ir.rules.
      If some records are not in the valid set, they are considered invalid and an
      exception is raised.
      But because self.ids is empty, no record is actually checked and therefore
      no record is valid.
      => in an onchange it always raises an AccessError and the users is considered
      as not having the rights to approve nor refuse a leave as soon as an
      onchange has been triggered. Thus associated buttons does not appear.
      
      The original commit fixed the problem by preventing checking the rules
      when in an onchange.
      
      In the mean time, the root cause of the problem has been fixed by b5c20041.
      
      Why revert?
      -----------
      While commit 492764c5 allowed HR users and Team leaders to approve
      after an onchange, it had the unintended effect to
      show the "Approve" and "Refuse" buttons to other users.
      In summary:
      
      - With commit 492764c5: buttons are shown more than necessary
      (which is confusing to users who don't actually the rights
      to approve)
      
      - Without: Thanks to b5c20041, the original problem no longer exists.
      Users with access rights always see buttons. Users without never see
      buttons.
      
      closes odoo/odoo#33894
      
      Signed-off-by: default avatarRomain Libert (rli) <rli@odoo.com>
      92d04194
  3. Jun 05, 2019
  4. Jun 03, 2019
  5. Jun 06, 2019
    • Kaushalya Mandaliya's avatar
      [FIX] im_livechat: correctly display known partner name · 7a3a1a43
      Kaushalya Mandaliya authored
      
      When talking via the Live Chat to a known partner, should be able to see
      his name in the chat window title, from the commit: c04b9c01
      the partner name wasn't showing in the title as sudo is being used.
      
      After this commit, known partner name will be shown in the
      Live Chat window title.
      
      And improving a test case, in which we're checking for the known partner's
      name in the chat window title.
      
      task-1940407
      
      closes odoo/odoo#33831
      
      Signed-off-by: default avatarMartin Geubelle (mge) <mge@openerp.com>
      7a3a1a43
  6. Jun 05, 2019
  7. Jun 04, 2019
  8. Jun 03, 2019
  9. May 31, 2019
  10. May 29, 2019
  11. May 31, 2019
  12. May 29, 2019
  13. May 27, 2019
  14. May 29, 2019
  15. May 28, 2019
  16. May 29, 2019
  17. May 28, 2019
    • Nans Lefebvre's avatar
      [FIX] mail: fix mail template onchange · c52b9dfc
      Nans Lefebvre authored
      
      The stable behaviour of the mail composer is the following:
      - if a template adds new attachments, the composer only has this list
      - if a template doesn't add attachments, the list is unchanged
      - if no template is set, the list is cleared up
      In the case of templates, we also check that both static and dynamic attachments
      are added to the list.
      
      We clean up after c6d718f2 and subsequently 516f22c3 which failed to take
      into account the fact that the attachement list could be a blend of commands
      and ids.
      Transforming that is taken care of by _convert_to_write, which semantics was
      changed by c6d718f2.
      To keep the second behaviour, we thus need to add a (5,) command.
      
      opw 2003197
      
      closes odoo/odoo#33707
      
      Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
      c52b9dfc
Loading