Skip to content
New issue

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

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

Already on GitHub? # to your account

[12.0][MIG] Migrated product_sequence to v12. #416

Closed

Conversation

sudhir-erpharbor
Copy link
Contributor

Please review and give feedback.

Jordi Esteve and others added 30 commits December 6, 2018 18:25
… reference. The reference (default code) is unique (SQL constraint) and required.
some minor reformatting in the process
Version numbers should only have 2 digits.
In order to get visibility on https://www.odoo.com/apps the OCA board has
decided to add the OCA as author of all the addons maintained as part of the
association.
Add pre_init_hook to manually set nulls and '/' default codes
 to a unique code to greenify branch
add pragma to pre_init method as it must have completed successfully
if module installs
* Migration to v11
* Support sequence by Product Category
@oca-clabot
Copy link

Hey @sudhir-erpharbor, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@atchuthan
Copy link
Member

@pedrobaeza
We have the CLA document for SodexisTeam in https://github.com/OCA/OpenUpgrade/blob/12.0/doc/cla/corporate/sodexis.md

what am I missing?

@pedrobaeza
Copy link
Member

@atchuthan that one is Odoo CLA, not OCA CLA. Did you send OCA ECLA or ICLA? There's also an issue with used emails.

@OCA-git-bot OCA-git-bot mentioned this pull request Dec 7, 2018
24 tasks
@pedrobaeza pedrobaeza added this to the 12.0 milestone Dec 7, 2018
@oca-clabot
Copy link

Hey @sudhir-erpharbor, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@atchuthan
Copy link
Member

@atchuthan that one is Odoo CLA, not OCA CLA. Did you send OCA ECLA or ICLA? There's also an issue with used emails.

OCA ECLA

@oca-clabot
Copy link

Hey @sudhir-erpharbor, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

Copy link

@scigghia scigghia left a comment

Choose a reason for hiding this comment

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

Tested on Odoo 12 CE and works

Copy link

@BT-aestebanez BT-aestebanez left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.
I reviewed the code (translations not reviewed) and I only have three small comments :)
Alvaro

she/he will need to write '/' on the internal reference to force the
re-assignment."""
for product in self:
if vals.get('default_code', '') == '/':
Copy link

@BT-aestebanez BT-aestebanez Jul 30, 2019

Choose a reason for hiding this comment

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

this if could be out of the loop for improving the performance

for product in self:
if vals.get('default_code', '') == '/':
category_id = vals.get('categ_id', product.categ_id.id)
category = self.env['product.category'].browse(category_id)

Choose a reason for hiding this comment

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

what if there is no category?

sequence = self.env.ref(
'product_sequence.seq_product_auto')
ref = sequence.next_by_id()
vals['default_code'] = ref

Choose a reason for hiding this comment

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

are you sure you want to update the main dict? I would say you should update only the values to write in the record of the loop

"to be proposed."
)

_sql_constraints = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Because add sql contraints????

this functionality is added on module product_code_unique

I prefered keep into 2 modules

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I agree

@MiquelRForgeFlow
Copy link
Contributor

This PR should be closed. Superseed by #507.

@pedrobaeza pedrobaeza closed this Oct 8, 2019
QuocDuong1306 pushed a commit to QuocDuong1306/product-attribute that referenced this pull request Aug 9, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.