Skip to content
Snippets Groups Projects
  1. Nov 12, 2019
    • Goffin Simon's avatar
      [FIX] stock_dropshipping: Creating a quotation without purchase permission · 1b14af28
      Goffin Simon authored
      
      Fine tuning of this commit: f93fcaff
      
      Steps to reproduce the bug:
      
      - Open runbot v11
      - Restrict Demo's access to Sales Manager for sales and employee for Employee
      - Try to create a new quotation
      
      Bug:
      - You got Odoo server Error
      Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:
      - Inventory/User
      - Accounting & Finance/Billing
      - Purchases/User
      - Purchases/Manager
      - Other Extra Rights/Portal
      (Document model: purchase.order.line) - (Operation: read, User: 5)
      
      opw:2120692
      
      closes odoo/odoo#40094
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      1b14af28
    • François Honoré's avatar
      [FIX] base: call context_get with the right user · 28ab5cbe
      François Honoré authored
      
      self.env.user returns the current user but browsed with the superuser:
      - self.env.user == current user
      - self.env.user.env.user == administrator
      
      get_context uses self.env.user to retrieve the context of the user.
      Before this patch, the name of the filters was translated in the
      language of the administrator instead of the current user.
      
      Closes odoo/odoo#40086
      
      closes odoo/odoo#40108
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      28ab5cbe
    • Christophe Monniez's avatar
      [FIX] test_lint: force absolute path to compute odoo path · 1a680950
      Christophe Monniez authored
      
      When using the flamegraph module from a parent directory of odoo, the
      dirname method returns a relative path, leading to a traceback.
      
      With this commit, the odoo_path is enforced to be an absolute path.
      
      closes odoo/odoo#40100
      
      Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
      1a680950
  2. Nov 10, 2019
  3. Nov 07, 2019
  4. Nov 06, 2019
    • Pierre Masereel's avatar
      [FIX] point_of_sale: create invoice when offline · c3e77812
      Pierre Masereel authored
      
      When a pos order is created and should be invoiced, the argument
      to_invoiced is sent when the order is finalized. But if you were offline
      during this sale, when you are back online, the 'to_invoice' is lost,
      because the value stored on the order is not sent to the server.
      
      So we are now sending the value from the order.
      
      closes odoo/odoo#39884
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      c3e77812
    • Xavier ALT's avatar
      [FIX] web: fix crash on editable list view when moving over a RO field · 36330b96
      Xavier ALT authored
      
      In editable list view, moving to next cell using TAB key crash when the
      following field is read-only (i.e non-focusable) and an onchange() event
      is triggered.
      
      Consider an editable tree view like this:
      
      <form>
         <field name="o2m" onchange="1">
             <tree>
                <field name="description"/>
                <field name="date" readonly="1"/>
                <field name="type"/>
             </tree>
         </field>
      </form>
      
      1. Adding a new line will give focus to `description` field widget
         (currentFieldIndex is 0)
      
      2. issuing a TAB keypress, will call _onNavigationMove which calls
         _selectCell() with fieldIndex of 1
      
      3. The _selectCell() method set widget currentFieldIndex to the new value
         (currentFieldIndex is 1) add call _activateFieldWidget() to activate
         on the corresponding widget.
      
      4. _activateFieldWidget() will fail to activate the `date` field as it's
         readonly, then try for next ones and succeed to activate the `type` field
         cell
      
      5. When focus is given a `type`, the `description` field is blurred which
         trigger an onchange() and the controller apply those changes to the
         editable list rendererd using the confirmUpdate() method.
      
         The confirmUpdate() will try to get the current selection, but that
         field is actually set to the `date` field (currentFieldIndex = 1),
         which is readonly and so has no focusedElement - triggering the crash.
      
      This commit ensure we don't try to call getSelectionRange() it current widget
      has no focusable element.
      
      OPW-2075229
      
      closes odoo/odoo#39811
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      36330b96
  5. Nov 05, 2019
  6. Nov 06, 2019
  7. Nov 05, 2019
    • Nans Lefebvre's avatar
      [FIX] ir_http: return a 404 if binary content cannot be decoded · e923a965
      Nans Lefebvre authored
      
      Backport of a68f7e6e
      
      Commit 5a9e1af6 has the unfortunate side-effect of crashing early
      if for any reason the content cannot be decoded.
      However, simply ignoring that the content cannot be decoded is no better idea:
      some functions pipe the result to decoding functions that crash the same.
      The resulting traceback pollutes the log with uninformative message such as:
      binascii.Error: Incorrect padding 5 0.002 0.016
      
      In case the content cannot be decoded (data corruption, or simply missing file)
      we return a clean 404 instead, which is morally almost equivalent,
      and is clean even from functions that depend on binary_content.
      
      opw 2117114
      
      closes odoo/odoo#39792
      
      Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
      e923a965
  8. Nov 04, 2019
  9. Oct 31, 2019
  10. Nov 04, 2019
    • Xavier Morel's avatar
      [FIX] core: SIGXCPU in worker processes · 549bd199
      Xavier Morel authored
      
      odoo/odoo#30688 (6ce2d6ef) added an
      indirection in prefork workers: Python-level signal handlers are
      delayed until native calls have ended (e.g. accept() or
      execute()). Running the actual work in a sub-thread allowed the main
      thread to handle signals in all cases.
      
      However there is apparently an issue with SIGXCPU on linux (possibly
      other cases as well): SIGXCPU is delivered to the child thread (if
      possible?) and Thread.join apparently stops it from redelivered to
      the main thread (Thread.join is signal-interruptible since 3.2 but
      possibly not Python-interruptible).
      
      Blocking SIGXCPU on the child thread causes the OS to deliver on the
      main thread and fixes the issue.
      
      Also split set_limits so it sets the signal handler in the parent
      thread but properly updates the soft limit in the child after each
      request, as the goal is to put a hard limit on the CPU time per
      request, not on the worker. 6ce2d6ef would set the limit once then
      never update it, likely cycling workers more than desired.
      
      While at it:
      
      * block other signals with a handler set, they seem to work
        regardless on linux but other OS may have a different way of
        dispatching process-directed signals
      * unset signals which are set by the prefork server but whose
        set behavior makes no sense in workers:
      
        - TERM and CHLD were already unset
        - HUP is used to restart the server, workers can just be killed
        - TTIN and TTOU configure the number of workers
      
      closes odoo/odoo#39341
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      549bd199
  11. Nov 03, 2019
  12. Oct 31, 2019
  13. Oct 30, 2019
  14. Oct 29, 2019
    • Lucas Perais (lpe)'s avatar
      [FIX] account: exchange rate difference when payment in domestic · 40db7a8c
      Lucas Perais (lpe) authored
      Make an invoice in Foreign
      Make a refund in Foreign
      reconcile the two, partially
      
      Make a payment in domestic, partial also, but with writeoff
      
      Before this commit,
      
      The invoice was not fully reconciled and -0.02 was yet to pay on it
      Notice the negativity of that number, which actually means that it HAS been
      fully reconciled !!!! (there is too much payment compared to invoiced)
      
      This was because, the account.payment in domestic currency is doing:
      Invoice residual in foreign, converted to domestic
      
      Then that amount minus payment's amount gives write off amount in domestic
      
      Then, at reconciliation, the whole payment's amount, which is
      the payment + the writeoff contained the expected and mathematically
      correct conversion and currency rounding errors
      (which should make out the exchange difference)
      
      The exchange difference IS created, and rightfully too
      that is, it records the exchange difference as debit 0.01 in the receivable !
      
      What was tricky though, is that the partial line recorded the debit 0.01 receivable
      as its CREDIT move line !
      
      After this commit, the receivable line is recorded as the DEBIT move line of
      the partial between the payment and the invoice
      so the invoice, is fully paid.
      
      We keenly admit this is hackish, but justified:
      - business-wise: the rounding/exchange errors are appearing ex-post
      to the choice of the amount of the reconciliation between the payment
      and the invoice, because we are reconciling them on the domestic amount
      
      - technically: our hands are tied because some key information is not present
      every time, and weirdly, not symmetrically. That is, the computation of
      line.amount_residual[currency] may be different if your are on a line with a currency,
      or on a line that doesn't.
      We should really think of systematically putting the currency on the line
      whichever it is ! The same goes for partial reconciliation model !
      Touching the current behavior is out of the question.
      
      Moreover, we should take into account that comparing amounts at different
      points in time should be done by actualizing those amounts to a common date
      See https://github.com/odoo/odoo/pull/39117
      
       for details
      
      OPW 2057845
      
      closes odoo/odoo#39205
      
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      40db7a8c
  15. Oct 26, 2019
  16. Oct 27, 2019
  17. Oct 23, 2019
    • Martin Trigaux's avatar
      [FIX] profiler: be more pesimistic · 9d7147a3
      Martin Trigaux authored
      
      The profiler was too optimistic. If the local variable self was not a
      cursor, it assumed it was automatically an Odoo model.
      Instead, only do the custom tracer methods when self is an instance of
      BaseModel.
      
      Full scenario to reproduce explained at odoo/odoo#39237
      
      In case a method like the default_get of utm.mixing was profiled, the
      tracer crashed when evaluating `__bool__(request)`.
      The tracer considered self as an Odoo model while it was a werkzeug
      instance with its custom __getattr__ that crashed while trying to
      retrieve the content of `_name`.
      
      Fixes odoo/odoo#39237
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      9d7147a3
  18. Oct 24, 2019
  19. Oct 23, 2019
  20. Oct 21, 2019
  21. Oct 22, 2019
    • Lucas Perais (lpe)'s avatar
      [FIX] web: calendar: fetch records in right timezone · 70ed3d54
      Lucas Perais (lpe) authored
      
      Before this commit, the calendar searched records on the wrong time ranges
      which did not take into account the timezone of the user
      It obviously resulted in some records not being there
      
      After this commit, all the relevant records are fetched according to the right
      time range in UTC, corresponding to start/end of the week/month/day of the calendar
      
      OPW 2076114
      
      closes odoo/odoo#39184
      
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      70ed3d54
  22. Oct 10, 2019
  23. Aug 27, 2019
  24. Oct 22, 2019
  25. Oct 21, 2019
Loading