diff options
| author | Robot Odoo <xmo+roboto@odoo.com> | 2019-04-04 16:28:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-04 16:28:14 +0200 |
| commit | 7529bd35fab88759769187c331f46db960b321fa (patch) | |
| tree | 6dc243b6eb7d369ee25d4e97ad7b68cbde89817d | |
| parent | fb2fc0b3d8907f9fbf01834c2db3287668873fff (diff) | |
| parent | f5628b1b8db0881c1100c79dd42ae082f1d5e26b (diff) | |
[MERGE][IMP] sale_*: report and portal fine tuning
This merge changes lot of small things in sale modules. The 3
main points are
- Sales Orders form view: reorganize fields for a better usability
and renaming labels
- Sale PDF report: renaming labels and titles, moving some report section
- Quotation Portal: improving style, moving section and renaming labels
Task-1920476
closes odoo/odoo#30550
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
18 files changed, 98 insertions, 84 deletions
diff --git a/addons/portal/views/portal_templates.xml b/addons/portal/views/portal_templates.xml index 462a93a5936..1c45973f82c 100644 --- a/addons/portal/views/portal_templates.xml +++ b/addons/portal/views/portal_templates.xml @@ -175,7 +175,7 @@ <template id="portal_record_sidebar" name="My Portal Record Sidebar"> <div t-attf-class="col-12 col-lg flex-lg-grow-0 #{classes}"> - <div class="card bg-white mb-4" id="sidebar_content"> + <div class="card bg-white mb-4 sticky-top" id="sidebar_content"> <div t-if="title" class="card-body text-center pb-2 pt-3"> <t t-raw="title"/> </div> diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py index de1fd231b8f..22eb74a476e 100644 --- a/addons/product/models/product_pricelist.py +++ b/addons/product/models/product_pricelist.py @@ -416,12 +416,12 @@ class PricelistItem(models.Model): default='3_global', required=True, help='Pricelist Item applicable on selected option') base = fields.Selection([ - ('list_price', 'Public Price'), + ('list_price', 'Sales Price'), ('standard_price', 'Cost'), ('pricelist', 'Other Pricelist')], "Based on", default='list_price', required=True, help='Base price for computation.\n' - 'Public Price: The base price will be the Sale/public Price.\n' + 'Sales Price: The base price will be the Sales Price.\n' 'Cost Price : The base price will be the cost price.\n' 'Other Pricelist : Computation of the base price based on another Pricelist.') base_pricelist_id = fields.Many2one('product.pricelist', 'Other Pricelist') diff --git a/addons/product/views/product_pricelist_views.xml b/addons/product/views/product_pricelist_views.xml index 9f89adb2cc7..11493e82d2f 100644 --- a/addons/product/views/product_pricelist_views.xml +++ b/addons/product/views/product_pricelist_views.xml @@ -60,7 +60,7 @@ <label for="" string="New Price ="/> <div> - <span attrs="{'invisible':[('base', '!=', 'list_price')]}">Public Price - </span> + <span attrs="{'invisible':[('base', '!=', 'list_price')]}">Sales Price - </span> <span attrs="{'invisible':[('base', '!=', 'standard_price')]}">Cost - </span> <span attrs="{'invisible':[('base', '!=', 'pricelist')]}">Other Pricelist - </span> </div> diff --git a/addons/sale/controllers/portal.py b/addons/sale/controllers/portal.py index 702aa08dc56..997042f4a25 100644 --- a/addons/sale/controllers/portal.py +++ b/addons/sale/controllers/portal.py @@ -158,7 +158,7 @@ class CustomerPortal(CustomerPortal): # Log only once a day if order_sudo and request.session.get('view_quote_%s' % order_sudo.id) != now and request.env.user.share and access_token: request.session['view_quote_%s' % order_sudo.id] = now - body = _('Quotation viewed by customer') + body = _('Quotation viewed by customer %s') % order_sudo.partner_id.name _message_post_helper('sale.order', order_sudo.id, body, token=order_sudo.access_token, message_type='notification', subtype="mail.mt_note", partner_ids=order_sudo.user_id.sudo().partner_id.ids) values = { diff --git a/addons/sale/data/mail_data.xml b/addons/sale/data/mail_data.xml index b39a793f83b..53a5914add3 100644 --- a/addons/sale/data/mail_data.xml +++ b/addons/sale/data/mail_data.xml @@ -80,11 +80,11 @@ <div style="margin: 0px; padding: 0px;"> <p style="margin: 0px; padding: 0px; font-size: 13px;"> % set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order' - Dear ${object.partner_id.name} % if object.partner_id.parent_id: - (${object.partner_id.parent_id.name}) + Dear ${object.partner_id.name} (${object.partner_id.parent_id.name}), + % else: + Dear ${object.partner_id.name}, % endif - , <br /><br /> Here is % if ctx.get('proforma') diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index ad1362bd58d..d74dc58412b 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -134,7 +134,7 @@ class SaleOrder(models.Model): ], string='Status', readonly=True, copy=False, index=True, tracking=3, default='draft') date_order = fields.Datetime(string='Order Date', required=True, readonly=True, index=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, copy=False, default=fields.Datetime.now) validity_date = fields.Date(string='Expiration', readonly=True, copy=False, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, - help="Expiration date of the quotation, after this date, the customer won't be able to validate the quotation online.", default=_default_validity_date) + help="Beyond this date, the customer is no longer able to accept the quotation from the portal.", default=_default_validity_date) is_expired = fields.Boolean(compute='_compute_is_expired', string="Is expired") require_signature = fields.Boolean('Online Signature', default=_get_default_require_signature, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, @@ -146,11 +146,11 @@ class SaleOrder(models.Model): create_date = fields.Datetime(string='Creation Date', readonly=True, index=True, help="Date on which sales order is created.") confirmation_date = fields.Datetime(string='Confirmation Date', readonly=True, index=True, help="Date on which the sales order is confirmed.", oldname="date_confirm", copy=False) user_id = fields.Many2one('res.users', string='Salesperson', index=True, tracking=2, default=lambda self: self.env.user) - partner_id = fields.Many2one('res.partner', string='Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, index=True, tracking=1, help="You can find a customer by its Name, TIN, Email or Internal Reference.") + partner_id = fields.Many2one('res.partner', string='Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, index=True, tracking=1, help="You can find a customer from their name, email, tax ID or reference.") partner_invoice_id = fields.Many2one('res.partner', string='Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)], 'sale': [('readonly', False)]}, help="Invoice address for current sales order.") partner_shipping_id = fields.Many2one('res.partner', string='Delivery Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)], 'sale': [('readonly', False)]}, help="Delivery address for current sales order.") - pricelist_id = fields.Many2one('product.pricelist', string='Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Pricelist for current sales order.") + pricelist_id = fields.Many2one('product.pricelist', string='Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Pricelist for current order. If you change the pricelist, only new lines will consider this pricelist.") currency_id = fields.Many2one("res.currency", related='pricelist_id.currency_id', string="Currency", readonly=True, required=True) analytic_account_id = fields.Many2one('account.analytic.account', 'Analytic Account', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="The analytic account related to a sales order.", copy=False, oldname='project_id') @@ -173,8 +173,8 @@ class SaleOrder(models.Model): amount_total = fields.Monetary(string='Total', store=True, readonly=True, compute='_amount_all', tracking=4) currency_rate = fields.Float("Currency Rate", compute='_compute_currency_rate', compute_sudo=True, store=True, digits=(12, 6), readonly=True, help='The rate of the currency to the currency of rate 1 applicable at the date of the order') - payment_term_id = fields.Many2one('account.payment.term', string='Payment Terms', oldname='payment_term') - fiscal_position_id = fields.Many2one('account.fiscal.position', oldname='fiscal_position', string='Fiscal Position') + payment_term_id = fields.Many2one('account.payment.term', string='Payment Terms', oldname='payment_term', help="Payment terms applies to all invoices issued from this order.") + fiscal_position_id = fields.Many2one('account.fiscal.position', oldname='fiscal_position', string='Fiscal Position', help=" Fiscal positions are used to adapt taxes and accounts for particular customers or sales orders/invoices. The default value comes from the customer.") company_id = fields.Many2one('res.company', 'Company', default=lambda self: self.env['res.company']._company_default_get('sale.order')) team_id = fields.Many2one('crm.team', 'Sales Team', change_default=True, default=_get_default_team, oldname='section_id') diff --git a/addons/sale/report/sale_report_templates.xml b/addons/sale/report/sale_report_templates.xml index f5aee8c92d8..3991d063cbc 100644 --- a/addons/sale/report/sale_report_templates.xml +++ b/addons/sale/report/sale_report_templates.xml @@ -12,12 +12,12 @@ and doc.partner_invoice_id != doc.partner_id or doc.partner_shipping_id != doc.partner_invoice_id"> <t t-set="information_block"> - <strong t-if="doc.partner_shipping_id == doc.partner_invoice_id">Invoicing and shipping address:</strong> - <strong t-if="doc.partner_shipping_id != doc.partner_invoice_id">Invoicing address:</strong> + <strong t-if="doc.partner_shipping_id == doc.partner_invoice_id">Invoicing and Shipping Address:</strong> + <strong t-if="doc.partner_shipping_id != doc.partner_invoice_id">Invoicing Address:</strong> <div t-field="doc.partner_invoice_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> <t t-if="doc.partner_shipping_id != doc.partner_invoice_id"> - <strong>Shipping address:</strong> + <strong>Shipping Address:</strong> <div t-field="doc.partner_shipping_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> </t> @@ -26,7 +26,7 @@ <div class="page"> <div class="oe_structure"/> - <h2> + <h2 class="mt16"> <t t-if="not (env.context.get('proforma', False) or is_pro_forma)"> <span t-if="doc.state not in ['draft','sent']">Order # </span> <span t-if="doc.state in ['draft','sent']">Quotation # </span> @@ -48,20 +48,16 @@ </div> <div t-if="doc.date_order and doc.state in ['draft','sent']" class="col-auto mw-100 mb-2"> <strong>Quotation Date:</strong> - <p class="m-0" t-field="doc.date_order"/> + <p class="m-0" t-field="doc.date_order" t-options='{"widget": "date"}'/> + </div> + <div t-if="doc.validity_date and doc.state in ['draft', 'sent']" class="col-auto mw-100 mb-2" name="expiration_date"> + <strong>Expiration:</strong> + <p class="m-0" t-field="doc.validity_date"/> </div> <div t-if="doc.user_id.name" class="col-auto mw-100 mb-2"> <strong>Salesperson:</strong> <p class="m-0" t-field="doc.user_id"/> </div> - <div name="payment_term" t-if="doc.payment_term_id" class="col-auto mw-100 mb-2"> - <strong>Payment Terms:</strong> - <p class="m-0" t-field="doc.payment_term_id"/> - </div> - <div t-if="doc.validity_date and doc.state in ['draft', 'sent']" class="col-auto mw-100 mb-2"> - <strong>Expiration Date:</strong> - <p class="m-0" t-field="doc.validity_date"/> - </div> </div> <!-- Is there a discount on at least one line? --> @@ -149,7 +145,7 @@ </tbody> </table> - <div class="clearfix"> + <div class="clearfix" name="so_total_summary"> <div id="total" class="row" name="total"> <div t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ml-auto"> <table class="table table-sm"> @@ -193,16 +189,7 @@ </div> </div> - <p t-field="doc.note" /> - <p t-if="doc.payment_term_id.note"> - <span t-field="doc.payment_term_id.note"/> - </p> - <p id="fiscal_position_remark" t-if="doc.fiscal_position_id and doc.fiscal_position_id.sudo().note"> - <strong>Fiscal Position Remark:</strong> - <span t-field="doc.fiscal_position_id.sudo().note"/> - </p> - - <div t-if="doc.signature" class="mt32 ml16 mr16" name="signature"> + <div t-if="doc.signature" class="mt32 ml64 mr4" name="signature"> <div class="offset-8"> <strong>Signature</strong> </div> @@ -215,6 +202,15 @@ </div> <div class="oe_structure"/> + + <p t-field="doc.note" /> + <p t-if="doc.payment_term_id.note"> + <span t-field="doc.payment_term_id.note"/> + </p> + <p id="fiscal_position_remark" t-if="doc.fiscal_position_id and doc.fiscal_position_id.sudo().note"> + <strong>Fiscal Position Remark:</strong> + <span t-field="doc.fiscal_position_id.sudo().note"/> + </p> </div> </t> </template> diff --git a/addons/sale/views/sale_portal_templates.xml b/addons/sale/views/sale_portal_templates.xml index 32b2a06b451..4e1d82f36b7 100644 --- a/addons/sale/views/sale_portal_templates.xml +++ b/addons/sale/views/sale_portal_templates.xml @@ -135,7 +135,7 @@ <a t-if="sale_order.has_to_be_signed(True)" role="button" class="btn btn-primary btn-block mb8" data-toggle="modal" data-target="#modalaccept" href="#"> <i class="fa fa-check"/><t t-if="sale_order.has_to_be_paid(True)"> Sign & Pay</t><t t-else=""> Accept & Sign</t> </a> - <a t-elif="sale_order.has_to_be_paid(True)" role="button" id="o_sale_portal_paynow" class="btn btn-primary btn-block mb8" data-toggle="modal" data-target="#modalaccept" href="#"> + <a t-elif="sale_order.has_to_be_paid(True)" role="button" id="o_sale_portal_paynow" data-toggle="modal" data-target="#modalaccept" href="#" t-att-class="'btn-block mb8 %s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')" > <i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept & Pay</t><t t-else="">Pay now</t> </a> <div class="o_download_pdf btn-toolbar flex-sm-nowrap"> @@ -330,7 +330,7 @@ </div> </t> <div t-elif="sale_order.has_to_be_paid(True)" class="col-sm-auto mt8"> - <a role="button" class="btn btn-primary" data-toggle="modal" data-target="#modalaccept" href="#"> + <a role="button" data-toggle="modal" data-target="#modalaccept" href="#" t-att-class="'%s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')"> <i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept & Pay</t><t t-else="">Pay now</t> </a> </div> @@ -373,21 +373,23 @@ </t> </t> </div> - <div class="mb-3"> - <strong>Date:</strong> <span t-field="sale_order.create_date" t-options='{"widget": "date"}'/> - </div> - <div class="mb-3" t-if="sale_order.validity_date"> - <strong>Expiration Date:</strong> <span t-field="sale_order.validity_date" t-options='{"widget": "date"}'/> + <div class="row" id="so_date"> + <div class="mb-3 col-6"> + <strong>Date:</strong> <span t-field="sale_order.create_date" t-options='{"widget": "date"}'/> + </div> + <div class="mb-3 col-6" t-if="sale_order.validity_date"> + <strong>Expiration Date:</strong> <span t-field="sale_order.validity_date" t-options='{"widget": "date"}'/> + </div> </div> <div class="row"> <div class="col-lg-6"> - <strong t-if="sale_order.partner_shipping_id == sale_order.partner_invoice_id" class="d-block mb-1">Invoicing and Shipping Address</strong> - <strong t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id" class="d-block mb-1">Invoicing Address</strong> + <strong t-if="sale_order.partner_shipping_id == sale_order.partner_invoice_id" class="d-block mb-1">Invoicing and Shipping Address:</strong> + <strong t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id" class="d-block mb-1">Invoicing Address:</strong> <address t-field="sale_order.partner_invoice_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> </div> <t t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id"> <div id="shipping_address" class="col-lg-6"> - <strong class="d-block mb-1">Shipping Address</strong> + <strong class="d-block mb-1">Shipping Address:</strong> <address t-field="sale_order.partner_shipping_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> </div> </t> @@ -417,7 +419,7 @@ </div> <section id="details" style="page-break-inside: auto;" class="mt32"> - <h3 id="details">Details</h3> + <h3 id="details">Pricing</h3> <t t-set="display_discount" t-value="True in [line.discount > 0 for line in sale_order.order_line]"/> @@ -468,7 +470,7 @@ </td> <td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}"> <strong t-if="line.discount > 0" class="text-info"> - <t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>% discount + <t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>% </strong> </td> <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> @@ -578,6 +580,12 @@ <hr class="mt-0 mb-1"/> <em t-field="sale_order.note"/> </section> + + <section class="mt-5" t-if="sale_order.payment_term_id"> + <h3 class="">Payment terms</h3> + <hr class="mt-0 mb-1"/> + <span t-field="sale_order.payment_term_id"/> + </section> </div> </template> diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml index 0d4f50435a6..c32d1fe7af6 100644 --- a/addons/sale/views/sale_views.xml +++ b/addons/sale/views/sale_views.xml @@ -540,35 +540,39 @@ </div> <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/> </group> - <field name="note" class="oe_inline" placeholder="Terms and conditions... (note: you can setup default ones in the Configuration menu)"/> + <field name="note" class="oe_inline" placeholder="Terms and conditions..."/> <div class="oe_clear"/> </group> </page> - <page string="Other Information" name="other_information"> + <page string="Other Info" name="other_information"> <group> - <group string="Shipping Information" name="sale_shipping" groups="sale.group_sale_order_dates"> - <field name="expected_date" groups="sale.group_sale_order_dates"/> - <field name="commitment_date" groups="sale.group_sale_order_dates"/> - </group> - <group string="Sales Information" name="sales_person"> + <group name="sales_person"> + <field name="date_order" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}" string="Quotation Date"/> <field name="user_id"/> <field name="team_id" options="{'no_create': True}"/> - <field name="client_order_ref"/> + <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> <field name="require_signature"/> <field name="require_payment"/> <field name="reference" readonly="1" attrs="{'invisible': [('reference', '=', False)]}"/> - <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> <field name="analytic_account_id" context="{'default_partner_id':partner_invoice_id, 'default_name':name}" attrs="{'readonly': [('invoice_count','!=',0),('state','=','sale')]}" groups="analytic.group_analytic_accounting" force_save="1"/> </group> - <group name="sale_pay" string="Invoicing"> - <field name="date_order" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/> + <group name="sale_info"> + <field name="client_order_ref"/> <field name="fiscal_position_id" options="{'no_create': True}"/> <field name="invoice_status" states="sale,done" invisible="1"/> </group> - <group string="Reporting" name="technical" groups="base.group_no_one"> - <field groups="base.group_no_one" name="origin"/> + </group> + <group> + <group string="Shipping Information" name="sale_shipping"> + <field name="expected_date" groups="sale.group_sale_order_dates"/> + <field name="commitment_date" groups="sale.group_sale_order_dates"/> + </group> + <group string="Reporting" groups="base.group_no_one"> + <group name="technical" colspan="2" class="mb-0"> + <field name="origin"/> + </group> + <group name="utm_link" colspan="2"/> </group> - <group name="utm_link" groups="base.group_no_one"/> </group> </page> <page groups="base.group_no_one" string="Customer Signature" name="customer_signature" attrs="{'invisible': [('require_signature', '=', False), ('signed_by', '=', False), ('signature', '=', False), ('signed_on', '=', False)]}"> diff --git a/addons/sale_crm/views/sale_order_views.xml b/addons/sale_crm/views/sale_order_views.xml index 32afdf3fc7e..61318da066b 100644 --- a/addons/sale_crm/views/sale_order_views.xml +++ b/addons/sale_crm/views/sale_order_views.xml @@ -35,11 +35,11 @@ <field name="model">sale.order</field> <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> - <field name="user_id" position="after"> + <field name="client_order_ref" position="after"> <field name="tag_ids" widget="many2many_tags"/> </field> <xpath expr="//group[@name='utm_link']" position="replace"> - <group string="Marketing" name="utm_link" groups="base.group_no_one"> + <group name="utm_link" colspan="2" class="mt-0"> <field name="campaign_id"/> <field name="medium_id"/> <field name="source_id"/> diff --git a/addons/sale_management/report/sale_report_templates.xml b/addons/sale_management/report/sale_report_templates.xml index f61e88fd24b..eac3cce3e3d 100644 --- a/addons/sale_management/report/sale_report_templates.xml +++ b/addons/sale_management/report/sale_report_templates.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> <template id="report_saleorder_document_inherit_sale_management" inherit_id="sale.report_saleorder_document"> - <xpath expr="//div[hasclass('page')]/p[@id='fiscal_position_remark']" position="after"> + <xpath expr="//div[@name='signature']" position="after"> <div t-if="doc.sale_order_option_ids and doc.state in ['draft', 'sent']"> <t t-set="has_option_discount" t-value="any(doc.sale_order_option_ids.filtered(lambda o: o.discount != 0.0))" /> <h4> - <span>Optional Products</span> + <span>Options</span> </h4> <table class="table table-sm"> <thead> diff --git a/addons/sale_management/views/sale_management_views.xml b/addons/sale_management/views/sale_management_views.xml index f81cd85dc7b..cd9a1cdd420 100644 --- a/addons/sale_management/views/sale_management_views.xml +++ b/addons/sale_management/views/sale_management_views.xml @@ -69,7 +69,7 @@ <field name="model">sale.order</field> <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> - <xpath expr="//group[@name='sale_pay']/field[@name='invoice_status']" position="attributes"> + <xpath expr="//group[@name='sale_info']/field[@name='invoice_status']" position="attributes"> <attribute name="invisible" eval="False"/> </xpath> <xpath expr="//button[@name='action_quotation_send']" position="before"> diff --git a/addons/sale_management/views/sale_portal_templates.xml b/addons/sale_management/views/sale_portal_templates.xml index 90d2100ba4a..2a04c93fbdb 100644 --- a/addons/sale_management/views/sale_portal_templates.xml +++ b/addons/sale_management/views/sale_portal_templates.xml @@ -30,14 +30,13 @@ <xpath expr="//section[@id='signature']" position="after"> <t t-if="any([(not option.line_id) for option in sale_order.sale_order_option_ids])"> <section> - <h3>Optional Products</h3> - <t t-set="display_discount" t-value="True in [option.discount for option in sale_order.sale_order_option_ids]"/> + <h3>Options</h3> + <t t-set="display_discount" t-value="True in [option.discount > 0 for option in sale_order.sale_order_option_ids]"/> <table class="table table-sm"> <thead> <tr> <th class="text-left">Product</th> <th t-if="display_discount" class="text-right"> - <span>Discount</span> </th> <th class="text-right">Price</th> <th t-if="sale_order.state in ['draft', 'sent'] and report_type == 'html'"></th> @@ -49,8 +48,8 @@ <td> <div t-field="option.name"/> </td> - <td t-if="display_discount"> - <strong t-if="option.discount" class="text-info text-right"> + <td t-if="display_discount" class="text-right"> + <strong t-if="option.discount" class="text-info"> <t t-esc="((option.discount % 1) and '%s' or '%d') % option.discount"/>% discount </strong> </td> diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index 0b38a867a4a..e3de3e4c800 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -18,7 +18,7 @@ class SaleOrder(models.Model): return warehouse_ids incoterm = fields.Many2one( - 'account.incoterms', 'Incoterms', + 'account.incoterms', 'Incoterm', help="International Commercial Terms are a series of predefined commercial terms used in international transactions.") picking_policy = fields.Selection([ ('direct', 'As soon as possible'), diff --git a/addons/sale_stock/report/sale_order_report_templates.xml b/addons/sale_stock/report/sale_order_report_templates.xml index 9faa1aca6f3..34a8bda04f5 100644 --- a/addons/sale_stock/report/sale_order_report_templates.xml +++ b/addons/sale_stock/report/sale_order_report_templates.xml @@ -1,11 +1,11 @@ <?xml version="1.0"?> <odoo> <template id="report_saleorder_document_inherit_sale_stock" inherit_id="sale.report_saleorder_document"> - <xpath expr="//div[@name='payment_term']" position="after"> - <div class="col-3" t-if="doc.incoterm" groups="sale_stock.group_display_incoterm"> - <strong>Incoterms:</strong> - <p t-field="doc.incoterm.code"/> - </div> - </xpath> - </template> -</odoo>
\ No newline at end of file + <xpath expr="//div[@name='expiration_date']" position="after"> + <div class="col-3" t-if="doc.incoterm" groups="sale_stock.group_display_incoterm"> + <strong>Incoterm:</strong> + <p t-field="doc.incoterm.code"/> + </div> + </xpath> + </template> +</odoo> diff --git a/addons/sale_stock/views/sale_stock_portal_template.xml b/addons/sale_stock/views/sale_stock_portal_template.xml index 9d327b32fe2..a781a04c3b5 100644 --- a/addons/sale_stock/views/sale_stock_portal_template.xml +++ b/addons/sale_stock/views/sale_stock_portal_template.xml @@ -1,6 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> <template id="sale_order_portal_content_inherit_sale_stock" name="Orders Shipping Followup" inherit_id="sale.sale_order_portal_content"> + <xpath expr="//div[@id='so_date']" position="after"> + <div class="row" t-if="sale_order.incoterm"> + <div class="mb-3 col-6 ml-auto"> + <strong>Incoterm: </strong> <span t-field="sale_order.incoterm"/> + </div> + </div> + </xpath> <xpath expr="//div[@id='informations']" position="inside"> <t t-if="sale_order.picking_ids"> <div> diff --git a/addons/website_sale/views/sale_order_views.xml b/addons/website_sale/views/sale_order_views.xml index 07ee626c17d..840090a5d72 100644 --- a/addons/website_sale/views/sale_order_views.xml +++ b/addons/website_sale/views/sale_order_views.xml @@ -267,7 +267,7 @@ <field name="partner_id" position="attributes"> <attribute name="context">{'display_website': True}</attribute> </field> - <field name="company_id" position="after"> + <field name="team_id" position="after"> <field name="website_id" groups="website.group_multi_website"/> </field> </field> diff --git a/addons/website_sale_link_tracker/views/sale_order_views.xml b/addons/website_sale_link_tracker/views/sale_order_views.xml index c8923f33887..c9a8f09bb29 100644 --- a/addons/website_sale_link_tracker/views/sale_order_views.xml +++ b/addons/website_sale_link_tracker/views/sale_order_views.xml @@ -6,7 +6,7 @@ <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> <xpath expr="//group[@name='utm_link']" position="replace"> - <group string="Marketing" name="utm_link" groups="base.group_no_one"> + <group name="utm_link" colspan="2" class="mt-0"> <field name="campaign_id"/> <field name="medium_id"/> <field name="source_id"/> |
