Skip to content
Permalink
Branch: 12.0
Commits on Apr 23, 2019
  1. [FIX] stock: use float comparison to assign moves

    len-odoo committed Apr 19, 2019
    We remove the remaining comparisons to use the precision rounding of the UoM.
    
    opw 1969888
    closes #32707
    closes #32745
    
    closes #32844
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Apr 19, 2019
  1. [FIX] resource: give admin rights to edit global leaves

    len-odoo committed Apr 19, 2019
    Commit 27d41cc 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 #32832
    
    Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Commits on Apr 18, 2019
  1. [FIX] stock_dropshipping: fix test classes

    len-odoo committed Apr 18, 2019
    Commit 52c89ad added a test in v11.
    Commit 1e0a92c 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 #32792
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Apr 12, 2019
  1. [FIX] account: fix group checks

    len-odoo committed Apr 12, 2019
    Due to incompetence, previous commiter used user_has_groups instead of has_group
    However the latter is not a higher-level version of the former,
    since it checks the groups on the self.env.user, not on self.
    
    As a result, the filtering on the whole recordset was wrong,
    since it did the check on the env user for each record.
    
    closes #32655
    
    Signed-off-by: Christophe Simonis <chs@odoo.com>
  2. [FIX] purchase: move reference update to the right onchange

    len-odoo committed Apr 11, 2019
    Move the code from commit ea1fc12 to the onchange on purchase_id.
    The field vendor_bill_purchase_id is a technical one added in v12 to allow using
    old vendor bills as template for new vendor bills.
    However the logic on purchase_id was already in v11, so we match commit 1423973
    
    opw 1962364
    
    closes #32661
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  3. [FIX] account: only put internal users as followers of vendor bills (2)

    len-odoo committed Apr 12, 2019
    Fine-tuning of 0a4e67c.
    Due to some confusion, has_group had been replaced by user_has_groups
    on the corresponding PR.
    However the latter is not a higher-level version of the former,
    since it checks the groups on the self.env.user, not on self.
    
    As a result, the filtering was completely False, since it checked that the env
    user was in group_user which was always True.
    
    closes #32653
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Apr 11, 2019
  1. [FIX] account: better message on user group error

    len-odoo committed Apr 11, 2019
    The validation error introduced in 552da8d can pop up in contexts where
    it is not expected;
    e.g. not in editing user rights but while upgrading a module.
    Therefore we make it more explicit, giving the user a way to resolve the error.
    
    closes #32623
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  2. [FIX] purchase: update reference onchange of purchase_id

    len-odoo committed Apr 11, 2019
    Commit 1be873d removed the modification of the reference field
    from the _onchange_origin.
    The reasoning was that since this is an onchange on invoice_line_ids, it was
    applied too often, which annoyed users in the case they overwrote that field.
    
    However when using the "Autocomplete" field (purchase_id),
    then the user expects values to by modified.
    Before, it worked by setting the origin field, which trickled down
    to the reference.
    Since that commit removed this, we re-add it explicitly in that case.
    
    opw 1962364
    
    closes #32656
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Apr 10, 2019
  1. Revert "[FIX] mail: remove attachment as main at unlink"

    len-odoo committed Apr 10, 2019
    This reverts commit abc45b1
    Since by default the ondelete attribute of a many2one is `set null`,
    this was completely unnecessary to begin with.
    
    Bug caused by this commit:
    Unlink a record that has some attachments.
    The unlink first removes the record, then its related attachments.
    It calls remove_as_main_attachment, which reads the attachment res_model and
    res_id. This triggers a check that the related record can be read.
    However the related record has already been removed, an exception is raised.
    It is thus impossible to unlink a record.
    
    Closes #32563
    
    closes #32572
    
    Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Commits on Apr 8, 2019
  1. [FIX] purchase: update reference onchange of vendor_bill_purchase_id

    len-odoo committed Apr 8, 2019
    Commit 1be873d removed the modification of the reference field
    from the _onchange_origin.
    The reasoning was that since this is an onchange on invoice_line_ids, it was
    applied too often, which annoyed users in the case they overwrote that field.
    
    However when using the "Autocomplete" field (vendor_bill_purchase_id),
    then the user expects values to by modified.
    Before, it worked by setting the origin field, which trickled down
    to the reference.
    Since that commit removed this, we re-add it explicitly in that case.
    
    opw 1962364
    
    closes #32500
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Apr 5, 2019
  1. [FIX] mail: remove attachment as main at unlink

    len-odoo committed Apr 4, 2019
    If an user unlinks an attachment,
    it doesn't remove it as message_main_attachment_id.
    
    opw 1950403
    
    closes #32347
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  2. [FIX] mail: reload the record when uploading attachments if post_refr…

    len-odoo committed Apr 3, 2019
    …esh is set to always
    
    When post_refresh is set to 'always', the displayed record is entirely reloaded
    each time a message is posted in the chatter.
    However no such thing exists for when attachments are uploaded.
    
    This is of use e.g. when in the view there are fields that have attributes that
    depend on computed fields, themselves dependent on the record's attachments.
    
    One such case is the OCR.
    
    opw 1950403
  3. [FIX] mail: only register as main attachment if main not already set

    len-odoo committed Apr 2, 2019
    Commit a26496b registered an attachment added through the widget as record's
    message_main_attachment.
    This to make the OCR feature available for such attachments.
    However we copy more closely the behaviour in message_post,
    which only puts the attachment as main if there isn't already a main.
    
    opw 1950403
