Skip to content
Snippets Groups Projects
  1. Oct 23, 2019
  2. Oct 22, 2019
  3. Oct 23, 2019
  4. Oct 22, 2019
    • qsm-odoo's avatar
      [FIX] website: solve asynchronous action demands in the editor · 7f60eaa2
      qsm-odoo authored
      
      Since saas-12.3, deferred actions use native promises. This has the
      annoying side-effect of force-deferring promises even if they are
      resolved at once... and we relied on the opposite behavior for some
      call made in _setActive or option methods.
      
      In master, we should review the async logic of snippet options. Right
      now we will rely on the fact those promises are resolved at once but
      that we need to avoid for their "async part" anyway. The _setActive
      method and the option methods are thus still working synchronously in
      stable, despite the new force-deferring promises.
      
      Also, with old promises, when we waited for the resolution of multiple
      deferred, the resolve handler received the multiple results as
      individual arguments. Now it receives all the results in an array as
      a single argument. The resolution of action demands had to be adapted.
      
      closes odoo/odoo#39171
      
      X-original-commit: 30d15315
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      7f60eaa2
    • Raphael Collet's avatar
      [FIX] fields: `compute_sudo` defaults to True for stored fields only · c8dca514
      Raphael Collet authored
      
      The default `compute_sudo=True` makes sense for recomputing stored
      fields that are indirectly related to a business operation.  This
      ensures that the recomputation of the field does not break an operation
      that is not aware of the fields to recompute.
      
      However, computing non-stored fields in superuser mode is usually not
      necessary.  It even leads to unexpected values: counting a partner's
      sales orders does not give the same result in superuser mode as in
      normal mode.  That is why non-stored fields are not computed in
      superuser mode by default.
      
      [FIX] account, delivery, event, hr_recruitment, point_of_sale, stock:
      adapt the model definition to make all fields with the same compute
      method have the same value for `compute_sudo`.
      
      [FIX] sale: split the computation of `invoice_ids`, `invoice_count`
      (non-stored) and `invoice_status` (stored), as no code is actually
      shared.
      
      closes odoo/odoo#39195
      
      X-original-commit: 843fd38a
      Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
      c8dca514
    • Raphael Collet's avatar
      [FIX] account: typo in field name · 5efd768b
      Raphael Collet authored
      
      closes odoo/odoo#39194
      
      X-original-commit: 9492b019
      Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
      5efd768b
    • Raphael Collet's avatar
      [FIX] hr_holidays: unknown field in tests · 41639cc8
      Raphael Collet authored
      X-original-commit: 2726976e
      41639cc8
    • Raphael Collet's avatar
      [FIX] models: using unknown fields makes CRUD methods crash · 93ecdce5
      Raphael Collet authored
      The basic ORM methods should not silently discard unknown fields, as
      they may be a sign of broken code.
      
      X-original-commit: 9595dd06
      93ecdce5
  5. Oct 23, 2019
  6. Oct 22, 2019
  7. Oct 18, 2019
    • Nans Lefebvre's avatar
      [FIX] fields, test_access_rights: get currency field in sudo · 5efa30c3
      Nans Lefebvre authored
      
      This commits fixes user duplication.
      
      Suppose there is a monetary field, with a currency_field that is a related.
      When going through model's _create, we do:
      `if field.type in ('one2many', 'many2many'):
          self.env.cache.set(record, field, ())`
      knowing that thse values are false, with the intent to clean them later:
      `for record, field in cachetoclear`
      However, when setting the scalar values, we go through:
      `accessing cache_value = field.convert_to_cache(value, record)`
      In the case of the monetary field, this depends on another field value
      (the currency_field). If it is a related, we can access its value.
      However, at this point, if we check any access rights, we might use the value
      of a relational in cache for which the value is incorrectly set to False.
      
      In the case of the user, this is what happens: it inherits its currency_id
      from partner, as well as its debit_limit which depends on it.
      When the access if checked, company_ids is set to False in cache.
      So when going through the rule 'user rule', which checks that the company_ids
      intersects with the env.companies.ids, the result is always False.
      
      In some way this is essentially hiding the problem, but the true fix is
      probably not feasible in stable.
      
      opw 2086661
      
      closes odoo/odoo#39017
      
      X-original-commit: aa05a935
      Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
      5efa30c3
  8. Oct 22, 2019
  9. Oct 21, 2019
  10. Oct 22, 2019
  11. Oct 16, 2019
  12. Oct 22, 2019
  13. Oct 17, 2019
  14. Oct 18, 2019
  15. Oct 17, 2019
Loading