-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
[ADD] partner_firstname for v8 #14
Conversation
because it's working as is
when creating or copying users
Fixed the error occurring when creating or copying users ✅ |
You have a false positive on Travis. This is the error:
To fix it, I think there must be a routine on init that fills lastname with name value. Regards. |
@pedrobaeza: this is exactly what this function does. Maybe the API has changed the init functions. Either way, it would be nice to have a logger tell us that the lastname field has been filled. |
We have to find then the problem. I wouldn't merge the module until we have this fixed, because it can cause a broken DB, don't you think? Regards. |
This happens because the
|
can |
I love seeing that! 😄 |
It should be overridable, but it does a lot of things and does not have hooks. It creates tables and adds constraints, so overriding it would not solve the problem. Anyway I don't see a big problem with this error. |
I am sorry but, I cannot approve this while there are errors in the logs. |
"It should be overridable, but it does a lot of things and does not have hooks" |
2014-07-26 10:17 GMT-04:30 Raphaël Valyi notifications@github.com:
Absolutly agreed with this point. Saludos Cordiales Nhomar G. Hernandez M. |
how about 'lastname': fields.char(...., oldname='name')? |
I get
|
I fixed the error overriding I also fixed PEP8 for the whole repo, but travis doesn't collaborate and doesn't rebuild |
cr.execute('SELECT id FROM res_partner WHERE lastname IS NOT NULL ' | ||
'Limit 1') | ||
if not cr.fetchone(): | ||
cr.execute('UPDATE res_partner set lastname = name WHERE name ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you do it always? It will affect 0 or n rows, but it's as fast as making a select.
Please force a Travis rebuild making this in local repository in the updated PR branch:
Regards. |
@pedrobaeza I can restart the build without having to do any amending Done |
OK, as you want. It was only a trick I have discovered, because I don't have on some branches the possibility to make a rebuild on Travis. |
Travis connection error is still there |
I don't know why is this happening. I haven't seen this error before in any repository. |
On 07/30/2014 09:31 AM, Pedro M. Baeza wrote:
It should be a temporary connection problem while downloading a PIP package |
Restarted build |
Still errored from |
I see green at https://travis-ci.org/OCA/partner-contact/builds/31171276 |
Browse cache error, sorry. |
All is well. |
You sure you don't want to convert it to the new api? |
👍 Thanks. |
@bwrsandman I would prefer it too as it is quite a small addons, But nothing was formely decide by OCA. I have allready made this work during partner day work shop. https://code.launchpad.net/~camptocamp/partner-contact-management/partner-first-name-new-api-v8 I should port this MP to github now that view and model are mostly frozen. Regards Nicolas |
I have a feeling that if we don't port while converting to v8 (which we often do minimalistically), we will only have modules in the new API from people who feel like doing it. @nbessi Can your openerp-conventions be made to test for the new API this on v8s? |
'SET NOT NULL') | ||
_logger.info("NOT NULL constraint for " | ||
"res_partner.lastname correctly set") | ||
return res | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to not use install hooks?
odoo/odoo@4105b5f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to not use install hooks?
odoo/odoo@4105b5f
odoo/odoo@4105b5f
How?
Anyway, I think _set_default_value_on_column
is the right place to
do it, as we are doing just that: setting a default value for the new
column lastname
and adding the NOT NULL constraint on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading the code in openerp.models, you're right, the set_default_value_on_column is the right way to do it since it's only called on the first installation or when upgrading the module 'ONLY' if the 'Not null' constrains is not yet applied. In proposing the 'install hooks', I wanted to avoid that this operation (_set_default_value_on_calumn) is called each time the module is upgraded.
On 07/30/2014 04:50 PM, Sandy wrote:
I'm sure it would be good 😏 I just have no time in these days. |
I tired it. It is not an easy port... Coverting create to However, using the new fields, especially the compute fields are really good. |
@bwrsandman I'm working on convention on my free time. |
We have two approves so far. Are we ready to merge or are there still objections? |
👍 |
👍 - using the new api shouldn't be a prerequisite for porting currently, maybe at a later point. |
Code Cleanup and Rename rectification
because it's working as is