Skip to content

Commit

Permalink
Merge branch '16.0' into 16.0-sale_triple_discount-fixes-3323
Browse files Browse the repository at this point in the history
  • Loading branch information
IJOL authored Sep 26, 2024
2 parents 72e0710 + 5abce08 commit d62c83d
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ addon | version | maintainers | summary
[sale_order_line_delivery_state](sale_order_line_delivery_state/) | 16.0.1.0.0 | | Show the delivery state on the sale order line
[sale_order_line_effective_date](sale_order_line_effective_date/) | 16.0.1.1.0 | [![EmilioPascual](https://github.com/EmilioPascual.png?size=30px)](https://github.com/EmilioPascual) [![rafaelbn](https://github.com/rafaelbn.png?size=30px)](https://github.com/rafaelbn) [![Shide](https://github.com/Shide.png?size=30px)](https://github.com/Shide) | Calculated effective dates in Sale Order Lines
[sale_order_line_field_from_product_attribute](sale_order_line_field_from_product_attribute/) | 16.0.1.0.0 | | Store Attribute value sis Sales Order line fields
[sale_order_line_input](sale_order_line_input/) | 16.0.1.0.0 | | Search, create or modify directly sale order lines
[sale_order_line_input](sale_order_line_input/) | 16.0.1.0.1 | | Search, create or modify directly sale order lines
[sale_order_line_menu](sale_order_line_menu/) | 16.0.1.3.1 | | Adds a Sale Order Lines Menu
[sale_order_line_price_history](sale_order_line_price_history/) | 16.0.1.1.1 | [![ernestotejeda](https://github.com/ernestotejeda.png?size=30px)](https://github.com/ernestotejeda) [![CarlosRoca13](https://github.com/CarlosRoca13.png?size=30px)](https://github.com/CarlosRoca13) [![Shide](https://github.com/Shide.png?size=30px)](https://github.com/Shide) | Sale order line price history
[sale_order_line_sequence](sale_order_line_sequence/) | 16.0.2.1.0 | | Propagates SO line sequence to invoices and stock picking.
Expand Down Expand Up @@ -118,7 +118,7 @@ addon | version | maintainers | summary
[sale_stock_product_recommendation](sale_stock_product_recommendation/) | 16.0.1.0.1 | [![yajo](https://github.com/yajo.png?size=30px)](https://github.com/yajo) [![rafaelbn](https://github.com/rafaelbn.png?size=30px)](https://github.com/rafaelbn) | Display stock info when recommending products to sell
[sale_substate](sale_substate/) | 16.0.1.0.0 | | Sale Sub State
[sale_tier_validation](sale_tier_validation/) | 16.0.1.1.0 | | Extends the functionality of Sale Orders to support a tier validation process.
[sale_triple_discount](sale_triple_discount/) | 16.0.1.0.2 | | Manage triple discount on sale order lines
[sale_triple_discount](sale_triple_discount/) | 16.0.1.0.3 | | Manage triple discount on sale order lines
[sale_validity_auto_cancel](sale_validity_auto_cancel/) | 16.0.1.0.0 | [![JordiMForgeFlow](https://github.com/JordiMForgeFlow.png?size=30px)](https://github.com/JordiMForgeFlow) | Automatically cancel quotations after validity period.
[sale_wishlist](sale_wishlist/) | 16.0.1.0.0 | | Handle sale wishlist for partners
[sales_team_security](sales_team_security/) | 16.0.1.0.0 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | New group for seeing only sales channel's documents
Expand Down
2 changes: 1 addition & 1 deletion sale_order_line_input/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Sale Order Line Input
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:718909fe05edb83589a65ab1ff4d3a980530ce2b31f351935ad217f312da4046
!! source digest: sha256:1985a7caa2e307e6f62a42666d259f371ec0c74d8345a268fafd2d468edd81db
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion sale_order_line_input/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Sale Order Line Input",
"summary": "Search, create or modify directly sale order lines",
"version": "16.0.1.0.0",
"version": "16.0.1.0.1",
"category": "Sales",
"website": "https://github.com/OCA/sale-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
9 changes: 9 additions & 0 deletions sale_order_line_input/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ def _compute_force_company_id(self):
for line in self:
line.force_company_id = line.order_id.company_id or self.env.company

def _compute_name(self):
# A NewId is needed to set the product for the parent method to set
# the language correctly. Empty id leads to error in ‘_get_lang’.
for line in self:
if not line.order_id and line.product_id:
SaleOrder = self.env["sale.order"]
line.order_id = SaleOrder.new({})
return super()._compute_name()

@api.onchange("force_company_id")
def _onchange_force_company_id(self):
"""Assign company_id because is used in domains as partner,
Expand Down
14 changes: 8 additions & 6 deletions sale_order_line_input/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
: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.
Expand Down Expand Up @@ -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 }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Sale Order Line Input</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:718909fe05edb83589a65ab1ff4d3a980530ce2b31f351935ad217f312da4046
!! source digest: sha256:1985a7caa2e307e6f62a42666d259f371ec0c74d8345a268fafd2d468edd81db
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/16.0/sale_order_line_input"><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-16-0/sale-workflow-16-0-sale_order_line_input"><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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of sales to allow you to work with
Expand Down Expand Up @@ -425,7 +425,9 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand Down
9 changes: 9 additions & 0 deletions sale_order_line_input/tests/test_sale_order_line_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ def test_sale_order_create_and_show(self):
action_dict = line.action_sale_order_form()
self.assertEqual(action_dict["res_id"], line.order_id.id)
self.assertEqual(action_dict["res_model"], "sale.order")

def test_sale_order_line_compute_name(self):
# Ensure that when calculating the line name, the new sales order id has
# already been created as it is done in the order form view.
line_form = Form(
self.env["sale.order.line"],
view="sale_order_line_input.view_sales_order_line_input_tree",
)
line_form.product_id = self.product
2 changes: 1 addition & 1 deletion sale_triple_discount/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Sale Triple Discount
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8e5c1df4b5735f0e7e6e742a5b3411a6f17d6be64c711807897f0cbe3f5e3472
!! source digest: sha256:2dc9ee54535e4fb9fe2198a6a3100468204d430e2f60cc46c780489b506fab45
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion sale_triple_discount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
"name": "Sale Triple Discount",
"version": "16.0.1.0.2",
"version": "16.0.1.0.3",
"category": "Sales",
"author": "ADHOC SA, Agile Business Group, Tecnativa, "
"Odoo Community Association (OCA)",
Expand Down
7 changes: 2 additions & 5 deletions sale_triple_discount/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def triple_discount_preprocess(self):
this method is called multiple times.
Updating the cache provides consistency through re-computations."""
prev_values = dict()
# self.invalidate_cache(fnames=self._discount_fields(), ids=self.ids)
# self.invalidate_recordset(self._discount_fields())
for line in self:
prev_values[line] = {
fname: line[fname] for fname in self._discount_fields()
Expand All @@ -118,10 +118,7 @@ def triple_discount_preprocess(self):
def triple_discount_postprocess(self, prev_values):
"""Restore the discounts of the lines in the dictionary prev_values.
Updating the cache provides consistency through re-computations."""
self.invalidate_cache(
fnames=self._discount_fields(),
ids=[line.id for line in list(prev_values.keys())],
)
self.invalidate_recordset(self._discount_fields())
for line, prev_vals_dict in list(prev_values.items()):
line.update(prev_vals_dict)

Expand Down
13 changes: 8 additions & 5 deletions sale_triple_discount/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
: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.
Expand Down Expand Up @@ -274,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 }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">Sale Triple Discount</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8e5c1df4b5735f0e7e6e742a5b3411a6f17d6be64c711807897f0cbe3f5e3472
!! source digest: sha256:2dc9ee54535e4fb9fe2198a6a3100468204d430e2f60cc46c780489b506fab45
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/16.0/sale_triple_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-16-0/sale-workflow-16-0-sale_triple_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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to have three discounts on every sale order line.</p>
Expand Down Expand Up @@ -461,7 +462,9 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand Down

0 comments on commit d62c83d

Please sign in to comment.