Skip to content
Snippets Groups Projects
  1. Jun 27, 2019
  2. Jun 26, 2019
  3. Jun 20, 2019
    • Christophe Simonis's avatar
    • Christophe Simonis's avatar
      a7ad19d7
    • Christophe Simonis's avatar
      [IMP] core: add support for multi-version migration scripts · 7b16abba
      Christophe Simonis authored
      
      A special folder named `0.0.0` can contain scripts that are run on
      upgrade of any version.
      They are useful to make some sanity checks or other verifications to
      ensure database consistency.
      
      The first version of this patch used the more eye-catching `any` for
      the migration folder, but it was problematic for upgrading from an older
      version that doesn't contain this patch.
      
      Using a version "number" containing two dots is required to avoid it
      being prefixed with the server version (see `convert_version` method) and
      resulting in a version like `10.0.any`.
      Such version would have been executed, even without this patch, when
      upgrading from an older major server version (9.0.1.0 < 10.0.any).
      
      closes odoo/odoo#34268
      
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      7b16abba
    • Nicolas Martinelli's avatar
      [FIX] point_of_sale: apply fiscal position · ea4ddff1
      Nicolas Martinelli authored
      
      - Create 2 included taxes: 21 % and 6 %
      - Create a product A with 21 % as default tax
      - Create a fiscal position to map the tax 21 % to tax 6 %
      - Allow the fiscal position in the POS
      - Add product in a POS order
      - Apply the fiscal position
      
      The subtotal is not recomputed correctly. On the other hand, if the
      fiscal is first set then the product added, there is no problem.
      
      This is because the `fix_tax_included_price` is only called by
      `add_product` and not when changing the fiscal position.
      
      opw-2020755
      
      closes odoo/odoo#34260
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      ea4ddff1
  4. Jun 19, 2019
    • Xavier Morel's avatar
      [FIX] core: work around ir_logging deadlock · c5c955db
      Xavier Morel authored
      
      DROP CONSTRAINT (even with IF EXISTS is specified) acquires an ACCESS
      EXCLUSIVE lock on the table, preventing e.g. inserts in an other
      transaction, so ir_logging would systematically deadlock if configured
      to the same database and a warning would be triggered during install
      or update (if that ran ir.logging's init).
      
      1. hand-roll the "IF EXISTS" bit, to avoid taking an ACCESS EXCLUSIVE
      lock on the table if the problematic constraint does not exist and
      thus doesn't need to be dropped (which by now should be the vast
      majority of cases).
      
      Replacing DROP CONSTRAINT with DISABLE TRIGGER does not fix the
      issue as *that* acquires SHARE ROW EXCLUSIVE. While that's less
      constraitning than ACCESS EXCLUSIVE, it still conflicts with an
      insert's ROW_EXCLUSIVE.
      
      2. add a timeout to the logging INSERT anyway, the deadlock is still
      an issue if we're updating a database which does have the
      problematic constraint, and we want to preclude the possible
      eventual introduction of new deadlocks in the future.
      
      closes odoo/odoo#34243
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      c5c955db
  5. Jun 18, 2019
  6. Jun 17, 2019
  7. Jun 13, 2019
  8. Jun 12, 2019
  9. Jun 07, 2019
  10. Jun 06, 2019
    • Rishabh Jadia's avatar
      [FIX] base: prevent renaming the column for non stored field · 7746621b
      Rishabh Jadia authored
      
      Before this task, when creating the related field from the studio, it is by
      default stored. When we change the field name in 'ir.model.fields' using ORM's
      write method, it also renames the column in the table associated with the
      field's model.
      
      This is the expected behavior. But when someone tries to change the 'name' of a
      non stored field, the column is not available in the associated model, and so
      trying to rename the column results into traceback. This issue was probably
      there for a while but came into light with the task 1985710. More info can
      be found on the chatter of the task.
      
      This commit fixes the issue by adding an extra check before renaming the table
      column. The query will be executed only when the field is stored and thus
      exists in the table.
      
      closes odoo/odoo#33944
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      7746621b
    • Nicolas Martinelli's avatar
      [IMP] account: constraint error message · f7b870ca
      Nicolas Martinelli authored
      
      Make SQL constraints errors more accurate.
      
      closes odoo/odoo#33934
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      f7b870ca
    • Mahendra Barad's avatar
      [FIX] base: avoid traceback on params field of client action · ef7ae9ae
      Mahendra Barad authored
      
      The content of these fields can't be updated, there's no reason to
      even show them. Just remove them from the default / auto-generated
      view for client actions.
      
      Task 1772242
      
      closes odoo/odoo#29179
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      ef7ae9ae
  11. Jun 05, 2019
  12. Jun 04, 2019
  13. Jun 03, 2019
  14. May 30, 2019
    • Christophe Monniez's avatar
      [MOV] test_pylint, test_lint: add es-check linter · b27077bb
      Christophe Monniez authored
      Because Odoo still supports Android Kitkat and Internet Explorer, ES5 is
      the highest ECMAScript allowed version.
      
      This commit adds a new test that parses each javascript file found in
      addons. The test fails if unsupported js code is found.  As ES6 is
      allowed during tests, the files under a path that contains 'static/test'
      are just skipped.
      
      This test uses the es-check tool
      (https://www.npmjs.com/package/es-check
      
      ).
      
      If the es-check tool cannot be found, the test is simply skipped.
      
      Also the test_pylint module is renamed to a more generic name test_lint,
      that way, every linter test can find a shelter  here.
      
      closes odoo/odoo#33724
      
      Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
      b27077bb
  15. Jun 03, 2019
    • Priyanka Kakadiya's avatar
      [FIX] web_editor: restoreRange on invalid node · d8545180
      Priyanka Kakadiya authored
      
      In a web editor, add some text, select the text, add a link and
      immediately discard the link modal. Traceback.
      
      The traceback is a execute `setEnd` on `Range`, that error is thrown
      because editable DIV doesn't save old range
      
      Odoo wrap code does some text node split in order to attach the link
      just on the selected text. If it correctly re-set the underlying
      structure, it does not update the $(editable) structure used to restore
      ranges.
      
      After this commit, editable div will use newly created range for the element
      
      for ex:
      -> content: test
      -> selected content "test"
      
      when click on link dialog:
      ec: test , eo: 4, sc: test, so: 0
      selected content  ->  start 0, end 4 -> "test" like this
      
      after clicking on discard:
      ec: null text element, eo: 4, sc: null text element, so: 0
      selected content  ->  ec and sc both are null, so it will throw an error
      while setting cursor position
      
      after applying fix when click on discard:
      ec: test, eo: 4, sc: test, so: 0
      selected content -> start 0,  end 4 -> "test"
      
      task - 1955863
      
      closes odoo/odoo#33792
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      d8545180
  16. May 28, 2019
  17. May 27, 2019
Loading