OCA / stock-logistics-barcode

https://odoo-community.org/psc-teams/logistics-18
GNU Affero General Public License v3.0
160 stars 330 forks source link

[16.0][IMP] barcodes_generator_abstract: Avoid double iteration on base generation #619

Open dalonsofl opened 4 months ago

dalonsofl commented 4 months ago

Module

barcodes_generator_abstract

Describe the bug

The base is changed when it is generated by having the ‘Automatic generation’ marked in the barcode nomenclature.

To Reproduce

  1. Configure the Automatic generation in the barcode nomenclature
  2. Create / Edit a product barcode rule
  3. Press on "Generate base"

(image from runboat OCA)

image

image

image

image

Affected versions:

16.0

Additional context

The problem is that when going through this function inside the barcodes_generator_product it goes back through the generate_base() and a recalculation of the base incorrectly, as it already has one before. With this change it would be solved

OCA-git-bot commented 4 months ago

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

github-actions[bot] commented 6 days ago

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.