mirror of
https://gitlab.com/datalifeit/trytond-stock_last_price
synced 2023-12-14 04:52:59 +01:00
"Sequence and tree editable migration to 6.0 [SKIP CI]."
This commit is contained in:
parent
12b4c40fab
commit
0686f9ddcf
4
sale.py
4
sale.py
|
@ -14,7 +14,7 @@ class SaleLine:
|
|||
__metaclass__ = PoolMeta
|
||||
|
||||
last_prices = fields.Function(
|
||||
fields.One2Many('sale.line', None, 'Last prices',
|
||||
fields.Many2Many('sale.line', None, None, 'Last prices',
|
||||
domain=[('product', '=', Eval('product'))],
|
||||
depends=['product']),
|
||||
'get_last_prices')
|
||||
|
@ -43,7 +43,7 @@ class SaleLine:
|
|||
(sale.id != record.sale.id) &
|
||||
(sale_line.product == record.product.id) &
|
||||
(sale.party == record.sale.party.id) &
|
||||
(sale.state != 'cancel') &
|
||||
(sale.state != 'cancelled') &
|
||||
(sale.sale_date <= record.sale.sale_date)),
|
||||
order_by=(sale_line.product, sale.id),
|
||||
group_by=(sale_line.product, sale.id),
|
||||
|
|
8
stock.py
8
stock.py
|
@ -17,7 +17,7 @@ class Move:
|
|||
__metaclass__ = PoolMeta
|
||||
|
||||
last_prices = fields.Function(
|
||||
fields.One2Many('stock.move', None, 'Last move prices',
|
||||
fields.Many2Many('stock.move', None, None, 'Last move prices',
|
||||
domain=[('product', '=', Eval('product'))],
|
||||
depends=['product']),
|
||||
'get_last_prices')
|
||||
|
@ -57,7 +57,7 @@ class Move:
|
|||
where=((move.product == record.product.id) &
|
||||
(move.shipment != '%s,%s' % (_shipment_name,
|
||||
record.shipment.id)) &
|
||||
(move.state != 'cancel') &
|
||||
(move.state != 'cancelled') &
|
||||
(Column(shipment,
|
||||
Shipment._get_last_price_party_fieldname()) ==
|
||||
_party.id) &
|
||||
|
@ -74,7 +74,7 @@ class Move:
|
|||
class ShipmentLastPriceMixin(object):
|
||||
|
||||
last_prices = fields.Function(
|
||||
fields.One2Many('stock.move', None, 'Last move prices'),
|
||||
fields.Many2Many('stock.move', None, 'Last move prices'),
|
||||
'get_last_prices')
|
||||
|
||||
@classmethod
|
||||
|
@ -101,7 +101,7 @@ class ShipmentLastPriceMixin(object):
|
|||
where=((active_move.shipment ==
|
||||
Concat('%s,' % cls.__name__, record.id)) &
|
||||
(shipment.id != record.id) &
|
||||
(shipment.state != 'cancel') &
|
||||
(shipment.state != 'cancelled') &
|
||||
(Column(shipment,
|
||||
cls._get_last_price_party_fieldname()) ==
|
||||
party.id) &
|
||||
|
|
Loading…
Reference in a new issue