Commits on Apr 3, 2019
  1. [IMP] mrp: start work orders in the right state

    len-odoo committed Mar 21, 2019
    To be able to override the initialisation of the work orders states,
    we put that in a function.
    
    opw 1943674
    
    closes #31774
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 29, 2019
  1. [FIX] base_geolocalize: raise a helpful error to configure the Google…

    len-odoo committed Mar 27, 2019
    … account
    
    Google maps used to be free, but became a paid API.
    Technically, the usage could be part of the free offer,
    but to benefit from it the account needs to have billing enabled.
    Since it's a paid feature security had to be ramped up,
    so now APIs have to be explicitly enabled (here geolocating/geocoding).
    All this makes it so that the Google account has to be properly configured
    before the calls to the Maps API can work.
    As a result we add an explicit UserError if the request fails,
    to help the user configure the Google account
    (before the error was entirely hidden as to give the user no chance at all).
    
    Also exports transaltions, including for commit e6ca846
    which raised a similar error message if no API key was found.
    
    opw 1946485
    opw 1947292
    opw 1947337
    
    closes #32162
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  2. [FIX] l10n_generic_coa: fix demo data install

    len-odoo committed Mar 29, 2019
    The demo data could crash trying to send a (6, 0, [False]) to the ORM.
    
    closes #32256
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  3. [FIX] sale_stock: hide redundant incoterms_id field

    len-odoo committed Mar 22, 2019
    The field incoterms_id is made redundant by the field incoterm_id introduced in
    b5bb5bd. As such, it has been removed in master at: 569a498
    We make this field invisible,
    and synchronize the invoice incoterm_id with the sale order incoterm.
    
    opw 1935573
    
    closes #32039
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 28, 2019
  1. [FIX] account: do not allow a user to have both B2B and B2C groups

    len-odoo committed Mar 28, 2019
    We base ourselves on commit f206714, which added a check on user groups.
    The tax-included and tax excluded displays are meant to be exclusive,
    but wily users can add themselves to both groups using the res_users view
    in debug mode.
    
    opw 1950833
    
    closes #32200
    
    Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Commits on Mar 27, 2019
  1. [FIX] account: correct communication when registering payment for mul…

    len-odoo committed Mar 27, 2019
    …tiple invoices
    
    When a user register a payment for multiple invoices,
    the communication field is populated using all invoices.
    However the payment should use the communication individually for each invoice.
    This is a behaviour closer to what is done in 74b6f84 for v12.
    
    opw 1954887
    
    closes #32143
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 26, 2019
  1. [FIX] account: only put internal users as followers of vendor bills c…

    len-odoo committed Mar 25, 2019
    …reated by emails
    
    When the pdf of a vendor bill is sent to the alias of a journal,
    all the partners that match one of the email address present in the mail thread
    are added as followers of the newly created record.
    This is a problem since the vendors are actually not concerned by the internal
    work that is done, only internal users are.
    As a result they get spammed by useless emails, and complain to Christine.
    It was put in commit a4df9f8 despite not appearing in the task description.
    
    We filter the partners to only keep the ones that belong to internal users.
    
    opw 1958729
    
    closes #32110
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 21, 2019
  1. [FIX] payment_adyen: convert the paymentAmount respecting the Adyen API

    len-odoo committed Mar 20, 2019
    Adyen requires the amount to be multiplied by 10^k,
    where k depends on the currency code.
    https://docs.adyen.com/developers/development-resources/currency-codes
    Provides a map of codes to factors.
    
    Before, k was assumed to be 2 (which is correct in most cases).
    
    opw 1928918
    
    closes #32001
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  2. [FIX] payment_adyen: convert the paymentAmount respecting the Adyen API

    len-odoo committed Mar 20, 2019
    Adyen requires the amount to be multiplied by 10^k,
    where k depends on the currency code.
    https://docs.adyen.com/developers/development-resources/currency-codes
    Provides a map of codes to factors.
    
    Before, k was assumed to be 2 (which is correct in most cases).
    
    opw 1928918
    
    closes #31984
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 18, 2019
  1. [FIX] mail_enterprise: display all attachements in preview widget

    len-odoo committed Mar 18, 2019
    If res_id is not defined, this method used to crash.
    Made obvious by commit a26496b,
    which added a call to that function in the main controller of web.
    
    opw 1950403
    
    closes #31923
    
    Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Commits on Mar 15, 2019
  1. [FIX] payment: provide missing return_url in values

    len-odoo committed Mar 13, 2019
    Render from payment//payment_acquirer.py promises:
    All templates will receive:
        'feedback_url', 'return_url', 'cancel_url', 'error_url'
    However they are all in -> FIXME.
    After 6 years in FIXME, this promise is still a lie.
    
    It is unfortunate since the Adyen payment provider requires 'return_url' to work.
    Before, this function was called by _get_shop_payment_values,
    which provided a value for it.
    We copy the value that was given there directly as a default in render,
    so that it doesn't crash no matter what method calls it.
    
    opw 1928918
    opw 1944142
    
    closes #31814
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  2. [FIX] fields: safe check on ondelete cascade

    len-odoo committed Mar 15, 2019
    In the case of attachment_ids, comodel._fields[inverse] can be res_id,
    an integer field. Such fields do not have a default ondelete attribute.
    
    opw 1945926
    
    closes #31864
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 14, 2019
  1. [FIX] mail: set message_main_attachment_id when the attachment is add…

    len-odoo committed Mar 14, 2019
    …ed via widget
    
    Create a record.
    Add an attachment, using the widget (aptly named 'add an attachment').
    It is not set as message_main_attachment_id.
    If you add the message through 'log note', then it is.
    
    We add a hook to make sure that it is set as message_main_attachment_id
    when added through the widget.
    
    opw 1950403
    
    closes #31847
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  2. [FIX] mail: set message_main_attachment_id to copy=False

    len-odoo committed Mar 14, 2019
    Create a record.
    Add an attachment set as message_main_attachment_id (e.g. through log note).
    Duplicate that record.
    The new record has the message_main_attachment_id of the old record,
    while it has no attachments.
    
    Since attachments security is linked to the record id, we shall not copy them.
    
    opw 1950403
    
    closes #31846
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 13, 2019
  1. [FIX] base: check that the state matches the country at partner create

    len-odoo committed Mar 5, 2019
    Import a list of partners with their addresses.
    The state_id field is usually filled with the state codes.
    E.g. 'CA' is used for California, but also for Cádiz (Spain), etc.
    The import function (db_id_for) uses a name_search on the res.country.state,
    and takes the first matching result.
    It follows that the state does not necessarily match the country.
    
    Therefore we add a _check_import_consistency in the create.
    Here we check that the country matches the state's country,
    try to find a correct match, and if we can't we put the state to False.
    Note that if the country is not set both fields will end up set to False:
    this is because only a state would mean using a code could give an abitrary
    country.
    
    opw 1943904
    
    closes #31599
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 12, 2019
  1. [FIX] purchase: do not overwrite vendor reference on vendor bills

    len-odoo committed Mar 11, 2019
    The reference fields is supposed to contain the reference number in the vendor's
    system. E.g. if the vendor is using Odoo, it could be SO0744.
    Therefore this reference is not supposed to change once written by the user.
    However there is the _onchange_origin that uses the origin purchase order lines
    to populate the reference fields on invoice_line_ids changes.
    
    We remove entirely this behaviour for reference,
    essentially reverting 052a570.
    Instead we put a default for origin and reference in action_view_invoice
    so that these values are initially used at create.
    
    opw 1920747
    opw 1944840
    
    closes #31757
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
  2. [FIX] payment: do not retry indefinitely to post process transactions

    len-odoo committed Mar 12, 2019
    Suppose that a payment transaction cannot be reconciled for any reason.
    Then _cron_post_process_after_done will try to process it every 10 minutes until
    the end of time.
    
    Moreover, if the user takes some manual action before
    _cron_post_process_after_done,
    even if in principle it would have been able to go through,
    then it is likely to fail, e.g. on invoice_open.
    
    Meaning that a transaction that could have been processed will become
    an undead transaction.
    
    To avoid that situation we set an arbitrary retry_limit_date set to 2 days,
    which seems a reasonnable compromise.
    It gives some time for the transaction to go through, but not exaggeratedly so.
    
    opw 1945953
    
    closes #31791
    
    Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Commits on Mar 11, 2019
  1. [FIX] mrp: start the next workorder in a function to allow for overrides

    len-odoo committed Mar 11, 2019
    When a workorder is processed, it starts the next workorder.
    We put that logic in a function to allow other modules to override it.
    
    opw 1943674
