Skip to content

Commit

Permalink
[10.0][FIX][sale_product_set] incompatibility with sale_margin (OCA#519)
Browse files Browse the repository at this point in the history
* when a set is added to a sales order, it passes the unit of measure
of the product to the sales order line. Fixes an incompatibility with
module sale_margin.
  • Loading branch information
MiquelRForgeFlow authored and phuctranfxvn committed Dec 27, 2020
1 parent 4cfc812 commit 4e4325c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sale_product_set/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
'name': 'Sale product set',
'category': 'Sale',
'author': 'Anybox, Odoo Community Association (OCA)',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'sequence': 150,
'website': 'http://anybox.fr',
'website': 'https://github.com/OCA/sale-workflow',
'summary': "Sale product set",
'depends': [
'sale',
Expand Down
7 changes: 5 additions & 2 deletions sale_product_set/wizard/product_set_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ def add_set(self):

def prepare_sale_order_line_data(self, sale_order_id, set, set_line,
max_sequence=0):
return {
sale_line = self.env['sale.order.line'].new({
'order_id': sale_order_id,
'product_id': set_line.product_id.id,
'product_uom_qty': set_line.quantity * self.quantity,
'product_uom': set_line.product_id.uom_id.id,
'sequence': max_sequence + set_line.sequence,
}
})
sale_line.product_id_change()
line_values = sale_line._convert_to_write(sale_line._cache)
return line_values

0 comments on commit 4e4325c

Please sign in to comment.