|
1 | 1 | # Copyright 2022-2024 Tecnativa - Víctor Martínez
|
| 2 | +# Copyright 2024 Tecnativa - Carolina Fernandez |
2 | 3 | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
|
3 | 4 |
|
4 | 5 | from odoo import fields
|
5 | 6 | from odoo.tests import Form, common, new_test_user
|
6 | 7 | from odoo.tests.common import users
|
7 | 8 |
|
8 |
| -from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT |
9 |
| - |
10 | 9 |
|
11 | 10 | class TestAccountMove(common.TransactionCase):
|
12 | 11 | @classmethod
|
13 | 12 | def setUpClass(cls):
|
14 | 13 | super().setUpClass()
|
| 14 | + DISABLED_MAIL_CONTEXT = { |
| 15 | + "tracking_disable": True, |
| 16 | + "mail_create_nolog": True, |
| 17 | + "mail_create_nosubscribe": True, |
| 18 | + "mail_notrack": True, |
| 19 | + "no_reset_password": True, |
| 20 | + } |
15 | 21 | cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
|
16 | 22 | new_test_user(
|
17 | 23 | cls.env, login="test-account-user", groups="account.group_account_invoice"
|
@@ -60,6 +66,7 @@ def _create_invoice(self, move_type="in_invoice"):
|
60 | 66 | move_form.invoice_date = fields.Date.from_string("2000-01-01")
|
61 | 67 | with move_form.invoice_line_ids.new() as line_form:
|
62 | 68 | line_form.product_id = self.product_a
|
| 69 | + line_form.name = "Product A\nTest description product A\nB" |
63 | 70 | line_form.quantity = 2
|
64 | 71 | with move_form.invoice_line_ids.new() as line_form:
|
65 | 72 | line_form.product_id = self.product_b
|
@@ -92,8 +99,8 @@ def test_invoice_action_post_equipment_1(self):
|
92 | 99 | self.assertEqual(len(line_a.equipment_ids), 2)
|
93 | 100 | self.assertEqual(len(line_b.equipment_ids), 0)
|
94 | 101 | equipment = fields.first(equipments)
|
95 |
| - self.assertEqual(equipment.name, self.product_a.name) |
96 |
| - self.assertEqual(equipment.product_id, self.product_a) |
| 102 | + self.assertEqual(equipment.name, "Product A") |
| 103 | + self.assertEqual(equipment.note, "<p>Test description product A<br>B</p>") |
97 | 104 | self.assertEqual(equipment.category_id.product_category_id, self.categ)
|
98 | 105 | self.assertEqual(equipment.assign_date, invoice.date)
|
99 | 106 | self.assertEqual(equipment.effective_date, invoice.date)
|
|
0 commit comments