blob: 2ab94c2c34e18dec0dcce536276b20e254f5763a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
class AccountMove(models.Model):
_inherit = 'account.move'
def _get_invoiced_lot_values(self):
self.ensure_one()
lot_values = super(AccountMove, self)._get_invoiced_lot_values()
if self.state == 'draft':
return lot_values
for order in self.pos_order_ids:
for line in order.lines:
lots = line.pack_lot_ids or False
if lots:
for lot in lots:
lot_values.append({
'product_name': lot.product_id.name,
'quantity': line.qty if lot.product_id.tracking == 'lot' else 1.0,
'uom_name': line.product_uom_id.name,
'lot_name': lot.lot_name,
})
return lot_values
|