Use explicit order for shipments and invoices on sale and purchase
Closes #15090 (grafted from 05dbc76d7b374aebf7aaef7c03617cbec6c67393) --HG-- branch : 8.0
This commit is contained in:
@@ -205,7 +205,8 @@ class Purchase(
|
||||
], 'Invoice State', readonly=True, required=True, sort=False)
|
||||
to_invoice = fields.Boolean("To Invoice", readonly=True)
|
||||
invoices = fields.Function(fields.Many2Many(
|
||||
'account.invoice', None, None, "Invoices"),
|
||||
'account.invoice', None, None, "Invoices",
|
||||
order=[('id', 'ASC')]),
|
||||
'get_invoices', searcher='search_invoices')
|
||||
invoices_ignored = fields.Many2Many(
|
||||
'purchase.purchase-ignored-account.invoice',
|
||||
@@ -214,12 +215,14 @@ class Purchase(
|
||||
('id', 'in', Eval('invoices', [])),
|
||||
('state', '=', 'cancelled'),
|
||||
],
|
||||
order=[('id', 'ASC')],
|
||||
states={
|
||||
'invisible': ~Eval('invoices_ignored', []),
|
||||
})
|
||||
invoices_recreated = fields.Many2Many(
|
||||
'purchase.purchase-recreated-account.invoice',
|
||||
'purchase', 'invoice', 'Recreated Invoices', readonly=True)
|
||||
'purchase.purchase-recreated-account.invoice',
|
||||
'purchase', 'invoice', 'Recreated Invoices', readonly=True,
|
||||
order=[('id', 'ASC')])
|
||||
origin = fields.Reference(
|
||||
"Origin", selection='get_origin',
|
||||
states={
|
||||
@@ -240,10 +243,12 @@ class Purchase(
|
||||
('exception', 'Exception'),
|
||||
], 'Shipment State', readonly=True, required=True, sort=False)
|
||||
shipments = fields.Function(fields.Many2Many(
|
||||
'stock.shipment.in', None, None, "Shipments"),
|
||||
'stock.shipment.in', None, None, "Shipments",
|
||||
order=[('id', 'ASC')]),
|
||||
'get_shipments', searcher='search_shipments')
|
||||
shipment_returns = fields.Function(fields.Many2Many(
|
||||
'stock.shipment.in.return', None, None, "Shipment Returns"),
|
||||
'stock.shipment.in.return', None, None, "Shipment Returns",
|
||||
order=[('id', 'ASC')]),
|
||||
'get_shipment_returns', searcher='search_shipment_returns')
|
||||
moves = fields.Function(
|
||||
fields.Many2Many('stock.move', None, None, "Stock Moves"),
|
||||
|
||||
@@ -261,7 +261,8 @@ class Sale(
|
||||
], 'Invoice State', readonly=True, required=True, sort=False)
|
||||
to_invoice = fields.Boolean("To Invoice", readonly=True)
|
||||
invoices = fields.Function(fields.Many2Many(
|
||||
'account.invoice', None, None, "Invoices"),
|
||||
'account.invoice', None, None, "Invoices",
|
||||
order=[('id', 'ASC')]),
|
||||
'get_invoices', searcher='search_invoices')
|
||||
invoices_ignored = fields.Many2Many(
|
||||
'sale.sale-ignored-account.invoice', 'sale', 'invoice',
|
||||
@@ -270,12 +271,14 @@ class Sale(
|
||||
('id', 'in', Eval('invoices', [])),
|
||||
('state', '=', 'cancelled'),
|
||||
],
|
||||
order=[('id', 'ASC')],
|
||||
states={
|
||||
'invisible': ~Eval('invoices_ignored', []),
|
||||
})
|
||||
invoices_recreated = fields.Many2Many(
|
||||
'sale.sale-recreated-account.invoice', 'sale', 'invoice',
|
||||
'Recreated Invoices', readonly=True)
|
||||
'Recreated Invoices', readonly=True,
|
||||
order=[('id', 'ASC')])
|
||||
shipment_method = fields.Selection([
|
||||
('manual', 'Manual'),
|
||||
('order', 'On Order Processed'),
|
||||
@@ -294,10 +297,12 @@ class Sale(
|
||||
], "Shipment State", readonly=True, required=True, sort=False)
|
||||
to_ship = fields.Boolean("To Ship", readonly=True)
|
||||
shipments = fields.Function(fields.Many2Many(
|
||||
'stock.shipment.out', None, None, "Shipments"),
|
||||
'stock.shipment.out', None, None, "Shipments",
|
||||
order=[('id', 'ASC')]),
|
||||
'get_shipments', searcher='search_shipments')
|
||||
shipment_returns = fields.Function(fields.Many2Many(
|
||||
'stock.shipment.out.return', None, None, "Shipment Returns"),
|
||||
'stock.shipment.out.return', None, None, "Shipment Returns",
|
||||
order=[('id', 'ASC')]),
|
||||
'get_shipment_returns', searcher='search_shipment_returns')
|
||||
moves = fields.Function(
|
||||
fields.Many2Many('stock.move', None, None, "Stock Moves"),
|
||||
|
||||
Reference in New Issue
Block a user