Skip to content
Snippets Groups Projects
  1. Jul 28, 2019
  2. Jul 26, 2019
  3. Jul 24, 2019
  4. Jul 26, 2019
  5. Jul 24, 2019
    • Fanny He's avatar
      [FIX] mail: allow to notify a user currently in another company · d01f3865
      Fanny He authored
      
      In particular, the problem forbids a user to lower quantities on a SO
      if the responsible is currently in another company.
      
      - Install sale_stock and sale
      - Activate Multi-companies
      - Create Company A and Company B
      - Admin in A and B
      - Other user U (e.g. duplicate of Admin) in B only
      - U creates a SO with a product, confirms it
      - Admin connects to Company A
      - U decreases product_uom_qty in a line
      - U gets an AccessError
      
      When decreasing the quantity, in sale_stock,
      _log_decrease_ordered_quantity is called and calls stock's _log_activity,
      that needs access to the responsible or the superuser's partner.
      If that user is in another company, this raises an AccessError.
      
      Because it is when accessing the partner that the AccessError is raised,
      we cannot cleanly use a check_access_rule to determine when to use sudo.
      
      OPW 2036879
      
      closes odoo/odoo#35132
      
      Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
      d01f3865
    • Pratima Gupta's avatar
      [IMP] portal: allow user with token to see attachments · cc32b7d1
      Pratima Gupta authored
      
      Spec
      ====
      
      Before this commit if a user has access to a document thanks to an access_token,
      he would already be able to see the chatter for the document, but he would not
      be able to download the attachments that are shown to him on that same chatter.
      
      The goal of this commit it to let the user download those attachments. This
      makes sense especially since messages publicly posted in the chatter might
      generate emails to the user, and the attachments will already be attached to
      those emails, so this PR is not actually granting access to more information to
      the user in a typical flow.
      
      The only difference is when said user was added as a follower after the
      attachments have been posted in which case he will be able to read them even
      though he didn't get the original emails, but this is consistent with how he
      will also be able to read the existing messages even though he didn't get them
      by email.
      
      Technical
      =========
      
      To solve this issue we could have used the access_token of the main document,
      but this would allow any user with the token to access all attachments of the
      document, including those he should potentially not be able to see such as those
      from internal notes.
      
      Instead we ensure a different access_token is properly set on each of the
      attachments that are going to be shown and we update their links accordingly.
      
      This allows for a more granular access control, and it also takes advantage of
      the existing /web/content route without having to adapt it.
      
      opw-2040455
      Also discussed in task-37264
      
      closes #34384
      
      closes odoo/odoo#35121
      
      Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
      
      
      Co-authored-by: default avatarPratima Gupta <pgu@odoo.com>
      Co-authored-by: default avatarSébastien Theys <seb@odoo.com>
      cc32b7d1
  6. Jul 01, 2019
  7. Jul 26, 2019
    • Nicolas Lempereur's avatar
      [FIX] web_editor: enter at A edge no dup link · 53ef2528
      Nicolas Lempereur authored
      
      In the editor, when you write a letter at the end or beginning of a link
      it is written outside the link. But if you press "Enter", we get on a
      newline with an empty link duplicated on the new line.
      
      This is caused by the custom code handling "Enter" keypress.
      
      With this changeset, in this situation we place the range just before
      the beginning or after the end of a link.
      
      opw-1724606
      opw-2042097
      closes #35188
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      53ef2528
  8. Jul 01, 2019
  9. Jul 26, 2019
  10. Jul 25, 2019
  11. Jul 24, 2019
    • Romain Derie's avatar
      [FIX] web_editor, website: avoid returning children of inactive view · 6a592240
      Romain Derie authored
      
      Before this commit, for the following view tree:
      P (active)
      |
      I (inactive)
      |
      II (active)
      When calling `get_related_views()` on 'P', it would wrongly return 'II'.
      It shouldn't, since its parent 'I' is inactive.
      
      Step to reproduce:
      - Go to /shop
      - Enable ecommerce categories
      - Enable Collapsible Cateogories
      - Disable ecommerce categories
      - Collapsible categories is still shown even if its parent got archived
      
      closes odoo/odoo#35154
      
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      6a592240
  12. Jul 25, 2019
    • Arnold Moyaux's avatar
      [FIX] stock: MTO overprocessed move · c8754185
      Arnold Moyaux authored
      
      Error due to other module (e.g. purchase_stock, mrp) that will
      define their own rules in order to merge or not moves together.
      Usecase:
      - Install purchase_stock
      - Create a product MTO + buy with a vendor
      - Create a SO of 1 unit
      - On the PO receive 2 units
      - On the delivery deliver 2 units
      
      It will create an empty delivery and put the entire move in
      a back order.
      
      First issue the extra move is created as a MTO if it's copied from an
      MTO move. So il will trigger all the pull rule. We won't it because it's
      an extra quantity and the rules should be only trigger by the original
      document (SO/MO).
      Also an extra move in a picking do the hypothesis that the original move and
      the extra move will always be merged together. But in the previous
      usecase, the module purchase add the condition that 'created_purchase_line_id'
      and 'purchase_line_id' should be the same in order to merge move.
      'created_purchase_line_id' is also copy=False, so the move and the
      extra move will not be merged. create_extra_move only returns the extra
      move and _action_done only process the moves returned by _create_extra_move.
      It result by an original move not merged and not processed by _action_done,
      it will be automaticaly set in a back order and the extra move is
      processed.
      
      In order to fix it, check if the move and the original move will be
      merged. If not, returns both moves.
      
      opw-2008113
      Close #34005
      
      closes odoo/odoo#34411
      
      Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
      c8754185
    • David Dufresne's avatar
      [CLA] signature for ddufresne · 5b80695f
      David Dufresne authored
      
      closes odoo/odoo#35079
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      5b80695f
  13. Jul 24, 2019
  14. Jul 22, 2019
  15. Jul 23, 2019
    • Lucas Perais (lpe)'s avatar
      [FIX] website_sale: frontend billing address is partner's address · a5ca064d
      Lucas Perais (lpe) authored
      Have a partner
      
      Partner (A1)
      /		\
      Shipping Addr (A2)	Invoice Addr (A3)
      
      Give portal access to A1
      Make a webshop order with A1
      
      Make it possible for the front end user to edit his billing address (by having forgotten "country" on A1)
      Note that the address being choosen as Billing is A1, NOT A3
      Save
      In the backend check the order. The customer is A1
      The shipping address is A2
      
      Before this commit though, the invoice address is A3, which is plain wrong
      usability-wise since at no point in the flow the front end user chose that address
      
      After this commit, the billing address stays A1, and A3 is just ignored
      
      This goes with the spirit of https://github.com/odoo/odoo/commit/6e69de67071f2618e00856a74716d861b7f47391
      
      
      Also, something smarter is possible if we let the user choose the billing address
      just like we let him choose the shipping address
      
      OPW 2034976
      
      closes odoo/odoo#35105
      
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      a5ca064d
  16. Jul 24, 2019
  17. Jul 22, 2019
    • Julien Castiaux's avatar
      [FIX] stock: scrap from current picking · c1d63fc5
      Julien Castiaux authored
      
      Steps to reproduce:
      
      1) Make sure you don't have any piece of the product you're about to
      sell on hand.
      2) Create two sale order, each with 10 pieces of the product and
      validate them
      3) Do a RFQ and buy 15 pieces.
      4) On the earliest sale order, check the availability, it should
      autofill the desired quantity with 10
      5) Do the same on the second, it autofills 5.
      6) On the later delivery, scrap one.
      => The product is scrapped from the early picking.
      
      Sort the candidates so the current picking is on top, this ensure the
      current picking is the first scraped.
      
      opw-2036381
      
      closes odoo/odoo#35021
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      c1d63fc5
    • Nans Lefebvre's avatar
      [FIX] product: do not create duplicate variants · 088edee2
      Nans Lefebvre authored
      
      Create a product template Pt with attibutes A1, A2,
      respectively with values Va1_1, Va1_2, and Va2.
      This should make 2 variants, V1 and V2.
      Sell some of these variants.
      Then they can't be deleted since they are linked to orders/invoices/...
      
      Now delete attribute A2. We know that:
      Warning: adding or deleting attributes will delete and recreate existing
      variants and lead to the loss of their possible customizations.
      
      In fact, old variants are only archived instead of deleted:
      for variant in variants_to_unlink: ... variant.write({'active': False})
      as a fallback.
      
      Now add again the attribute A2 to Pt.
      It creates a new variant with the correct attributes.
      Since the product is not active and has valid attributes and attribute values,
      it is reactivated.
      As a result we get the same variant twice.
      
      Here we can simply add a check: if there is already an existing variant with
      the same values, we can skip this activation.
      
      We add a tiny little test to make sure that we have correct number of variants.
      It's basically unreadable but somewhat commented.
      
      fix coauthored with @rco-odoo
      
      opw 2029985
      
      closes odoo/odoo#35013
      
      Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
      088edee2
    • Nans Lefebvre's avatar
      [FIX] point_of_sale: check constraints before opening POS session · 5e4c1b37
      Nans Lefebvre authored
      
      Set up the POS config to use a default pricelist that is archived.
      Open a new POS session.
      The constraints are checked, and an exception is raised:
      "The default pricelist must be included in the available pricelists."
      However, if the session is already opened, the check is not done at resume.
      If the pricelist is archived, the session fails to load entirely:
      after loading phase, the screen turns black and nothing happens.
      Since the constraints are really useful to load the POS, we trigger an explicit
      check of all constraints (there are a lot more than our example) when opening
      the POS.
      
      opw 2033453
      
      closes odoo/odoo#35077
      
      Signed-off-by: default avatarRichard Mathot (rim) <rim@openerp.com>
      5e4c1b37
    • Jorge Pinna Puissant's avatar
      [FIX] website_quote: Show 'Unit Price' column from quote template line · bdfed675
      Jorge Pinna Puissant authored
      
      Before this commit, the unit price of the quote template line were
      hidden.
      
      Now, the unit price are shown. This is necessary because the unit price
      is used if :
      - the template is selected before the customer (price_list) is selected.
      - the price_list is "Show public price & discount to the customer"
      
      This commit revert  94164834
      
      opw-2039071
      
      closes odoo/odoo#35069
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      bdfed675
    • Nicolas Lempereur's avatar
      [FIX] doc: complete tale about two profilers · 041ec73b
      Nicolas Lempereur authored
      
      This section of log mentionned two profilers making think they were the
      same.
      
      The odoo/tools/misc.py `profile` logs a method calls inside a file that
      can be used to generate a graph of method calls.
      
      The odoo/tools/profiler.py `profile` logs a method lines calls, queries
      and time spend inside the log.
      
      fixes #31278
      opw-2038941
      closes #35074
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      041ec73b
    • Jorge Pinna Puissant's avatar
      [FIX] website_quote: negative discounts are always included in the display price · fb9caab7
      Jorge Pinna Puissant authored
      Before this commit, negative discounts (surcharges) were shown in the
      sales order when the price list have the option : "Show public price &
      discount to the customer".
      
      Now,  the negative discounts are included in the display price. This
      issue was already been addressed in the sales module (see https://github.com/odoo/odoo/blob/ac170e8a8238a9b0aa468f83b11aabc4cd9493de/addons/sale/models/sale.py#L1046
      
      )
      
      Fine-tunning of : cae506f0
      
      opw-2039071
      
      closes odoo/odoo#35065
      
      Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
      fb9caab7
Loading