Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][IMP] barcodes_generator_abstract: Add automated generator #77

Conversation

lasley
Copy link
Contributor

@lasley lasley commented Jan 31, 2017

  • Add an option to allow for automatic generation of barcode when a record of mixin model is created

This is dependent on the migration PR:

I'd like the two reviewed independently though to allow for easier back port. Relevant commit 02d2303

Still need to test more & add actual tests, so consider this a PoC.

cc @legalsylvain

@lasley lasley added this to the 10.0 milestone Jan 31, 2017
@lasley lasley force-pushed the release/10.0/barcodes_generator_abstract-auto_generator branch from 15dfe72 to 8812509 Compare February 15, 2017 03:28
* Add an option to allow for automatic generation of barcode when a record of mixin model is created
@lasley lasley force-pushed the release/10.0/barcodes_generator_abstract-auto_generator branch from 8812509 to e7fb1cf Compare February 15, 2017 03:28
@lasley
Copy link
Contributor Author

lasley commented Feb 15, 2017

Rebased now that dependency is merged, this is ready for review!

@legalsylvain
Copy link
Contributor

👍 great improvment ! Thanks.
(code review, no test.)

))
should_clear = True
if should_clear:
self.clear_caches()
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you clear this on create/write when vals contains 'generate_automate' value?

Copy link
Contributor Author

@lasley lasley Feb 18, 2017

Choose a reason for hiding this comment

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

Hmmmm yeah that would work too, although then we'd be splitting the logic into two spots & it would need to be a conjoined if - because this is also clearing cache if generate_model is changed too.

I could remove the somewhat ghetto should_clear as if len(self) instead though, which would remove two lines and be the same level of efficiency.

I do somewhat take reservation to a mutating operation in a constraint though, so it might still be best to bite the bullet and move into the two spots. Any additional thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

For keeping the same logic, just create a new method that is called from both write/create methods. I still miss the wanted @onwrite decorator: odoo/odoo#11042

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh wow I love this @onwrite idea. It also reminded me that I needed to create the API lib from OCA/server-tools#615. I think I'll try to tackle that this weekend.

Also, yeah cool a helper method seems almost excessive, but it is better than code duplication. It's also better than a mutation in a constraint, even if the mutation is just a cache deletion.

* Move cache clearing into create/write & centralize method based on keys in vals
@pedrobaeza pedrobaeza merged commit 7dcc07a into OCA:10.0 Feb 18, 2017
@lasley lasley deleted the release/10.0/barcodes_generator_abstract-auto_generator branch February 18, 2017 20:22
sla-subteno-it pushed a commit to subteno-it/stock-logistics-barcode that referenced this pull request Dec 1, 2017
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
sla-subteno-it pushed a commit to subteno-it/stock-logistics-barcode that referenced this pull request Dec 3, 2017
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
phatnguyenuit pushed a commit to phatnguyenuit/stock-logistics-barcode that referenced this pull request Jan 12, 2018
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
Garamotte pushed a commit to subteno-it/stock-logistics-barcode that referenced this pull request Feb 7, 2018
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
Garamotte pushed a commit to subteno-it/stock-logistics-barcode that referenced this pull request Feb 7, 2018
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
Garamotte pushed a commit to subteno-it/stock-logistics-barcode that referenced this pull request Feb 14, 2018
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
pedrobaeza pushed a commit to Tecnativa/stock-logistics-barcode that referenced this pull request Jun 11, 2018
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
cvinh pushed a commit to cvinh/stock-logistics-barcode that referenced this pull request Aug 13, 2019
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
chafique-delli pushed a commit to akretion/stock-logistics-barcode that referenced this pull request Dec 11, 2020
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
CarlosRoca13 pushed a commit to Tecnativa/stock-logistics-barcode that referenced this pull request Feb 2, 2021
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
Zar21 pushed a commit to Studio73/stock-logistics-barcode that referenced this pull request May 19, 2021
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
Zar21 pushed a commit to Studio73/stock-logistics-barcode that referenced this pull request May 19, 2021
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
sla-subteno-it pushed a commit to subteno-it/stock-logistics-barcode that referenced this pull request Nov 21, 2021
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
sla-subteno-it pushed a commit to subteno-it/stock-logistics-barcode that referenced this pull request Nov 21, 2021
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
legalsylvain pushed a commit to legalsylvain/stock-logistics-barcode that referenced this pull request Oct 24, 2022
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
manuelregidor pushed a commit to sygel-technology/stock-logistics-barcode that referenced this pull request Jan 11, 2023
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
jvandri pushed a commit to Niboo/stock-logistics-barcode that referenced this pull request Mar 20, 2024
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
isaako34 pushed a commit to vauxoo-dev/stock-logistics-barcode that referenced this pull request May 22, 2024
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
isaako34 pushed a commit to vauxoo-dev/stock-logistics-barcode that referenced this pull request May 28, 2024
)

Add an option to allow for automatic generation of barcode when a record of mixin model is created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants