-
-
Notifications
You must be signed in to change notification settings - Fork 75
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 missing field attributes #36
Conversation
Why are these missing? The field is related. Please explain the change. |
@bwrsandman you can make the test |
@bwrsandman in openerp/osv/orm.py ? in __export_row row 1173 |
Ok, I see the error. That's an odoo bug. One thing to fix, though. Don't duplicate the states, just factor them into a class-less function in travel.py def _get_states(self, cr, uid, ids=None, context=None):
return [
('draft', _('Draft')),
('open', _('Saved')),
('booking', _('In Reservation')),
('reserved', _('Reserved')),
('confirmed', _('Confirmed')),
('done', _('Closed')),
] Then use it like this: from openerp.addons.travel.travel import _get_states
# ...
_columns = {
# ...
'state': fields.related(
selection=lambda *a, **kw: _get_states(*a, **kw),
),
# ...
} Also factor the original so the states are only defined once. |
@bwrsandman can you add wip label ? |
cf1b9a4
to
072282c
Compare
@bwrsandman I fixed the issue. You may remove the wip label. Thanks |
('reserved', _('Reserved')), | ||
('confirmed', _('Confirmed')), | ||
('done', _('Closed')), | ||
] |
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.
You're going to need to regenerate the pot files because these terms are now code
072282c
to
950375a
Compare
@@ -25,6 +25,17 @@ | |||
from .res_config import get_basic_passenger_limit | |||
|
|||
|
|||
def _get_travel_states(self, cr, uid, ids=None, context=None): |
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.
Include a reference that this is due to a bug, and even better if there's an open issue about it and it's linked here
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.
@pedrobaeza This is related to a real bug, and there is an issue. The issue is internal to Savoir-faire Linux, not public in the web. I don't see why a comment/reference is required here. If you write a function field of type selection, you must supply a list of selections. This is standard Odoo/Openerp behavior.
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.
I mean the bug in ORM that doesn't resolve this correctly, as mentioned by @bwrsandman. This is only a workaround as ORM is not populating correctly the selection list.
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.
@pedrobaeza This is not a bug in the ORM. The ORM works as designed, with its limitations.
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.
Well, I don't think so. If you put a related field, it's not logical to need again the selection list, but nevertheless, it's not a blocking one. It's only for tracing the problem and if in the future is solved (I think so that it's in v8), you can remove this part
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.
@pedrobaeza @dufresnedavid showed me the bug, it's hard to believe but it is true what he says.
👍 |
👍 review no test |
@max3903 Can you merge this PR please ? |
[FIX] Add missing field attributes
@max3903 @dufresnedavid This repo has been failing since this was merged, please fix before merging anythin else. |
@bwrsandman the travis build was ok in this PR. Why do you think it is related to the current problem ? I would say #38 is the cause of the problem. |
This was merged before #38 and you can see the build starts failing at this merge: |
No description provided.