Product origin Melya
This commit is contained in:
@@ -2655,6 +2655,38 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
{'label': 'FREIGHT value in EUR', 'amount': Decimal('25')},
|
||||
])
|
||||
|
||||
def test_fee_delete_detects_generated_ordered_purchase(self):
|
||||
'ordered fee deletion targets only its generated service purchase'
|
||||
Fee = Pool().get('fee.fee')
|
||||
|
||||
fee = Fee()
|
||||
fee.id = 10
|
||||
fee.type = 'ordered'
|
||||
purchase = Mock(
|
||||
id=20,
|
||||
line_type='service',
|
||||
lines=[Mock(fee_=fee)])
|
||||
fee.purchase = purchase
|
||||
|
||||
self.assertEqual(
|
||||
Fee._get_generated_purchases_to_delete([fee]),
|
||||
[purchase])
|
||||
|
||||
def test_fee_delete_ignores_unrelated_purchase(self):
|
||||
'ordered fee deletion does not delete purchases with unrelated lines'
|
||||
Fee = Pool().get('fee.fee')
|
||||
|
||||
fee = Fee()
|
||||
fee.id = 10
|
||||
fee.type = 'ordered'
|
||||
purchase = Mock(
|
||||
id=20,
|
||||
line_type='service',
|
||||
lines=[Mock(fee_=Mock(id=99))])
|
||||
fee.purchase = purchase
|
||||
|
||||
self.assertEqual(Fee._get_generated_purchases_to_delete([fee]), [])
|
||||
|
||||
def test_sale_report_converts_mixed_units_for_total_and_words(self):
|
||||
'sale report totals prefer the virtual lot unit as common unit'
|
||||
Sale = Pool().get('sale.sale')
|
||||
|
||||
Reference in New Issue
Block a user