Bug From To
This commit is contained in:
@@ -604,6 +604,31 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
'quantity': Decimal('1'),
|
||||
})
|
||||
|
||||
def test_sale_and_purchase_parent_write_check_embedded_line_commands(self):
|
||||
'sale and purchase writes validate embedded one2many line commands'
|
||||
Sale = Pool().get('sale.sale')
|
||||
Purchase = Pool().get('purchase.purchase')
|
||||
invalid = Mock(
|
||||
from_del=datetime.date(2026, 4, 16),
|
||||
to_del=datetime.date(2026, 4, 10),
|
||||
)
|
||||
|
||||
with patch('trytond.modules.purchase_trade.sale.Pool') as SalePool:
|
||||
SalePool.return_value.get.return_value = Mock(
|
||||
browse=Mock(return_value=[invalid]))
|
||||
with self.assertRaises(UserError):
|
||||
Sale._check_lines_delivery_period_values({
|
||||
'lines': [['write', [564], {'quantity': Decimal('1')}]],
|
||||
})
|
||||
|
||||
with patch('trytond.modules.purchase_trade.purchase.Pool') as PurchasePool:
|
||||
PurchasePool.return_value.get.return_value = Mock(
|
||||
browse=Mock(return_value=[invalid]))
|
||||
with self.assertRaises(UserError):
|
||||
Purchase._check_lines_delivery_period_values({
|
||||
'lines': [['add', [564]]],
|
||||
})
|
||||
|
||||
def test_pricing_eod_uses_weighted_average_for_manual_rows(self):
|
||||
'manual pricing eod uses the weighted average of fixed and unfixed legs'
|
||||
Pricing = Pool().get('pricing.pricing')
|
||||
|
||||
Reference in New Issue
Block a user