Skip to content
Snippets Groups Projects
  • Mathieu Walravens's avatar
    dacfa844
    [FIX] product_expiry: send alert activity to the correct user · dacfa844
    Mathieu Walravens authored
    
    Steps to reproduce:
    1. Have 2 companies, and select the one w/ the highest ID
    2. Create a new product tracked by lot + expiration date
    3. Receive product
    4. Set the received lot's expiration and alert dates in the past
    5. Inventory > Operations > Run scheduler
    
    Before this commit:
    An activity is created on the lot for OdooBot,
    despite the product's responsible set to the current user.
    It happens because the default value for `responsible_id` is the current
    user, but the value is only set for the current company. When the
    scheduler runs, it doesn't set the company; therefore, it takes the
    product's responsible user for the company with the lowest ID, which is
    not set.
    
    After this commit:
    The activity is created for the product's responsible user using
    the lot's company.
    
    opw-3489340
    
    closes odoo/odoo#135361
    
    Signed-off-by: default avatarTiffany Chang (tic) <tic@odoo.com>
    dacfa844
    History
    [FIX] product_expiry: send alert activity to the correct user
    Mathieu Walravens authored
    
    Steps to reproduce:
    1. Have 2 companies, and select the one w/ the highest ID
    2. Create a new product tracked by lot + expiration date
    3. Receive product
    4. Set the received lot's expiration and alert dates in the past
    5. Inventory > Operations > Run scheduler
    
    Before this commit:
    An activity is created on the lot for OdooBot,
    despite the product's responsible set to the current user.
    It happens because the default value for `responsible_id` is the current
    user, but the value is only set for the current company. When the
    scheduler runs, it doesn't set the company; therefore, it takes the
    product's responsible user for the company with the lowest ID, which is
    not set.
    
    After this commit:
    The activity is created for the product's responsible user using
    the lot's company.
    
    opw-3489340
    
    closes odoo/odoo#135361
    
    Signed-off-by: default avatarTiffany Chang (tic) <tic@odoo.com>