[18.0] [REF] quotation api - #1663
Conversation
a0d0798 to
4674e65
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 18.0 #1663 +/- ##
==========================================
+ Coverage 96.99% 97.06% +0.06%
==========================================
Files 244 271 +27
Lines 5125 5817 +692
Branches 198 226 +28
==========================================
+ Hits 4971 5646 +675
- Misses 92 107 +15
- Partials 62 64 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
metaminux
left a comment
There was a problem hiding this comment.
Hello @paradoxxxzero
Theoretically, the second commit should only modify files from the sale_cart module, but it adds pyproject.toml, CONTRIBUTORS.md and DESCRIPTION.md from other modules.
The ".rst" countepart files are removed from those modules later...
| <field name="inherit_id" ref="sale.view_quotation_tree"/> | ||
| <field name="arch" type="xml"> | ||
| <field name="state" position="attributes"> | ||
| <attribute name="invisible">1</attribute> |
There was a problem hiding this comment.
| <attribute name="invisible">1</attribute> | |
| <attribute name="column_invisible">1</attribute> |
| from odoo import Command | ||
| from odoo.exceptions import ValidationError | ||
| from odoo.tests.common import TransactionCase | ||
|
|
||
|
|
||
| class TestShopOrderMode(TransactionCase): | ||
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass() | ||
|
|
There was a problem hiding this comment.
| from odoo import Command | |
| from odoo.exceptions import ValidationError | |
| from odoo.tests.common import TransactionCase | |
| class TestShopOrderMode(TransactionCase): | |
| @classmethod | |
| def setUpClass(cls): | |
| super().setUpClass() | |
| from odoo import Command | |
| from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT | |
| from odoo.exceptions import ValidationError | |
| from odoo.tests.common import TransactionCase | |
| class TestShopOrderMode(TransactionCase): | |
| @classmethod | |
| def setUpClass(cls): | |
| super().setUpClass() | |
| cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) | |
| from odoo import Command | ||
| from odoo.tests.common import TransactionCase | ||
|
|
||
|
|
||
| class TestQuotation(TransactionCase): | ||
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass() | ||
|
|
There was a problem hiding this comment.
| from odoo import Command | |
| from odoo.tests.common import TransactionCase | |
| class TestQuotation(TransactionCase): | |
| @classmethod | |
| def setUpClass(cls): | |
| super().setUpClass() | |
| from odoo import Command | |
| from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT | |
| from odoo.tests.common import TransactionCase | |
| class TestQuotation(TransactionCase): | |
| @classmethod | |
| def setUpClass(cls): | |
| super().setUpClass() | |
| cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) | |
| customer_quotations.write({"quotation_state": "accepted", "typology": "sale"}) | ||
| return super().action_confirm() |
There was a problem hiding this comment.
| customer_quotations.write({"quotation_state": "accepted", "typology": "sale"}) | |
| return super().action_confirm() | |
| customer_quotations.write({"typology": "sale"}) | |
| return super().action_confirm() |
quotation_state will be recomputed when state is updated by calling super(), right ?
| customer_quotations.quotation_state = "draft" | ||
| customer_quotations.filtered( | ||
| lambda so: so.typology != "quote" | ||
| ).typology = "quote" | ||
| return super().action_draft() |
There was a problem hiding this comment.
| customer_quotations.quotation_state = "draft" | |
| customer_quotations.filtered( | |
| lambda so: so.typology != "quote" | |
| ).typology = "quote" | |
| return super().action_draft() | |
| customer_quotations.filtered( | |
| lambda so: so.typology != "quote" | |
| ).write({"typology": "quote"}) | |
| return super().action_draft() |
Same question as before, is it useful, quotation_state will be recomputed when state is updated, right ?
Also, without ensure_one(), I think we should use a write here to avoid "Expected singleton" errors
This is a forward port of #1597 with some changes to the helper to try a better integration with the new router helper.