#9 feat(Tryton): add address_external_id to tryton.
This commit is contained in:
		| @@ -214,6 +214,8 @@ class TrytonSale: | ||||
|     def to_tryton(self): | ||||
|         return { | ||||
|             "company": 1, | ||||
|             "shipment_address": self.sale.customer.address_external_id, | ||||
|             "invoice_address": self.sale.customer.address_external_id, | ||||
|             "currency": 1, | ||||
|             "description": self.sale.description or '', | ||||
|             "party": self.sale.customer.external_id, | ||||
|   | ||||
| @@ -18,7 +18,8 @@ class TestExportarVentasParaTryton(TestCase): | ||||
|         ) | ||||
|         self.customer = Customer.objects.create( | ||||
|             name='Camilo', | ||||
|             external_id=1 | ||||
|             external_id=1, | ||||
|             address_external_id=1 | ||||
|         ) | ||||
|         self.sale = Sale.objects.create( | ||||
|             customer=self.customer, | ||||
| @@ -99,4 +100,4 @@ class TestExportarVentasParaTryton(TestCase): | ||||
|         self.assertEqual(updated_sale.external_id, external_id) | ||||
|         mock_connect.assert_called_once() | ||||
|         mock_call.assert_called_once() | ||||
|         mock_call.assert_called_with('model.sale.sale.create', [[{'company': 1, 'currency': 1, 'description': '', 'party': '1', 'reference': 'don_confiao 1', 'sale_date': {'__class__': 'date', 'year': 2024, 'month': 9, 'day': 2}, 'lines': [['create', [{'product': '1', 'quantity': {'__class__': 'Decimal', 'decimal': '2.00'}, 'type': 'line', 'unit': '1', 'unit_price': {'__class__': 'Decimal', 'decimal': '3000.00'}}, {'product': '1', 'quantity': {'__class__': 'Decimal', 'decimal': '3.00'}, 'type': 'line', 'unit': '1', 'unit_price': {'__class__': 'Decimal', 'decimal': '5000.00'}}]]]}], {}]) | ||||
|         mock_call.assert_called_with('model.sale.sale.create', [[{'company': 1, 'shipment_address': '1', 'invoice_address': '1', 'currency': 1, 'description': '', 'party': '1', 'reference': 'don_confiao 1', 'sale_date': {'__class__': 'date', 'year': 2024, 'month': 9, 'day': 2}, 'lines': [['create', [{'product': '1', 'quantity': {'__class__': 'Decimal', 'decimal': '2.00'}, 'type': 'line', 'unit': '1', 'unit_price': {'__class__': 'Decimal', 'decimal': '3000.00'}}, {'product': '1', 'quantity': {'__class__': 'Decimal', 'decimal': '3.00'}, 'type': 'line', 'unit': '1', 'unit_price': {'__class__': 'Decimal', 'decimal': '5000.00'}}]]]}], {}]) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user