mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-25 01:21:59 +02:00
19.0 vanilla
This commit is contained in:
parent
6e54c1af6c
commit
3ca647e428
1087 changed files with 132065 additions and 108499 deletions
18
odoo-bringout-oca-ocb-pos_mrp/pos_mrp/models/stock_move.py
Normal file
18
odoo-bringout-oca-ocb-pos_mrp/pos_mrp/models/stock_move.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockMove(models.Model):
|
||||
_inherit = 'stock.move'
|
||||
|
||||
def _get_price_unit(self):
|
||||
pos_order_line_id = self.env.context.get('pos_order_line_id')
|
||||
bom_id = self.env.context.get('bom_id')
|
||||
if not pos_order_line_id or not bom_id:
|
||||
return super()._get_price_unit()
|
||||
pos_order_line = self.env['pos.order.line'].browse(pos_order_line_id)
|
||||
bom = self.env['mrp.bom'].browse(bom_id)
|
||||
if pos_order_line and bom:
|
||||
return self._get_kit_price_unit(pos_order_line.product_id, bom, pos_order_line.qty)
|
||||
return super()._get_price_unit()
|
||||
Loading…
Add table
Add a link
Reference in a new issue