Feat: Endpoint Sale POST

This commit is contained in:
2025-01-17 17:16:43 -05:00
parent d745ee12e3
commit 6afd7795a7
2 changed files with 70 additions and 18 deletions

View File

@@ -202,3 +202,37 @@ class DonConfiaoApiRouteTestCase(
}))
self.assertEqual(response.status_code, HTTPStatus.OK)
# def test_post_sale(self):
# pool = Pool(DB_NAME)
# transaction = Transaction().start(DB_NAME, user=0)
# with transaction:
# party = pool.get('party.party').search([])[0]
# company, = pool.get('company.company').search([])
# currency, = pool.get('currency.currency').search([])
# product = pool.get('product.product').search([
# ('salable', '=', True)])[0]
# uom = pool.get('product.uom').search([])[0]
# client = self.client()
# response = client.post(
# f'/{self.db_name}/sale_don_confiao/post_sale',
# headers={
# 'Authorization': f'bearer {self.key}',
# }, data=json.dumps({
# "party": party.id,
# "company": company.id,
# # "currency": currency.id,
# # "invoice_method": "order",
# # "shipment_method": "order",
# # "lines": [["create", [{
# # "type": "line",
# # "product": product.id,
# # "quantity": "1",
# # "unit_price": "10",
# # "unit": uom.id
# # }]]],
# # "state": "draft"
# }))
# self.assertEqual(response.status_code, HTTPStatus.OK)