-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
base_delivery_carrier_files module migration to Odoo v8 #47
base_delivery_carrier_files module migration to Odoo v8 #47
Conversation
1 similar comment
|
||
class delivery_carrier(orm.Model): | ||
carrier_file = self.browse(carrier_file_id) | ||
return self._generate_files(carrier_file, picking_ids) |
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.
Here you can call
carrier_file._generate_files(picking_ids)
And rewrite _generate_files to use self instead of carrier_file
Hello, Thanks for the work done here. I added few inline comments. |
@pedrobaeza I was busy the whole month but started working on it just yesterday. The problem is that the latest odoo updates broke the module and some unexpected errors showed up. I am working to fix them right now |
OK, just tell me if you need help. |
There is an issue which affects this module(prevents execution of test/carrier_file_manual.yml). It will work after odoo/odoo#4936 is merged. |
We should make a workaround meanwhile. Can you empty that field in your module? |
Well, it really is outside the scope of this module. The only workaround we could do is to comment out the test itself. |
If you docummented the reason why you do it (putting that due to the issue #...), I think it can be a solution. |
try: | ||
# Instead of replacing everything, append to existing context | ||
if self.with_context(**context)._write_file( | ||
filename, file_content): |
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.
./base_delivery_carrier_files/carrier_file.py:105:5: E125 continuation line with same indent as next logical line
Please add 4 spaces here so we can see it is not part of the block
Thanks for you changes, I added some more remarks. |
created @kkarolis in the OCA database, but we don't have a CLA as far as I can tell. |
auto=False, recreate=self.recreate) | ||
return {'type': 'ir.actions.act_window_close'} | ||
|
||
pickings = fields.Many2many('stock.picking', |
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 did you renamed this m2m removing ids
?
By convention we use _ids
everywhere for o2m and m2m
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 the convention was to use ids because it actually was ids previously, now its just a recordset right? I even remember a similar remark regarding this earlier in this MR. Do you still wish me to rename 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.
We have talked about this in some occassions, and the "convention" is not clear. It's very confused to have code like this: self.line_id.order_id.picking_ids.ids
. I also prefer this naming convention. I already do in all my new modules. The only thing is that it must have oldname='picking_ids'
for easying migration path.
@kkarolis The diff is not clean, could you rebase instead of doing merges? |
cdaa14e
to
27843fc
Compare
Hey, I have made the changes, however I still need some help regarding the travis fails. The issue is the one I mentioned earlier, thanks :) |
@kkarolis What if you define the state field in yaml file ? A previous hack which was working in earlier version for computed store fields was to do something like that: Otherwise it could be due to selection redefinition: odoo/odoo#2797 |
I have tried, adding from openerp.osv import fields
class stock_picking(models.Model):
_inherit = 'stock.picking'
_columns = {
'state': fields.selection([
('draft', 'Draft'),
('cancel', 'Cancelled'),
('waiting', 'Waiting Another Operation'),
('confirmed', 'Waiting Availability'),
('partially_available', 'Partially Available'),
('assigned', 'Ready to Transfer'),
('done', 'Transferred')], string='State'),
}
from openerp import fields |
Thanks for the migration! |
What left to do that we can merge it to 8.0? |
@komsas There is still the error in tests, it might requires to stick to old API in this case. Plus reporting the issue on Odoo |
Can you do a rebase to get travis status ? |
b2c8a21
to
e86b680
Compare
@kkarolis Sorry I missed your rebase 👍 |
Hi, How do you fix undefined method get? We are having the same issue in OCA/l10n-brazil#342, on sale field amount_untaxed with track_visibility='aways' Thanks in advance |
Add search by E-Nr. on Many2one fields
No description provided.