Skip to content

Commit fbb6b64

Browse files
committed
[MIG] sale_fixed_discount: Migration to 19.0
1 parent c81b974 commit fbb6b64

5 files changed

Lines changed: 37 additions & 24 deletions

File tree

sale_fixed_discount/README.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
===================
26
Sale Fixed Discount
37
===================
@@ -13,17 +17,17 @@ Sale Fixed Discount
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
20-
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_fixed_discount
24+
:target: https://github.com/OCA/sale-workflow/tree/19.0/sale_fixed_discount
2125
:alt: OCA/sale-workflow
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_fixed_discount
27+
:target: https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_fixed_discount
2428
:alt: Translate me on Weblate
2529
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=19.0
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -69,7 +73,7 @@ Bug Tracker
6973
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
7074
In case of trouble, please check there if your issue has already been reported.
7175
If you spotted it first, help us to smash it by providing a detailed and welcomed
72-
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_fixed_discount%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
76+
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_fixed_discount%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
7377

7478
Do not contact contributors directly about support or help with technical issues.
7579

@@ -108,6 +112,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
108112
mission is to support the collaborative development of Odoo features and
109113
promote its widespread use.
110114

111-
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_fixed_discount>`_ project on GitHub.
115+
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/19.0/sale_fixed_discount>`_ project on GitHub.
112116

113117
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

sale_fixed_discount/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Sale Fixed Discount",
55
"summary": "Allows to apply fixed amount discounts in sales orders.",
6-
"version": "18.0.1.0.0",
6+
"version": "19.0.1.0.0",
77
"category": "Sales",
88
"website": "https://github.com/OCA/sale-workflow",
99
"author": "ForgeFlow, Odoo Community Association (OCA)",

sale_fixed_discount/models/sale_order_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _prepare_base_line_for_taxes_computation(self, **kwargs):
6464
return self.env["account.tax"]._prepare_base_line_for_taxes_computation(
6565
self,
6666
**{
67-
"tax_ids": self.tax_id,
67+
"tax_ids": self.tax_ids,
6868
"quantity": self.product_uom_qty,
6969
"partner_id": self.order_id.partner_id,
7070
"currency_id": self.order_id.currency_id

sale_fixed_discount/static/description/index.html

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Sale Fixed Discount</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="sale-fixed-discount">
364-
<h1 class="title">Sale Fixed Discount</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="sale-fixed-discount">
370+
<h1>Sale Fixed Discount</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:9fbc48c4968018c610d6befda6c7804ced8212bb8b51c5a1f3bb97d9cde0baad
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_fixed_discount"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_fixed_discount"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-workflow/tree/19.0/sale_fixed_discount"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_fixed_discount"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>This module extends the functionality of Sales to allow you to apply
374379
fixed amount discount at sales order line level.</p>
375380
<p>The module also extends the sales order report to show fixed discount.</p>
@@ -389,13 +394,13 @@ <h1 class="title">Sale Fixed Discount</h1>
389394
</ul>
390395
</div>
391396
<div class="section" id="installation">
392-
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
397+
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
393398
<p>This module depends on module ‘account_invoice_fixed_discount’,
394399
available in
395400
<a class="reference external" href="https://github.com/OCA/account-invoicing/tree/18.0/account_invoice_fixed_discount">https://github.com/OCA/account-invoicing/tree/18.0/account_invoice_fixed_discount</a></p>
396401
</div>
397402
<div class="section" id="configuration">
398-
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
403+
<h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
399404
<p>To configure this module, you need to:</p>
400405
<ol class="arabic simple">
401406
<li>Go to <em>Sales &gt; Configuration &gt; Settings</em>.</li>
@@ -404,7 +409,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
404409
</ol>
405410
</div>
406411
<div class="section" id="usage">
407-
<h1><a class="toc-backref" href="#toc-entry-3">Usage</a></h1>
412+
<h2><a class="toc-backref" href="#toc-entry-3">Usage</a></h2>
408413
<p>To use this module, you need to:</p>
409414
<ol class="arabic simple">
410415
<li>Go to <em>Sales</em>.</li>
@@ -413,23 +418,23 @@ <h1><a class="toc-backref" href="#toc-entry-3">Usage</a></h1>
413418
</ol>
414419
</div>
415420
<div class="section" id="bug-tracker">
416-
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
421+
<h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
417422
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
418423
In case of trouble, please check there if your issue has already been reported.
419424
If you spotted it first, help us to smash it by providing a detailed and welcomed
420-
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_fixed_discount%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
425+
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_fixed_discount%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
421426
<p>Do not contact contributors directly about support or help with technical issues.</p>
422427
</div>
423428
<div class="section" id="credits">
424-
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
429+
<h2><a class="toc-backref" href="#toc-entry-5">Credits</a></h2>
425430
<div class="section" id="authors">
426-
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
431+
<h3><a class="toc-backref" href="#toc-entry-6">Authors</a></h3>
427432
<ul class="simple">
428433
<li>ForgeFlow</li>
429434
</ul>
430435
</div>
431436
<div class="section" id="contributors">
432-
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
437+
<h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
433438
<ul class="simple">
434439
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;
435440
(<a class="reference external" href="http://www.forgeflow.com">www.forgeflow.com</a>)</li>
@@ -444,18 +449,19 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
444449
</ul>
445450
</div>
446451
<div class="section" id="maintainers">
447-
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
452+
<h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
448453
<p>This module is maintained by the OCA.</p>
449454
<a class="reference external image-reference" href="https://odoo-community.org">
450455
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
451456
</a>
452457
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
453458
mission is to support the collaborative development of Odoo features and
454459
promote its widespread use.</p>
455-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_fixed_discount">OCA/sale-workflow</a> project on GitHub.</p>
460+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/19.0/sale_fixed_discount">OCA/sale-workflow</a> project on GitHub.</p>
456461
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
457462
</div>
458463
</div>
459464
</div>
465+
</div>
460466
</body>
461467
</html>

sale_fixed_discount/tests/test_sale_fixed_discount.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
33

44
from odoo.exceptions import ValidationError
5+
from odoo.fields import Command
56
from odoo.tests import Form
67

78
from odoo.addons.base.tests.common import BaseCommon
@@ -11,7 +12,9 @@ class TestSaleFixedDiscount(BaseCommon):
1112
@classmethod
1213
def setUpClass(cls):
1314
super().setUpClass()
14-
cls.env.user.groups_id |= cls.env.ref("sale.group_discount_per_so_line")
15+
cls.env.user.group_ids = [
16+
Command.link(cls.env.ref("sale.group_discount_per_so_line").id)
17+
]
1518
cls.partner = cls.env["res.partner"].create({"name": "Test"})
1619
cls.tax = cls.env["account.tax"].create(
1720
{
@@ -38,7 +41,7 @@ def setUpClass(cls):
3841
"price_unit": 200.0,
3942
"product_uom_qty": 1,
4043
"product_id": cls.product.id,
41-
"tax_id": [(6, 0, [cls.tax.id])],
44+
"tax_ids": [Command.set([cls.tax.id])],
4245
}
4346
)
4447

0 commit comments

Comments
 (0)