File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
shopfloor_reception_mobile/static/src/scenario Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,23 @@ const Reception = {
298298 } ,
299299 } ;
300300 } ,
301+ _get_lot_expiration_date_klass : function ( ) {
302+ let klass = "loud" ;
303+ const expiryValue = _ . result (
304+ this . line_being_handled ,
305+ "lot.expiration_date"
306+ ) ;
307+
308+ if ( expiryValue ) {
309+ const expiryDate = new Date ( expiryValue ) ;
310+ const now = new Date ( ) ;
311+ if ( expiryDate < now ) {
312+ klass += " red" ;
313+ }
314+ }
315+ return klass ;
316+ } ,
317+
301318 picking_detail_options_for_set_lot : function ( ) {
302319 return {
303320 key_title : "product.display_name" ,
@@ -321,7 +338,7 @@ const Reception = {
321338 {
322339 path : "lot.expiration_date" ,
323340 label : "Expiry date" ,
324- klass : "loud" ,
341+ klass : this . _get_lot_expiration_date_klass ( ) ,
325342 renderer : ( rec , field ) => {
326343 return this . utils . display . format_date_display (
327344 _ . result ( rec , field . path ) ,
You can’t perform that action at this time.
0 commit comments