Commits on Mar 8, 2019
  1. [FIX] web: fix kanban css for overflows

    len-odoo committed Mar 8, 2019
    If the content is too long, it overflows badly.
    Since the height is fixed, the flex doesn't work well.
    
    opw 1924145
    
    closes #31717
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Mar 7, 2019
  1. [FIX] hr_holidays: handle all holiday types in onchange

    len-odoo committed Mar 7, 2019
    The holiday_type can be 'employee', 'company', 'department' or 'category'.
    However in the onchange of holiday_type, for some reason nothing was done
    in the case of the 'company' value.
    
    As a result, the default 'employee' would set the employee_id,
    but then changing the type to company would not remove the employee_id.
    It follows that the lucky employee would get two allocations instead of one.
    
    opw 1938498
    
    closes #31656
    
    Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commits on Feb 7, 2019
  1. [FIX] mrp: fix singleton error in _update_raw_move

    len-odoo committed Feb 7, 2019
    Commit bfb0f1e
    did a very good job not seeing that the lines only used move[0],
    and called move.field directly.
    This could result, for certain BoMs, in traceback.
    
    opw 1928677
    
    closes #30938
Commits on Feb 6, 2019
  1. [FIX] purchase: fix mail templates

    len-odoo committed Feb 4, 2019
    Activate multi-company, deactivate the common contact book.
    Create a PO P with user U1 in company A. Switch to company B.
    User U2 in company A tries to send P by email.
    Rendering of the template fails, because it tries to access object.create_uid,
    which breaks multi-company record rules.
    
    The signature was not working because it used user_id, a non-existing field,
    instead of create_uid.
    
    opw 1930521
    
    closes #30868
Older
You can’t perform that action at this time.