Skip to content
Snippets Groups Projects
Commit 4ec07602 authored by svs-odoo's avatar svs-odoo
Browse files

[FIX] product_expiry: update quantity on hand


Before this commit, when the user tries to create a new quant, even if
the product doesn't use an expiration date, he/she will not be able to
create the quant.
The issue was as `removal_date` field is added by `product_expiry` in
the quant list view, the field is on the values used to create a new
quant but not in the list of accepted field for quant creation.
So, it raises an UserError.

task-2260085

closes odoo/odoo#51482

Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
parent 049745c5
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,14 @@ class StockQuant(models.Model):
removal_date = fields.Datetime(related='lot_id.removal_date', store=True, readonly=False)
@api.model
def _get_inventory_fields_create(self):
""" Returns a list of fields user can edit when he want to create a quant in `inventory_mode`.
"""
res = super()._get_inventory_fields_create()
res += ['removal_date']
return res
@api.model
def _get_removal_strategy_order(self, removal_strategy):
if removal_strategy == 'fefo':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment