diff options
| author | yhu-odoo <yhu@odoo.com> | 2020-04-21 15:22:46 +0000 |
|---|---|---|
| committer | yhu-odoo <yhu@odoo.com> | 2020-05-27 08:20:17 +0000 |
| commit | 181c7d82e30d0848bbac7f7d0188e81aced0af07 (patch) | |
| tree | d5868d318629c09ebb4da9d70ac2316d66fde338 /addons/purchase/views | |
| parent | d83334ef8ee566e56ad8b25264d66704120ba598 (diff) | |
[IMP] purchase: send reminder mail to vendor
1. automatically send a reminder mail to vendor to confirm the receipt
date. If confirmed, (confirmed by vendor) will be added next to the
receipt date. If not, vendor can update the date on the portal website.
An warning activity will be set for the purchase representative for this
update.
2. Vendor can also comfirm recieption of the PO when we 'send PO by mail'.
If confirm, (confirmed by vendor) will be added next to the confirmation
date. An filter is added in the PO search view to show all unconfirmed
PO.
Task 2230811
PR #49921
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/purchase/views')
| -rw-r--r-- | addons/purchase/views/assets.xml | 6 | ||||
| -rw-r--r-- | addons/purchase/views/portal_templates.xml | 96 | ||||
| -rw-r--r-- | addons/purchase/views/purchase_views.xml | 38 | ||||
| -rw-r--r-- | addons/purchase/views/res_config_settings_views.xml | 11 | ||||
| -rw-r--r-- | addons/purchase/views/res_partner_views.xml | 6 |
5 files changed, 144 insertions, 13 deletions
diff --git a/addons/purchase/views/assets.xml b/addons/purchase/views/assets.xml index 1532d8b70eb..321a34cb065 100644 --- a/addons/purchase/views/assets.xml +++ b/addons/purchase/views/assets.xml @@ -9,4 +9,10 @@ <script type="text/javascript" src="/purchase/static/src/js/tours/purchase.js"></script> </xpath> </template> + + <template id="assets_frontend" name="purchase assets" inherit_id="web.assets_frontend"> + <xpath expr="." position="inside"> + <script type="text/javascript" src="/purchase/static/src/js/purchase_datetimepicker.js"></script> + </xpath> + </template> </odoo> diff --git a/addons/purchase/views/portal_templates.xml b/addons/purchase/views/portal_templates.xml index e9553037b0b..0618c182943 100644 --- a/addons/purchase/views/portal_templates.xml +++ b/addons/purchase/views/portal_templates.xml @@ -214,4 +214,100 @@ </t> </template> + <template id="portal_my_purchase_order_update_date" name="Portal: My Purchase Order Update Dates" inherit_id="purchase.portal_my_purchase_order" primary="True"> + <xpath expr="//div[hasclass('card-body')]" position="replace"> + <div class="card-body"> + <div class="mb-4"> + <strong>Confirmation Date:</strong> <span t-field="order.date_approve" t-options='{"widget": "date"}'/><br/> + <div t-att-class="'d-inline' if order.date_planned else 'd-none'"> + <strong>Receipt Date:</strong><span class="ml-1" t-field="order.date_planned" t-options='{"widget": "date"}'/> + </div> + </div> + <h3 class="font-weight-normal">Pricing</h3> + + <form t-attf-action="/my/purchase/#{order.id}/update?access_token=#{order.access_token}" method="post"> + <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/> + + <table class="table table-sm"> + <thead class="bg-100"> + <tr> + <th>Products</th> + <th class="text-right d-none d-sm-table-cell">Unit Price</th> + <th class="text-right">Quantity</th> + <th class="text-right">Scheduled Date</th> + <th class="text-right">Updated Date</th> + <th class="text-right">Subtotal</th> + </tr> + </thead> + <tbody> + <t t-foreach="order.order_line" t-as="ol"> + <tr> + <td> + <img t-att-src="image_data_uri(resize_to_48(ol.product_id.image_1024))" alt="Product" class="d-none d-lg-inline"/> + <span t-esc="ol.name"/> + </td> + <td class="text-right d-none d-sm-table-cell"> + <span t-field="ol.price_unit" t-options='{"widget": "monetary", "display_currency": order.currency_id}'/> + </td> + <td class="text-right"> + <span t-esc="ol.product_qty"/> + </td> + <td class="text-right"> + <span t-esc="ol.date_planned"/> + </td> + <td class="text-right"> + <div class="container"> + <div class="form-group"> + <div class="input-group date"> + <input type="text" class="form-control datetimepicker-input o-purchase-datetimepicker" t-attf-id="datetimepicker_#{ol.id}" t-att-name="ol.id" + data-toggle="datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" t-attf-data-target="#datetimepicker_#{ol.id}"/> + </div> + </div> + </div> + </td> + <td class="text-right"> + <span t-field="ol.price_subtotal" t-options='{"widget": "monetary", "display_currency": order.currency_id}'/> + </td> + </tr> + </t> + </tbody> + </table> + <div class="row"> + <div class="col-sm-7 col-md-5 ml-auto"> + <table class="table table-sm"> + <tbody> + <tr> + <td> + <strong>Untaxed Amount:</strong> + </td> + <td class="text-right"> + <span t-field="order.amount_untaxed" t-options='{"widget": "monetary", "display_currency": order.currency_id}'/> + </td> + </tr> + <tr> + <td> + <strong>Taxes:</strong> + </td> + <td class="text-right"> + <span t-field="order.amount_tax" t-options='{"widget": "monetary", "display_currency": order.currency_id}'/> + </td> + </tr> + <tr> + <td> + <strong>Total:</strong> + </td> + <td class="text-right"> + <span t-field="order.amount_total" t-options='{"widget": "monetary", "display_currency": order.currency_id}'/> + </td> + </tr> + </tbody> + </table> + </div> + </div> + <input class="btn btn-primary" type="submit" value="Send Updated Dates"/> + </form> + </div> + </xpath> + </template> + </odoo> diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml index e3188e424a1..a90aafc226c 100644 --- a/addons/purchase/views/purchase_views.xml +++ b/addons/purchase/views/purchase_views.xml @@ -143,6 +143,7 @@ <button name="print_quotation" string="Print RFQ" type="object" states="sent" groups="base.group_user"/> <button name="button_confirm" type="object" states="draft" string="Confirm Order" id="draft_confirm"/> <button name="action_rfq_send" states="purchase" string="Send PO by Email" type="object" context="{'send_rfq':False}"/> + <button name="confirm_reminder_mail" string="Confirm Receipt Date" type="object" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('mail_reminder_confirmed', '=', True)]}"/> <button name="action_create_invoice" string="Create Bill" type="object" context="{'create_bill':True}" attrs="{'invisible': ['|', '|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'not in', ('no', 'invoiced')), ('order_line', '=', [])]}"/> <button name="button_draft" states="cancel" string="Set to Draft" type="object" /> <button name="button_cancel" states="draft,to approve,sent,purchase" string="Cancel" type="object" /> @@ -176,9 +177,28 @@ </group> <group> <field name="date_order" attrs="{'invisible': [('state','=','purchase')]}"/> - <field name="date_approve" attrs="{'invisible': [('state','!=','purchase')]}"/> + <label for="date_approve" attrs="{'invisible': [('state','!=','purchase')]}"/> + <div name="date_approve" attrs="{'invisible': [('state','!=','purchase')]}" class="o_row"> + <field name="date_approve"/> + <field name="mail_reception_confirmed" invisible="1"/> + <span class="text-muted" attrs="{'invisible': [('mail_reception_confirmed','=', False)]}">(confirmed by vendor)</span> + </div> + <label for="date_planned"/> + <div name="date_planned_and_confirmation"> + <div name="date_planned_div" class="o_row"> + <field name="date_planned" attrs="{'readonly': [('state', 'not in', ('draft', 'sent', 'to approve', 'purchase'))]}"/> + <span name='expected_date_span' class="text-muted" attrs="{'invisible': ['|', ('expected_date', '=', False), ('date_planned', '!=', False)]}">Per line, first on <field name="expected_date" widget="date"/></span> + <field name="mail_reminder_confirmed" invisible="1"/> + <span class="text-muted" attrs="{'invisible': [('mail_reminder_confirmed', '=', False)]}">(confirmed by vendor)</span> + </div> + <div name="confirmation" class="oe_edit_only o_row" groups='purchase.group_send_reminder'> + <field name="receipt_reminder_email"/> + <span>Ask confirmation</span> + <field name="reminder_date_before_receipt" attrs="{'readonly': [('receipt_reminder_email', '=', False)]}"/> + <span> days before</span> + </div> + </div> <field name="origin" attrs="{'invisible': [('origin','=',False)]}"/> - <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> </group> </group> <notebook> @@ -209,7 +229,7 @@ context="{'partner_id':parent.partner_id, 'quantity':product_qty,'uom':product_uom, 'company_id': parent.company_id}" force_save="1" domain="[('purchase_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/> <field name="name" widget="section_and_note_text"/> - <field name="date_planned" optional="hide" attrs="{'required': [('display_type', '=', False)]}"/> + <field name="date_planned" optional="hide" attrs="{'required': [('display_type', '=', False)], 'readonly': [('parent.date_planned', '!=', False)]}" force_save="1"/> <field name="account_analytic_id" optional="hide" context="{'default_partner_id':parent.partner_id}" groups="analytic.group_analytic_accounting" domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/> <field name="analytic_tag_ids" optional="hide" groups="analytic.group_analytic_tags" widget="many2many_tags" options="{'color_field': 'color'}" domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/> <field name="product_qty"/> @@ -253,7 +273,6 @@ <field name="date_planned" widget="date" attrs="{'required': [('display_type', '=', False)]}"/> <field name="account_analytic_id" colspan="2" domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/> <field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]" widget="many2many_tags" options="{'color_field': 'color'}"/> - <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> </group> <group colspan="12"> <notebook> @@ -340,15 +359,11 @@ </page> <page string="Other Information" name="purchase_delivery_invoice"> <group> - <group name="planning"> - <label for="date_planned" attrs="{'invisible': [('state', '!=', 'draft'), ('date_planned', '=', False)]}"/> - <div name="date_planned_div" class="o_row" attrs="{'invisible': [('state', '!=', 'draft'), ('date_planned', '=', False)]}"> - <field name="date_planned" attrs="{'readonly': [('state', 'not in', ('draft', 'sent', 'to approve'))]}"/> - <span name="expected_date_span" class="text-muted">Expected: <field name="expected_date" widget="date"/></span> - </div> - </group> <group name="other_info"> <field name="user_id" domain="[('share', '=', False)]" widget="many2one_avatar_user"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + </group> + <group name="invoice_info"> <field name="invoice_status" attrs="{'invisible': [('state', 'in', ('draft', 'sent', 'to approve', 'cancel'))]}"/> <field name="payment_term_id" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}" options="{'no_create': True}"/> <field name="fiscal_position_id" options="{'no_create': True}" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}"/> @@ -418,6 +433,7 @@ <field name="product_id"/> <filter name="my_Orders" string="My Orders" domain="[('user_id', '=', uid)]"/> <separator/> + <filter name="unconfirmed" string="Not Acknowledged" domain="[('mail_reception_confirmed', '=', False), ('state', '=', 'purchase')]"/> <filter name="not_invoiced" string="Waiting Bills" domain="[('invoice_status', '=', 'to invoice')]" help="Purchase orders that include lines not invoiced."/> <filter name="invoiced" string="Bills Received" domain="[('invoice_status', '=', 'invoiced')]" help="Purchase orders that have been invoiced."/> <separator/> diff --git a/addons/purchase/views/res_config_settings_views.xml b/addons/purchase/views/res_config_settings_views.xml index 52c0a1dabf4..c143f2088d7 100644 --- a/addons/purchase/views/res_config_settings_views.xml +++ b/addons/purchase/views/res_config_settings_views.xml @@ -74,6 +74,17 @@ </div> </div> </div> + <div class="col-12 col-lg-6 o_setting_box" id="auto_receipt_reminder"> + <div class="o_setting_left_pane"> + <field name="group_send_reminder"/> + </div> + <div class="o_setting_right_pane"> + <label for="group_send_reminder"/> + <div class="text-muted"> + Automatically remind the receipt date to your vendors + </div> + </div> + </div> </div> <h2>Invoicing</h2> <div class="row mt16 o_settings_container" name="invoicing_settings_container"> diff --git a/addons/purchase/views/res_partner_views.xml b/addons/purchase/views/res_partner_views.xml index 05b46795a76..58d675d5a16 100644 --- a/addons/purchase/views/res_partner_views.xml +++ b/addons/purchase/views/res_partner_views.xml @@ -6,13 +6,15 @@ <field name="model">res.partner</field> <field name="inherit_id" ref="base.view_partner_form"/> <field name="priority">36</field> - <field name="groups_id" eval="[(4, ref('base.group_multi_currency'))]"/> <field name="arch" type="xml"> <group name="purchase" position="inside"> - <field name="property_purchase_currency_id" options="{'no_create': True, 'no_open': True}"/> + <field name="receipt_reminder_email" groups='purchase.group_send_reminder'/> + <field name="reminder_date_before_receipt" attrs="{'invisible': [('receipt_reminder_email', '=', False)]}" groups='purchase.group_send_reminder'/> + <field name="property_purchase_currency_id" options="{'no_create': True, 'no_open': True}" groups='base.group_multi_currency'/> </group> </field> </record> + <record id="act_res_partner_2_purchase_order" model="ir.actions.act_window"> <field name="name">RFQs and Purchases</field> <field name="res_model">purchase.order</field> |
