Merge branch 'imp/15.0/website_sale_payment_terms__order_terms_selected' into '15.0'

WIP: imp/15.0/website_sale_payment_terms__order_terms_selected into 15.0

See merge request hibou-io/hibou-odoo/suite!1367
This commit is contained in:
Cedric Collins
2022-02-15 21:30:44 +00:00
2 changed files with 2 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ class SaleOrder(models.Model):
today_string = fields.Date.to_string(fields.Date.today()) today_string = fields.Date.to_string(fields.Date.today())
for order in self: for order in self:
amount = order.amount_total amount = order.amount_total
if order.payment_term_id: if order.website_id and order.amount_total > order.website_id.payment_deposit_threshold and order.payment_term_id:
term_amount = [amt for date_string, amt in order.payment_term_id.compute(order.amount_total) if date_string == today_string] term_amount = [amt for date_string, amt in order.payment_term_id.compute(order.amount_total) if date_string == today_string]
term_amount = term_amount and term_amount[0] or 0.0 term_amount = term_amount and term_amount[0] or 0.0
amount = term_amount if term_amount > order.amount_total_deposit else order.amount_total_deposit amount = term_amount if term_amount > order.amount_total_deposit else order.amount_total_deposit

View File

@@ -4,7 +4,7 @@
<!-- Payment terms list items for /shop/payment --> <!-- Payment terms list items for /shop/payment -->
<template id="payment_term_items"> <template id="payment_term_items">
<t t-set="partner_term" t-value="order.partner_id.property_payment_term_id"/> <t t-set="partner_term" t-value="order.partner_id.property_payment_term_id"/>
<t t-set="selected_term" t-value="order.payment_term_id or partner_term"/> <t t-set="selected_term" t-value="order.payment_term_id"/>
<!-- Show current partners payment terms --> <!-- Show current partners payment terms -->
<t t-if="partner_term and partner_term not in website_terms"> <t t-if="partner_term and partner_term not in website_terms">
<li class="list-group-item"> <li class="list-group-item">