From fa2b90b5cfadd1114fc5520f2b97a03ea9d81b04 Mon Sep 17 00:00:00 2001 From: Alessandro Uffreduzzi Date: Tue, 14 May 2024 17:31:52 +0200 Subject: [PATCH] [IMP] sale_promotion_discount_in_field: add hook for other modules --- sale_promotion_discount_in_field/__init__.py | 1 - sale_promotion_discount_in_field/__manifest__.py | 2 +- .../models/sale_order.py | 3 ++- .../static/description/index.html | 12 +++++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sale_promotion_discount_in_field/__init__.py b/sale_promotion_discount_in_field/__init__.py index 9b4296142..0650744f6 100644 --- a/sale_promotion_discount_in_field/__init__.py +++ b/sale_promotion_discount_in_field/__init__.py @@ -1,2 +1 @@ from . import models -from . import wizard diff --git a/sale_promotion_discount_in_field/__manifest__.py b/sale_promotion_discount_in_field/__manifest__.py index 2403bbc72..5ae21a36b 100644 --- a/sale_promotion_discount_in_field/__manifest__.py +++ b/sale_promotion_discount_in_field/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Coupon Promotion Discount in Field", - "version": "14.0.1.1.0", + "version": "14.0.1.1.1", "summary": "Put promotion discount into discount field", "author": "Ooops, Cetmix, Odoo Community Association (OCA)", "maintainers": ["CetmixGitDrone", "Volodiay622"], diff --git a/sale_promotion_discount_in_field/models/sale_order.py b/sale_promotion_discount_in_field/models/sale_order.py index eed071d37..5478e1c69 100644 --- a/sale_promotion_discount_in_field/models/sale_order.py +++ b/sale_promotion_discount_in_field/models/sale_order.py @@ -28,7 +28,8 @@ def _set_reward_discount_for_lines(self, program): lines = self._get_cheapest_line() else: lines = self._get_discount_in_field_lines(program) - lines.discount = program.discount_percentage + lines.write({"discount": program.discount_percentage}) + return lines def _get_discount_in_field_lines(self, program): """ diff --git a/sale_promotion_discount_in_field/static/description/index.html b/sale_promotion_discount_in_field/static/description/index.html index df0027f5f..cd348cc54 100644 --- a/sale_promotion_discount_in_field/static/description/index.html +++ b/sale_promotion_discount_in_field/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -431,7 +431,9 @@

Other credits

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.