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

base_delivery_carrier_files module migration to Odoo v8 #47

Merged
merged 1 commit into from
Apr 8, 2016

Conversation

kkarolis
Copy link

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling f2d3a2e on kkarolis:base_delivery_carrier_files_migration into 75a0207 on OCA:8.0.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling f2d3a2e on kkarolis:base_delivery_carrier_files_migration into 75a0207 on OCA:8.0.


class delivery_carrier(orm.Model):
carrier_file = self.browse(carrier_file_id)
return self._generate_files(carrier_file, picking_ids)
Copy link
Member

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

@yvaucher
Copy link
Member

yvaucher commented Jan 5, 2015

Hello,

Thanks for the work done here. I added few inline comments.
Plus, don't forget to move the module out of __unported__ directory

@pedrobaeza
Copy link
Member

@kkarolis any news on @yvaucher's remarks?

@kkarolis
Copy link
Author

@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

@pedrobaeza
Copy link
Member

OK, just tell me if you need help.

@kkarolis
Copy link
Author

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.

@pedrobaeza
Copy link
Member

We should make a workaround meanwhile. Can you empty that field in your module?

@kkarolis
Copy link
Author

Well, it really is outside the scope of this module. The only workaround we could do is to comment out the test itself.

@pedrobaeza
Copy link
Member

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):
Copy link
Member

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

@yvaucher
Copy link
Member

Thanks for you changes, I added some more remarks.
About commenting a test, I feel it is quite a regression unless you explain why. I could be comprehensible for a temporary bug on official branch that need fixing with no easy work around.

@gurneyalex
Copy link
Member

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',
Copy link
Member

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

Copy link
Author

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?

Copy link
Member

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.

@yvaucher
Copy link
Member

yvaucher commented Apr 8, 2015

@kkarolis The diff is not clean, could you rebase instead of doing merges?

@kkarolis kkarolis force-pushed the base_delivery_carrier_files_migration branch from cdaa14e to 27843fc Compare April 8, 2015 20:50
@kkarolis
Copy link
Author

kkarolis commented Apr 9, 2015

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 :)

@yvaucher
Copy link
Member

yvaucher commented Apr 9, 2015

@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:
odoo/odoo#3922 (comment)

Otherwise it could be due to selection redefinition: odoo/odoo#2797

@kkarolis
Copy link
Author

kkarolis commented Apr 9, 2015

I have tried, adding state: 'draft' to related pickings without any success. I have also tried inserting the following block model with older api, however the issue still remains.

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

@tremlin
Copy link

tremlin commented Apr 20, 2015

Thanks for the migration!
I have no idea how to fix the yaml demo error except by reverting the state field of stock.picking completely back to the old API. If you decide to keep the new API, then the _state_get method of stock.picking should have the same signature as the _state_get from the core. That is, it should take additional arguments field_name and arg and it should return a dictionary instead of None. Besides of this incompatibility the code worked fine for me.

@paulius-sladkevicius
Copy link

What left to do that we can merge it to 8.0?

@yvaucher
Copy link
Member

@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

@oca-clabot
Copy link

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

Appreciation of efforts,
OCA CLAbot

@yvaucher
Copy link
Member

yvaucher commented Nov 9, 2015

Can you do a rebase to get travis status ?

@kkarolis kkarolis force-pushed the base_delivery_carrier_files_migration branch from b2c8a21 to e86b680 Compare November 11, 2015 05:22
@yvaucher
Copy link
Member

@kkarolis Sorry I missed your rebase

👍

@yvaucher yvaucher merged commit 16fd0e0 into OCA:8.0 Apr 8, 2016
@mileo
Copy link
Member

mileo commented Jun 30, 2016

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

vrenaville pushed a commit to camptocamp/delivery-carrier that referenced this pull request Jul 2, 2018
Add search by E-Nr. on Many2one fields
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.

None yet

10 participants