Skip to content

Conversation

@sbejaoui
Copy link

if the user selects an expiration date and then scans a lot, the expiration date is unintentionally reset, causing data loss
this fix preserves the manually entered expiration date when scanning a lot

@OCA-git-bot
Copy link
Contributor

Hi @simahawk, @JuMiSanAr,
some modules you are maintaining are being modified, check this out!

Copy link

@lmignon lmignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't assign a contextualized name to a generic component. t
That doesn't make sense

v-model="date"
v-bind="attrs"
v-on="on"
name="expiration_date"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't do this here and I would argue on why we have a specific label here if this is a generic widget.
If we really need this, we should use properties. However, I don't think you need this.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, such changes to another module should have its own commit.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was misled by the wording. At first glance, it seems like this widget is dedicated to the expiration date.

I changed the name to "date_picker" to be more generic. Getting the value from input using the selector is way easier than adding hooks to the events

},
on_scan: (barcode) => {
// Scan a lot
const input = document.querySelector('input[name="expiration_date"]');
Copy link

@simahawk simahawk Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should hook to the event provided by the widget instead and collect this info somewhere else (see on_date_picker_selected). As an alternative you can declare a $ref on the widget where it's used (see searchbar for example) .

@sbejaoui sbejaoui force-pushed the 16.0-fix-reception-expiration-date-sbj branch from e740bbf to 21f1157 Compare September 3, 2025 07:16
@sbejaoui sbejaoui requested review from lmignon and simahawk September 3, 2025 07:23
@lmignon lmignon force-pushed the 16.0-fix-reception-expiration-date-sbj branch from 21f1157 to e8d1ac0 Compare September 3, 2025 12:41
if the user selects an expiration date and then scans a lot, the expiration date
is unintentionally reset, causing data loss
this fix preserves the manually entered expiration date when scanning a lot
@lmignon lmignon force-pushed the 16.0-fix-reception-expiration-date-sbj branch from e8d1ac0 to c097661 Compare September 3, 2025 12:44
@lmignon
Copy link

lmignon commented Sep 5, 2025

This PR is no more required. The code has been improved at service level into #1072.

@lmignon lmignon deleted the 16.0-fix-reception-expiration-date-sbj branch September 5, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants