-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Karthi] | BAH-3619 | Refactor. Batch number is visible in the delive…
…ry order. (#72)
- Loading branch information
1 parent
7a9a760
commit 7c1d113
Showing
3 changed files
with
36 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
from . import pos | ||
from . import account_invoice | ||
from . import shop | ||
from . import stock_move |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from odoo import models | ||
|
||
|
||
class StockMove(models.Model): | ||
_inherit = 'stock.move' | ||
|
||
def _update_reserved_quantity(self, need, available_quantity, | ||
location_id, lot_id=None, | ||
package_id=None, owner_id=None, | ||
strict=True): | ||
if self.sale_line_id.lot_id: | ||
lot_id = self.sale_line_id.lot_id | ||
return super()._update_reserved_quantity( | ||
need, available_quantity, location_id, lot_id=lot_id, | ||
package_id=package_id, owner_id=owner_id, strict=strict) | ||
|
||
def _prepare_move_line_vals(self, quantity=None, reserved_quant=None): | ||
vals = super()._prepare_move_line_vals( | ||
quantity=quantity, reserved_quant=reserved_quant) | ||
lot = self.sale_line_id.lot_id | ||
if reserved_quant and lot: | ||
vals['lot_id'] = lot.id | ||
return vals |