Skip to content

Commit

Permalink
add missing method get_operations
Browse files Browse the repository at this point in the history
code is authored by @hparfr
  • Loading branch information
lepistone committed Jun 13, 2016
1 parent 1f250c1 commit 7df8f80
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion delivery_carrier_label_roulier_laposte/stock_quant_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Sébastien BEAU
##############################################################################

from openerp import models, fields
from openerp import models, fields, api


class StockQuantPackage(models.Model):
Expand All @@ -21,3 +21,15 @@ class StockQuantPackage(models.Model):
help="True if size of package is not standard (according to carrier)",
default=False,
)

@api.multi
def get_operations(self):
"""Get operations of the package.
Usefull for having products and quantities
"""
self.ensure_one()
return self.env['stock.pack.operation'].search([
('result_package_id', '=', self.id),
('product_id', '!=', False),
])

0 comments on commit 7df8f80

Please sign in to comment.