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

[FIX] Warings about using openupgradelib #458

Merged
merged 4 commits into from
Apr 2, 2016
Merged

[FIX] Warings about using openupgradelib #458

merged 4 commits into from
Apr 2, 2016

Conversation

m1k3lm
Copy link
Member

@m1k3lm m1k3lm commented Mar 22, 2016

No description provided.

@@ -746,7 +746,10 @@ def _get_uom_id(self, cr, uid, *args):
def _check_uom(self, cr, uid, ids, context=None):
for supplier_info in self.browse(cr, uid, ids, context=context):
if supplier_info.product_uom and supplier_info.product_uom.category_id.id <> supplier_info.product_id.uom_id.category_id.id:
return False
Copy link
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Copy link
Member Author

Choose a reason for hiding this comment

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

The real problem here is in

def _get_uom_id(self, cr, uid, *args):
    cr.execute('select id from product_uom order by id limit 1')
    res = cr.fetchone()
    return res and res[0] or False

That sets the same uom to all supplier_info and causes error if products have uom of different categories. Didn't know how to fix _get_uom_id function so I needed to fix it here to have the migration done.

Copy link
Member

Choose a reason for hiding this comment

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

@StefanRijnhart
Copy link
Member

Thank you for your contributions to the project! Have you signed the OCA CLA, so that we can start adopting them?

@m1k3lm
Copy link
Member Author

m1k3lm commented Mar 22, 2016

Thank you very much for your review, @StefanRijnhart !

@StefanRijnhart
Copy link
Member

Thanks for the update. Still waiting for the CLA!

@m1k3lm
Copy link
Member Author

m1k3lm commented Apr 2, 2016

I've already sent the signed documento and got the response. What more should i do?

@StefanRijnhart
Copy link
Member

Indeed, I just checked your entry in the Odoo community database and I see that there was a typo in your Github handle, which is why the CLA-bot did not report back on this PR properly. All good now, thanks!

@@ -32,4 +32,4 @@

_modules = __import__(_new_name, globals(), locals(), ['*'])
for _i in dir(_modules):
locals()[_i] = getattr(_modules, _i)
locals()[_i] = getattr(_modules, _i)
Copy link
Member

Choose a reason for hiding this comment

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

Why do you remove the last line here? Anyway, I think this is not needed anymore as you have replaced all the imports.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I see, might be I accidentally deleted the last newline char.

@oca-clabot
Copy link

Hey @m1k3lm,
We acknowledge that the following users have signed our Contributor License Agreement:

Appreciation of efforts,
OCA CLAbot

@pedrobaeza
Copy link
Member

👍

@hbrunn
Copy link
Member

hbrunn commented Apr 2, 2016

taking #458 (comment) as an implicit thumbs up, we have three: 👍

@hbrunn hbrunn merged commit 83614f5 into OCA:6.0 Apr 2, 2016
@m1k3lm
Copy link
Member Author

m1k3lm commented Apr 2, 2016

Thanks all for your review!

@m1k3lm m1k3lm deleted the 6.0 branch April 2, 2016 14:48
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.

5 participants