sale_order.py 772 B

1234567891011121314151617181920
  1. # -*- encoding: utf-8 -*-
  2. ##############################################################################
  3. # For copyright and license notices, see __openerp__.py file in root directory
  4. ##############################################################################
  5. from openerp import models, api
  6. class sale_order(models.Model):
  7. _inherit = 'sale.order'
  8. @api.one
  9. def copy(self, default=None):
  10. sale_copy = super(sale_order, self).copy(default)
  11. # we unlink pack lines that should not be copied
  12. pack_copied_lines = sale_copy.order_line.filtered(
  13. lambda l: l.pack_parent_line_id.order_id == self)
  14. pack_copied_lines.unlink()
  15. return sale_copy
  16. # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: