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

[8.0][stock_picking_package_info] entirely package transfer #1076

Open
dhongu opened this issue Nov 21, 2015 · 2 comments
Open

[8.0][stock_picking_package_info] entirely package transfer #1076

dhongu opened this issue Nov 21, 2015 · 2 comments

Comments

@dhongu
Copy link

dhongu commented Nov 21, 2015

In case of entirely package move field result_package_id from stock_pack_operation is empty.

I propose the following changes stock_picking.py

class StockPicking(models.Model):
    _inherit = 'stock.picking'

    @api.multi
    @api.depends('pack_operation_ids', 'pack_operation_ids.result_package_id')
    def _calc_picking_packages(self):

        for record in self:
            packages = self.env['stock.quant.package']
            for op in record.pack_operation_ids:
                if op.result_package_id:
                    packages |= op.result_package_id
                elif op.package_id:
                    packages |= op.package_id

            record.packages = packages
            #record.packages = record.pack_operation_ids.mapped( 'result_package_id')
@anajuaristi
Copy link
Contributor

I don't understand the problem. If you assing the correct packages on transfer lines, it works. So I don't see the need of adding new code.

@pedrobaeza opinion?

@pedrobaeza
Copy link
Member

I do, Ana. He's referring to the case when you are not packing something, but just using an already stored package. I see the patch correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants