[I18N] website_sale_aplicoop: remove legacy week draft strings
This commit is contained in:
parent
ff87243476
commit
813c8071d9
6 changed files with 106 additions and 85 deletions
|
|
@ -667,3 +667,54 @@ class TestConfirmEskaera_Integration(TransactionCase):
|
|||
existing_order.invalidate_recordset()
|
||||
self.assertEqual(len(existing_order.order_line), 1)
|
||||
self.assertEqual(existing_order.order_line[0].product_uom_qty, 5)
|
||||
|
||||
@patch("odoo.http.request")
|
||||
def test_confirm_eskaera_ignores_old_period_draft(self, mock_request):
|
||||
"""Old draft from previous pickup_date must not be reused."""
|
||||
mock_request.env = self.env.with_user(self.user)
|
||||
mock_request.env.lang = "es_ES"
|
||||
mock_request.httprequest = Mock()
|
||||
|
||||
old_draft = self.env["sale.order"].create(
|
||||
{
|
||||
"partner_id": self.partner.id,
|
||||
"group_order_id": self.group_order.id,
|
||||
"state": "draft",
|
||||
"pickup_date": date.today() - timedelta(days=7),
|
||||
"order_line": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"product_id": self.product.id,
|
||||
"product_uom_qty": 1,
|
||||
"price_unit": 20.0,
|
||||
},
|
||||
)
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
data = {
|
||||
"order_id": self.group_order.id,
|
||||
"items": [
|
||||
{
|
||||
"product_id": self.product.id,
|
||||
"quantity": 4,
|
||||
"product_price": 20.0,
|
||||
}
|
||||
],
|
||||
"is_delivery": False,
|
||||
}
|
||||
|
||||
mock_request.httprequest.data = json.dumps(data).encode("utf-8")
|
||||
|
||||
response = self.controller.confirm_eskaera()
|
||||
response_data = json.loads(response.data.decode("utf-8"))
|
||||
|
||||
self.assertTrue(response_data.get("success"))
|
||||
self.assertNotEqual(response_data["sale_order_id"], old_draft.id)
|
||||
|
||||
old_draft.invalidate_recordset()
|
||||
self.assertEqual(old_draft.state, "draft")
|
||||
self.assertEqual(old_draft.order_line[0].product_uom_qty, 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue