Skip to content
Snippets Groups Projects
  1. Oct 20, 2020
    • Odoo's Mergebot's avatar
      [FIX] mass_mailing_sms: try to render jinja content when using test wizards · f997e673
      Odoo's Mergebot authored
      
      # Purpose
      
      The wizard to test a mailing does not compute the jinja part. It does
      not detect syntax errors that would make cron crash
      
      # Specifications
      
      If there is at least one record in the mailing model then render template
      completely. Thow an error if rendering cannot be done.
      
      The downside is that we cannot test the jinja part if there is not yet any
      record in the mailing's model.
      
      Do it for mass_mailing and mass_mailing_sms.
      
      Add tests to ensure error detection in test wizard effectively works.
      
      Task ID-2312442
      PR #55696
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      Unverified
      f997e673
    • Jérémy Hennecart's avatar
      [FIX] mass_mailing_sms: try to render jinja content when using test wizards · 7370d573
      Jérémy Hennecart authored
      Like the mass_mailing app we want to raise an error in case there is a syntax
      error with jinja when we test the mailing and if there is at least one record
      in the mailing model.
      
      PR odoo/odoo#55696
      Task ID-2312442
      7370d573
    • Jérémy Hennecart's avatar
      [FIX] mass_mailing: try to render jinja content when using test wizards · 92aef67c
      Jérémy Hennecart authored
      Before when a user clicked on the button "Test", jinja syntax was not taken
      into account for the test mail sent. If an error was present clicking on the
      button did not raise an error before the cron was executed.
      
      Now, if there is at least one record in the mailing model, the template is
      correctly rendered and throws an error if there is a syntax error.
      
      If we don't have any record to render the template, we fallback on the raw
      content like before.
      
      PR odoo/odoo#55696
      Task ID-2312442
      92aef67c
    • Jérémy Hennecart's avatar
      [FIX] test_mass_mailing: add test for the send_mail_test action · 183a7677
      Jérémy Hennecart authored
      This test ensures that when using the test sending tool of mass mailing (sms)
      a wrong jinja content is detected if we have any record available to evaluate
      it.
      
      PR odoo/odoo#55696
      Task ID-2312442
      183a7677
    • Nasreddin (bon)'s avatar
      [FIX] payment: User can pay without selecting a delivery method · 7e54d9aa
      Nasreddin (bon) authored
      
      Issue
      
      	- Install "eCommerce" and "Inventoy"
      	- Activate "Fedex" delivery connector in settings
      	- Publish "Free Delivery" and "Fedex US" delivery method
      	- Put the "FedEx" one above the "Free Delivery"
      	- Go to shop and add an item to cart
      	- Set an adress with no ZIP code and checkout
      	- Select a payment methode and pay
      
      	Order is generated without selecting a delivery method
      	Same behavior happend when using only "Fedex" as delivery
      	method.
      
      Cause
      
      	The flow make the `payment.payment_form` trigger start after
      	`website_sale_delivery.checkout` JS module.
      	In 'start' function of `payment.payment_form`, the `disabled`
      	attribut is removed from button if no checkbox_cgv is present
      	and therefore break the `disabling` managemet since
      	`disabledReasons` payButton data are not sync anymore.
      
      Solution
      
      	Remove 'disabled' attribut only if has `disabledReasons` data on
      	payButton (checkbox_cgv feature alter `disabledReasons`).
      
      opw-2355407
      opw-2357605
      
      closes odoo/odoo#60355
      
      X-original-commit: 04e589e8
      Signed-off-by: default avatarbon-odoo <nboulif@users.noreply.github.com>
      7e54d9aa
    • Benjamin Vray's avatar
      [FIX] web_editor: disable overlay pointer events on wheel event · 978cd024
      Benjamin Vray authored
      
      This commit disable the pointer events on the overlay during the mouse
      wheel event. To prevent page scrolling from stopping when hovering
      over the overlay.
      
      task-2312878
      
      closes odoo/odoo#60160
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      978cd024
  2. Oct 19, 2020
  3. Oct 20, 2020
  4. Oct 19, 2020
  5. Oct 20, 2020
    • Prakash Prajapati's avatar
      [IMP] hr_timesheet: chrome app icon should not be displayed on mobile · d288748d
      Prakash Prajapati authored
      
      The icon of the chrome app from the timesheet setting should not be
      displayed on mobile.
      
      closes odoo/odoo#59333
      
      Task-id: 2323254
      Related: odoo/enterprise#13615
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      d288748d
    • Laurent Mignon's avatar
      [FIX] core: Ensure that rollback hooks are called when the cursor is closed · 09bf7bd7
      Laurent Mignon authored
      
      Before this change the rollback hooks were never called since rollback() was never explicitely called by the framework. At the end of a transaction, if no error occurs the famework call commit() on the odoo cursor. In all cases, the transaction ends with a call to close(). Into the implementation of _close()  rollback() is called on the underlying connection to ensure that not committed changes are rollbacked. That's the reason why despite the fact that rollback() was not called on the Odoo cursor, changes are not committed into the db in case of exception. To keep the same behaviour and avoid to have to explicitely call rollback() on the odoo cursor to trigger the execution of registered rollback hooks, these hooks are now processed in _close(). Since the list of registered hooks is emptied if commit() is called, we are sure that rollback hooks are only executed in case of rollback.
      
      OPW #2294911
      
      closes odoo/odoo#60334
      
      X-original-commit: dce9a05f3a5d37fab711c8ca3c5444941f98e814
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      Co-authored-by: default avatarRaphael Collet <rco@odoo.com>
      09bf7bd7
    • Olivier Laurent's avatar
      [FIX] pad: permission issue on securized etherpad servers · 436a94c0
      Olivier Laurent authored
      
      If you want to prevent pad creation without the API key, you configure
      the etherpad server with the 'editOnly' parameter set to 'true'.
      In this case (copy/pasting the settings.json):
      * users may edit pads but not create new ones
      * pad creation is only via the API
      
      But if you secure your etherpad server like this, you won't be able to
      create pads in odoo in certain circonstances.
      
      This use case does not work (using 'pad_project'):
      * secure your etherpad server ("editOnly": true)
      * open the Project app and choose a project
      * open an already existing task (or create one)
      * from this task, click on the "Create" button to create a new task
      * the 'description' field displays: "You do not have permission to access this pad"
      * if you save, you'll get a traceback: "ValueError: padID does not
        exist"
      
      The same issue arise if you create a task from the list (not kanban)
      view.
      If you create a task directly from the kanban view, there is no
      problem because there is an 'object_id' in the context dict.
      
      closes odoo/odoo#60324
      
      X-original-commit: 8ffc00fb
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      436a94c0
    • Olivier Laurent's avatar
      [CLA] Logicasoft · f88a5bad
      Olivier Laurent authored
      X-original-commit: 69c551f6
      f88a5bad
    • Achraf (abz)'s avatar
      [FIX] board: Custom name not shown · 933ef22e
      Achraf (abz) authored
      
      Issue
      
          - Install 'Dashboard'
          - Try to add something to the dashboard via 'Add to my dashboard'
          - Enter custom name
          - Click on 'Add'
      
      Cause
      
          The name of the action was taken instead the input content
      
      Solution
      
          Take the input content
      
      opw-2363000
      
      closes odoo/odoo#60240
      
      Signed-off-by: default avatarAnh Thao PHAM <kitan191@users.noreply.github.com>
      933ef22e
  6. Oct 19, 2020
  7. Oct 15, 2020
    • Herbert Riess's avatar
      [FIX] base: reference attach, not self in _compute_raw() · 160043a4
      Herbert Riess authored
      
      Current behavior:
      call to _file_read() within "for attach in self:" loop references self
      rather than attach
      
      Expected behavior:
      execute _file_read() individually for every record in self (via "for
      attach in self:" loop)
      
      This is not an issue in standard where _file_read is an api.model
      method but in case of overwrite (e.g. issue reported at
      odoo/odoo#60016 has implemented an AWS integration) it makes sense
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      160043a4
  8. Oct 20, 2020
  9. Oct 16, 2020
  10. Oct 19, 2020
    • Nicolas Galler's avatar
      [FIX] account: use commercial partner id for auto computed lines · 32841c89
      Nicolas Galler authored
      
      Behavior before the fix:
      
      - if you create a sales order for a customer invoice address (a child
      partner record), then create the invoice for that order, the partner_id
      is not consistent between the move_line (some get the child partner id,
      some get the commercial partner id = the parent partner id)
      - if you create the invoice directly from the accounting app for a
      child partner, the commercial partner id is used consistently for all
      move lines (the invoice itself keeps the child partner id)
      
      Behavior after the fix:
      
      - when an invoice is created from a sales order, the partner id is set
      using the commercial partner id, consistently for all lines (in this way
      the behavior is consistent with that of the accounting app)
      
      It is more appropriate to use the commercial_partner_id for this purpose
      as it is used pretty consistently in the account_move file
      
      opw-2347878
      
      closes odoo/odoo#60296
      
      X-original-commit: cd299518ae45f2732d47788869b013be16b814e8
      Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
      Signed-off-by: default avatarNicolas Galler <nicocrm@users.noreply.github.com>
      32841c89
    • Pierre Masereel's avatar
      [FIX] point_of_sale: fix price computation for tax included · f8737b46
      Pierre Masereel authored
      
      When you hava a fiscal position that that map one tax included into the
      price to another, the new amount is wrong.
      
      I we have a fiscal position that map a tax of 10% included to 20%
      included, and a product at 110$ having 10% included. When we map the tax
      from 10% to 20%, the new price is 100$ but should be 120$.
      
      This is because for now, the price is fixed to get the amount without
      tax, which perfectly works when destination tax is tax excluded. But
      when you call compute_all from a price with a tax included (20%) it keep
      the price and compute the tax amount out of this price.
      
      So to fix this issue, whent the origin tax and destination tax are
      included, we are computing the base amount (like before) and then we
      compute the new tax amount wihtout trying to find the tax amount out of
      the price.
      
      This will lead to have the same behavior between accounting and POS
      
      closes odoo/odoo#60237
      
      X-original-commit: a0baa3751e1d8825c657464097f77f1957149065
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      f8737b46
    • qsm-odoo's avatar
      [FIX] mass_mailing: restore button text colors · 43e6f95b
      qsm-odoo authored
      The button text colors were forced to the default link color while that
      color should only be forced for links which are not buttons.
      
      Note: this fix will not impact existing mail templates thanks to
      transcoding. That's why it is possible to fix safely in stable versions.
      
      Part of https://github.com/odoo/odoo/pull/60203
      
      
      opw-2360756
      
      closes odoo/odoo#60203
      
      X-original-commit: 3d8c6eca5ffa657485bdf4bec84c07b4f978a71d
      Related: odoo/enterprise#14178
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      43e6f95b
    • qsm-odoo's avatar
      [FIX] mass_mailing: make better link dialog for mass mailing · fd9e58a6
      qsm-odoo authored
      Primary and link buttons are "hacked" by mailing themes scss. We thus
      have to fix their preview if possible (as they are previewed as standard
      bootstrap while they actually have a different look depending on the
      mailing theme).
      
      Note: this commit is obviously a big hack which calls for lots of
      improvements in master.
      
      Part of https://github.com/odoo/odoo/pull/60203
      opw-2360756
      
      X-original-commit: 7bd7bc25
      fd9e58a6
    • qsm-odoo's avatar
      [FIX] mass_mailing, *: restore mass mailing options · 1a916fc2
      qsm-odoo authored
      *: web_editor
      
      The snippet options which were specific to mass mailing were not loaded
      anymore as they were loaded outside of the iframe where the edition
      take places. Fortunately, the generic options were still working and
      are the most important.
      
      This bug was only revealed thanks to another bug fix which wanted to
      be done in the unloaded file.
      
      Note: this fix is a series of huge hack to make it possible and as safe
      as possible in stable versions. This obviously has to be refactored in
      master, if not already done.
      
      Part of https://github.com/odoo/odoo/pull/60203
      
      X-original-commit: 7225ce6b
      1a916fc2
  11. Oct 14, 2020
  12. Oct 19, 2020
  13. Oct 16, 2020
    • qsm-odoo's avatar
      [FIX] web_editor: keep `<i/>` elements after icon edition · 078308b2
      qsm-odoo authored
      
      Any non `<span/>` element which was transformed into an icon thanks to
      the media dialog was transform into a `<span/>` then processed by
      summernote. In some cases, this processing breaks the DOM... for no
      reason as the DOM should not have been transformed into a `<span/>` in
      the first place: `<i/>` elements inside a `<span/>` for example should
      stay `<i/>` elements after edition.
      
      closes odoo/odoo#60200
      
      X-original-commit: 4bfcb80e
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      078308b2
  14. Oct 19, 2020
    • nie's avatar
      [FIX] base: Contacts still have deactivated language · c8c828ee
      nie authored
      
      Steps to reproduce the bug:
      - Install web_studio, contacts
      - Activate language English (UK)
      - Switch all users' language to UK
      - Deactivate language English (US)
      - Via Studio, add a related field to a contact: Self > Language
      
      Bug:
      Traceback: contacts still have en_US as language and it's deactivated.
      
      opw:2350362
      
      closes odoo/odoo#60276
      
      X-original-commit: 47ec3585f50f030025b39031807be50a9299bcd6
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      c8c828ee
    • Victor Feyens's avatar
      [FIX] sale_coupon: avoid duplicated checks/filters · 679ebc33
      Victor Feyens authored
      
      Avoid filtering/checking the same condition multiple times on the same
      records...
      
      This allows to avoid n more fetch of all applicable coupon programs from
      the database (because _check_promo_code is called on each program in a loop).
      
      Also apply the date filter directly in SQL:
      * The computation of inherited fields (_inherits) by the orm is intrinsically slow.
      
      	The fields rule_date_from and rule_date_to checked in the _filter_on_validity_dates
      	python filter are inherited from sale.coupon.program.rule model.
      
      * Filtering recordsets in SQL is faster.
      
      closes odoo/odoo#60247
      
      X-original-commit: 294628df
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      679ebc33
    • Victor Feyens's avatar
      [IMP] sale_coupon: diverse perf improvements · d3daa379
      Victor Feyens authored
      
      * Use set instead of recordset to incrementally join records
      * avoid filtered and mapped calls when possible
      * use generators correctly
      sum([gen]) --> sum(gen)
      
      X-original-commit: cc1bb922
      Co-authored-by: default avatarLoan Sens <lse@odoo.com>
      d3daa379
    • Victor Feyens's avatar
      [FIX] sale_coupon: perf improvement · 5d45322c
      Victor Feyens authored
      _get_applicable_no_code_promo_programs always returns a subset of
      _get_applicable_programs ...
      
      We can thus avoid summing the results from the two methods, which
      triggered unnecessary operations and resulted in a recordset with
      useless duplicates...
      
      Furthermore, as _get_applicable_programs returned recordset is only
      used to compare to other recordsets (substraction or comparison),
      it doesn't need to be sorted by the model order.  We can thus
      safely order the result by id instead, to reduce the query complexity.
      
      X-original-commit: 4eae55de
      5d45322c
    • Victor Feyens's avatar
      [FIX] sale_coupon: reorder costly method to avoid useless operations · 447057cf
      Victor Feyens authored
      
      When coupon is installed, all cart (SO) updates on the e-commerce go through
      the _remove_invalid_lines method.  It has been proved to be a performance
      bottleneck on big instances with a lot of coupon programs.
      
      To reduce the performance impact of this method, this commit reorganize it
      to avoid unnecessary operations as much as possible.
      
      X-original-commit: bb2a7e84
      Co-authored-by: default avatarLoan Sens <lse@odoo.com>
      447057cf
    • Victor Feyens's avatar
      [IMP] sale_coupon: avoid unnecessary filtering of coupon programs · cc74ad01
      Victor Feyens authored
      Instead of summing the programs filtered by "current_order" and
      "next_order" usage, use all the programs directly.
      
      We can safely assume that the promo_applicability is always set, and if
      not, the code later should still behave correctly considering it wasn't
      verified in the other methods.
      
      This allows us to avoid two "useless" walkthrough on the coupons applied
      on the current sale order.
      
      X-original-commit: ce28d5bf
      cc74ad01
    • Victor Feyens's avatar
      [FIX] sale_coupon: wrong filtering domain · 871a118d
      Victor Feyens authored
      If only one of the two dates rules fields is specified, it won't be considered
      when filtering coupon programs, and the program will always be considered valid...
      
      This commit reorder the conditon to correctly consider both fields: rule_date_from
      and rule_date_to, even if only one of the two field is set.
      
      X-original-commit: c87f004d
      871a118d
    • Victor Feyens's avatar
      [FIX] sale_coupon: missing company_id check in domain · 559f1e96
      Victor Feyens authored
      A check on the company_id field was forgotten in _get_applicable_programs.
      To follow the logic of the following method _get_applicable_no_code_promo_program,
      this condition is added to the domain, ensuring coupon programs from other
      companies cannot be applied to a sales order.
      
      X-original-commit: fa1886e1
      559f1e96
Loading