Skip to content
Snippets Groups Projects
  1. Apr 24, 2019
    • Yannick Tivisse's avatar
      [FIX] hr_holidays: Avoid erasing values on onchange if set · 4b0b00db
      Yannick Tivisse authored
      
      closes odoo/odoo#32790
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      4b0b00db
    • Lucas Lefèvre's avatar
      [FIX] hr_holidays: Fix deleted default employee · 08da07b1
      Lucas Lefèvre authored
      The goal of commit 2dbce5e6 was to handle the company
      holiday type in onchange which was probably forgotten
      when the company type was introduced.
      However because the last `elif` was changed to `else`,
      the `else` clause is executed in some situations where
      it shouldn't.
      
      e.g. If holiday type is `employee` and an employee is set,
      the `else` clause is (obviously wrongly) executed.
      This is particularly a problem if the employee is not
      HR user nor manager. In that case, the field employee_id
      is invisible and its value has been deleted by the onchange.
      The allocation cannot be saved because it violates the
      sql constraint (employee is null).
      
      Also, the `mode_company_id` and `category_id` should be set
      to `False` when the holiday type is not company/category.
      08da07b1
    • Lucas Lefèvre's avatar
      [FIX] hr_holidays: Allow create department leave · d6242a34
      Lucas Lefèvre authored
      1. Open form view to create a leave
      2. Change the leave type to 'By department'
      3. Choose the department of the current user
      4. Save the leave
      5. Approve the leave
      => ValidationError, cannot have two leaves at the same time.
      
      In `@api.onchange('holiday_type')`, when choosing by department
      it sets `employee_id`, `mode_company_id` and `category_id`
      to `False` ONLY if the department is not already set.
      But by default, the employee is set to the user's employee
      and the department is set to the employee's department.
      Therefore the employee is never set to `False` and the
      department leave is linked to this employee.
      When validating the 'department' leave, an 'employee'
      leave is created for each employee in the department.
      For the current user, it crashes because the deparment leave overlaps with
      the 'employee' leave since the department leave is linked to
      the employee.
      d6242a34
    • Nicolas Martinelli's avatar
      [FIX] stock: add operation in mobile view · 17ac11d5
      Nicolas Martinelli authored
      
      Since it is possible to create an operation in the regular list view, it
      should also be possible to do it in the kanban mobile view.
      
      opw-1963527
      
      closes odoo/odoo#32907
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      17ac11d5
  2. Apr 19, 2019
    • Nicolas Martinelli's avatar
      [FIX] website: sign-up in multi-website · 77c708c5
      Nicolas Martinelli authored
      
      - Create 2 companies A & B
      - For each company, create a website linked to a different URL and
        activate 'Free sign up' and 'Specific User Account'.
      - As a public user, go to website of company B
      - Go to 'Sign in > Don't have an account?' and create an account
      
      The user is created in company A (the company of the user template)
      instead of company B (the company of the website).
      
      We set the company of the user based on the company of the website.
      
      opw-1962197
      
      closes odoo/odoo#32823
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      77c708c5
    • Nicolas Martinelli's avatar
      [FIX] website_sale: multi-website · 3a0f05f3
      Nicolas Martinelli authored
      
      - Create 2 companies A & B
      - For each company, create a website linked to a specific URL
      - As a public user, visit website of B
      - Buy a product, register your address
      
      The partner is in company A (the company of the superuser) instead of
      company B (the company of the website).
      
      opw-1962197
      
      closes odoo/odoo#32822
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      3a0f05f3
  3. Apr 24, 2019
  4. Apr 23, 2019
  5. Apr 18, 2019
  6. Apr 21, 2019
  7. Apr 19, 2019
    • Nans Lefebvre's avatar
      [FIX] resource: give admin rights to edit global leaves · 35392213
      Nans Lefebvre authored
      
      Commit 27d41ccb introduced record rules on resource.calendar.leaves.
      However it gave no way to create, edit or delete a global rule.
      We grant this right to the group_erp_manager, so that an admin can do it.
      
      opw 1968376
      
      closes odoo/odoo#32832
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      35392213
    • Xavier Morel's avatar
      [IMP] mrp: batch-create moves during MO creation · 3f681b20
      Xavier Morel authored
      
      OPW-1967543 on non-trivial multi-level test BOM, MO creation goes from
      30s to 13 on my system.
      
      closes odoo/odoo#32819
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      3f681b20
    • Nicolas Martinelli's avatar
      [FIX] mrp: mrp_workorder uninstall · 6c702172
      Nicolas Martinelli authored
      
      - Install 'quality_mrp_workorder' without demo data
      - Go to the General Settings
      
      A warning is raised regarding the uninstallation of 'mrp_workorder'.
      
      This is due to `_onchange_group_mrp_routings`, which assumes that the
      installation of 'mrp_workorder' is only linked to the group
      `group_mrp_routings`.
      
      This is incorrect: `group_mrp_routings` might not be activated, but it
      might be in the dependencies of another module. Therefore, we change the
      logic: if we activate `group_mrp_routings`, we install 'mrp_workorder'.
      If we deactivate `group_mrp_routings` we do not uninstall
      'mrp_workorder' if it is already installed, since it might be required
      by a dependancy.
      
      opw-1970910
      
      closes odoo/odoo#32811
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      6c702172
  8. Apr 18, 2019
    • Martin Trigaux's avatar
      [FIX] base_setup: do not create deleted parameter · a7c77484
      Martin Trigaux authored
      
      The base_setup.show_effect parameter is created at module installation (with
      an external id) and is removed (and its external id) when the option
      "Show Effect" is unchecked from the general setting.
      
      When this option is checked again, the ir.config.parameter entry is recreated
      but without an external id (as it is user-provided data, not from a data file).
      
      When the module base_setup is updated, the record base_setup.show_effect is
      recreated and the unicity constraint on ir.config.parameter is raised.
      
      Set the record as forcecreate="False" to avoid recreating it when the module
      is updated.
      Anyway, if somebody uncheck the option, it is not expected to get it back when
      the module is upgraded.
      
      Fixes odoo/odoo#32806
      
      closes odoo/odoo#32808
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      a7c77484
    • Nicolas Martinelli's avatar
      [FIX] purchase_stock: tax included in multi-currency · 2785b045
      Nicolas Martinelli authored
      
      - Set the company currency to USD, activate multi-currency
      - Create a rate of 0.5 for EUR
      - Create a purchase tax T:
        Percentage: 10 %
        Included in price
      - Create a PO in EUR with the followind line
        Quantity: 10.0
        Price Unit: 1.0
        Tax: T
      - Validate the PO, receive the product
      
      The journal entry is composed of 2 lines:
      - debit:  18.18; amount currency:  10.0
      - credit: 18.18; amount currency: -10.0
      
      This is not correct: the amount currency should not include the tax.
      
      In order to prevent this, we use the subtotal, and divide by the
      normalized quantity (yeah, because it was also failing in case of multi
      UoM, as one could have expected).
      
      opw-1958287
      
      closes odoo/odoo#32797
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      2785b045
    • Goffin Simon's avatar
      [FIX] mrp: Duplicate finished_move_line_ids from by_product in a BOM · 39c3abc5
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      - Create product A (type='product',tracking='lot')
      
      - Create product B (type='product',tracking='lot')
      
      - Create product Z(type='consu',tracking='none')
      
      - Create BoM for product Z with product A as component and product B
      as sub_product (i.e. By product) + create any routing (i.e. 1 operation).
      
      - Create an MO for product z, plan it, process the given work order,
      input the serial/lot for the components and byproducts...
      
      Bug:
      
      Two lines for product B were displayed in the finished_move_line_ids of the MO
      
      This bug occured in enterprise because the function _create_checks defined on model
      'mrp.workorder' creates the quality checks that create the finished_move_line_ids
      for the by_product tracked by lot or by serial number (in fuction _update_active_move_line
      defined on model 'mrp.workorder').
      
      So the finished_move_line_ids were created two times with the ones created in fuction record_production
      defined on model 'mrp.workorder' in community.
      
      Co-authored-by: default avataramoyaux <arm@odoo.com>
      
      opw:1963163
      
      closes odoo/odoo#32779
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      39c3abc5
    • Nans Lefebvre's avatar
      [FIX] stock_dropshipping: fix test classes · 6dcf7989
      Nans Lefebvre authored
      
      Commit 52c89ade added a test in v11.
      Commit 1e0a92c9 forward-ported that commit to v12, that already had a test.
      As a result, the class TestDropship was defined twice.
      It follows that the first test was not executed.
      
      opw 1957701
      
      closes odoo/odoo#32792
      
      Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
      6dcf7989
  9. Apr 15, 2019
  10. Apr 17, 2019
    • Laurent Mignon's avatar
      [IMP] mail: restore support for all report_types in mail attachments · d637fe40
      Laurent Mignon authored
      
      Commit 48018411 introduced a new ir.action.report type: qweb-text.
      Commit 3425752e introduced an explicit check on the type, for html or pdf.
      This removed the ability to support arbitrary reports through the call to the
      generic render method, which dispatches to the correct one for a report_type.
      We add support for the text format following the same logic.
      
      The explicit error will be raised if the rendering fails,
      e.g. in the case where the render method is not defined.
      
      Thanks to @gdgellatly for reporting.
      opw 1966208
      closes #28513
      closes #30013
      closes #32532
      
      closes odoo/odoo#32773
      
      Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
      d637fe40
    • Lucas Perais (lpe)'s avatar
      [FIX] web_editor: insert br within a p · 2830b93a
      Lucas Perais (lpe) authored
      
      Have a fieldHTML as:
      ```
      <p>
      Some text
      <br>
      <br>
      More text
      </p>
      ```
      
      In the Html field widget, place your cursor before the "M"
      press Enter to insert a newline
      
      Before this commit "Some text" and the subsequent `<br>` were deleted
      This was because the code:
      - split the original `<p>` into two
      ( i.e. it became
      ```
      <p>
      Some text
      <br>
      <br>
      </p>
      <p>
      More text
      </p>
      ```
      )
      - took the last child of the first p, which is a text then fell back to the first p
      - replaced the whole p with <br>
      
      After this commit, the original p is still split, but we append the br to it instead of replacing it
      
      closes odoo/odoo#32777
      
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      2830b93a
    • Simon Lejeune's avatar
      [FIX] stock: cache invalidation in _action_assign · c8b91b0a
      Simon Lejeune authored
      
      `reserved_availability` is a computed field of a move depending on its
      move lines. We access this field at each iteration of the loop over the
      moves to assign and then we create a new move line for it. This triggers
      an invalidation of this field, The next iteration will again access this
      field and prefetch it for all the next records.
      
      We read the field out of the loop and don't access it again to prevent
      these prefetch/invalidation issues.
      
      Confirmation of a PO of ~800 lines goes from 5 minutes to 1 minute.
      
      opw-1953398
      
      closes odoo/odoo#32774
      
      Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
      c8b91b0a
    • Goffin Simon's avatar
      [FIX] sale: Keep fiscal position from SO · c2f15d3f
      Goffin Simon authored
      
      Steps to reproduce the bug:
      - Create two fiscal postions fp1 and fp2
      - Create a customer C with fp1
      - Create a SO for C and set fp2
      - Create an invoice for the SO
      
      BUG:
      
      The fiscal position of the SO was set to False.
      Now the fiscal position of the SO is kept when creating an invoice
      from a SO.
      
      opw:1963910
      
      closes odoo/odoo#32713
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      c2f15d3f
  11. Apr 15, 2019
    • Lucas Perais (lpe)'s avatar
      [FIX] web: search view handles JSON parsable domains · 7bf25cc3
      Lucas Perais (lpe) authored
      
      Before this commit, a domain that had been written in order to be
      JSON parsable, would trigger a JS crash when activated in the UI
      It happens when adding custom filters through the edition of the search view with studio
      
      This was because, Odoo developers write, in the XML of a search view
      domains python style: `[('field', '=', 'value')]`
      When parsing the view in JS, this doesn't get altered by `xml_to_json`
      Then, the search view code evaluates it python style
      This commit considers that behavior fortunate, but not really clear or conceptually correct
      
      But, when customizing a search view with studio, the domain is written by the code, in JS
      JSON parsable format `[["field", "=", "value"]]`
      
      This should be supported too, as so many customizations may have been done before hand
      
      After this commit, both expressions are supported by the filters menu
      
      OPW 1957297, 1960732, 1965649 (at least)
      
      closes odoo/odoo#32690
      
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      7bf25cc3
  12. Apr 16, 2019
    • Josse Colpaert's avatar
      [FIX] l10n_de_skr03: account 3557 should have code 3557 (forward-port) · 6a57ad66
      Josse Colpaert authored
      
      Fixes #32714
      
      closes odoo/odoo#32739
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      6a57ad66
    • Julien Castiaux's avatar
      [FIX] calendar: browse record using IrRules · 54e970e7
      Julien Castiaux authored
      
      Create a calendar meeting using Mark Demo. In the options of the event,
      set the meeting as "Show Time as" = "Free". Using the admin user, send a
      digest (KPI Digest module, technical > emails > digest email > send
      now). It raises an User Error because the template cannot be rendered.
      
      The problem is due to the way the "Show Time as" is implemented, the
      "Free" option is used to not show the meeting in the different calendar
      views. The events are hidden thanks to a record rule "Hide Private
      Meetings".
      
      Each digest is sent using the context of each subscripted user and not
      the SuperUser ID 1. The call to `search_count` on `mail.message` calls
      the dedicated `_search` of `mail.message` and ultimately end up in the
      overriden `_find_allowed_model_wise` method of message in calendar.
      
      That method does a browse of all the record ids containing new
      messages in their chatter, but fail with an access error due to the
      above record rule. Because it fails, the `kpi_mail_message_total_value`
      compute fails and the field is missing when rendering the template.
      
      Using `search` instead of `browse` ensures records unavailable due to a
      record rule are filtered out.
      
      opw-1966664
      
      closes odoo/odoo#32735
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      54e970e7
  13. Apr 12, 2019
  14. Apr 16, 2019
    • Julien Castiaux's avatar
      [FIX] crm, sale: safe override of sales team · c42551b5
      Julien Castiaux authored
      
      The user can delete teams created during the installation of the Sale
      Team module, both CRM and Sale modify those teams but the way they
      modify the teams doesn't take their deletion into account.
      
      This reverts commit 30a848bf to replace
      post_init_hooks by `forcecreate=False` in the datas.
      
      closes odoo/odoo#32742
      
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      c42551b5
    • Goffin Simon's avatar
      [FIX] sale: _get_conversion_rate called with no date · 8631d3cc
      Goffin Simon authored
      
      Steps to reproduce the bug:
      - Define two pricelists P1(€) the default one and P2($) with discount_policy = 'without_discount'
      - Activate P1 and P2 on the website
      - Go on the shop and select P2
      
      Bug:
      
      An error was raised from function _get_conversion_rate because the arguments date and company_id were not defined
      because the function _get_real_price_currency was called from _website_product_id_change with
      the model "self.env['sale.order.line'] and not with a recordset. So the fields self.company_id and self.order_id.date_order
      were not defined.
      
      opw:1969849
      
      closes odoo/odoo#32726
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      8631d3cc
    • Lucas Perais (lpe)'s avatar
      [FIX] calendar: templates with right lang · 06b3a290
      Lucas Perais (lpe) authored
      
      Before this commit, the standard mail templates for calendar
      did not have a language
      
      After this commit, we set it to the the partner's language
      
      OPW 1946686
      
      closes odoo/odoo#32717
      
      Signed-off-by: default avatarLucas Perais (lpe) <lpe@odoo.com>
      06b3a290
  15. Apr 15, 2019
  16. Apr 11, 2019
    • Arnold Moyaux's avatar
      [FIX] stock, mrp: scheduler assign finished move · 027ff77a
      Arnold Moyaux authored
      
      Usecase to reproduce
      - Create a BoM with finished product A and Comp C
      - Create a RR on product A with min qty 10
      - Product A is tracked by serial number and have route manufacture
      - Run the scheduler twice.
      
      The finished tabs in the manufacturing order created from the order
      point contains 10 move lines with 1 qty reserved and 0 quantity done.
      
      The first run created the MO. The second run, assign the finished moves
      and thus created the move lines for finished product A.
      
      However those move line are not used by mrp because the workorder and
      the produce wizard will only create new lines instead of using existing
      lines with reservation. Also action_assign on MO only trigger
      _action_assign on raw moves.
      
      This commit add a hook on scheduler in order to modify the domain that
      will be used in order to search moves to assign. Use the hook in order
      to avoid move with the production_id many2one set.
      
      closes odoo/odoo#32597
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      027ff77a
  17. Apr 16, 2019
    • Julien Castiaux's avatar
      [FIX] account, portal, sale: odd sidebar on IE11 · d5d93474
      Julien Castiaux authored
      
      Open a quotation from the portal using IE11. The sidebar is rendered as
      it did not have any width.
      
      What we are trying to achieve on large screens is to create a sidebar
      with a fix width the size of its children and to let the rest of the
      content (right to the sidebar) expands. On small screens we want to
      invert the direction from left-to-right to up-to-bottom.
      
      The classes `col-12`, `col-lg` and `flex-lg-grow-0` are used to fulfill
      that purpose.
      
      The problem is due to the rule `flex-grow: 0 !important` applied by the
      selector `.flex-lg-grow-0` on the sidebar. On Chrome/Firefox the dom
      element takes the width of his children as minimal width, the
      `flex-grow: 0` does not shrink the element below that minimal width.
      IE11 does not set a minimal width based on the child elements of the
      node, the width is equal to 0 and the `flex-grow: 0` forbid it from
      growing.
      
      The solution is to replace the said classes by the `col-lg-auto` class
      that does exactly what we want and is cross-browser.
      
      opw-1944188
      opw-1935087
      
      closes odoo/odoo#32484
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      d5d93474
  18. Apr 08, 2019
  19. Apr 15, 2019
    • Goffin Simon's avatar
      [FIX] stock_account: Multicompany wrong cost in picking validation · 8d97b3b6
      Goffin Simon authored
      
      Steps to reproduce:
      - 2 Companies Parent A, and Child B
      - Create a Stockable Product FIFO/automated,
      - In A leave cost as 0, in B give cost of 10
      - Create an SO for product in company B
      - Logged into Parent A, validate the picking for Child B
      
      Behavior before the fix:
      An error was raised saying: Error cost of 0 (but the SO had been created in B, so the price had to be 10.)
      
      Behavior after the fix:
      Now the cost of the company B is taken.
      
      closes #32329
      
      opw:1966322
      
      closes odoo/odoo#32615
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      8d97b3b6
    • Nicolas Lempereur's avatar
      [FIX] mail: upload_attachment without model · 77a24111
      Nicolas Lempereur authored
      
      The method /web/binary/upload_attachment may be used (eg. it is the case
      in enterprise documents module) without res_model (eg. if folder_id is
      specified).
      
      Thus we should make it work (that was not possible since a26496b6).
      
      opw-1964091
      opw-1965832
      opw-1967181
      opw-1968063
      closes #32692
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      77a24111
  20. Apr 12, 2019
    • Nicolas Lempereur's avatar
      [FIX] account: style account dashboard if groupby · a68412c1
      Nicolas Lempereur authored
      
      If we use a group by on the account dashboard, the kanban tiles have the
      size of a normal kanban card so all graphs and so on are overlapping
      which is a little ugly.
      
      With this changeset, we have the same base width as in the non-grouped
      view (which in the non grouped view may change with flex).
      
      On {0,MD} screen size, we get in one column full width and ignore this.
      
      opw-1964331
      closes #32659
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      a68412c1
  21. Apr 15, 2019
Loading