diff options
| author | Tiffany Chang (tic) <tic@odoo.com> | 2020-02-28 14:45:18 +0000 |
|---|---|---|
| committer | Tiffany Chang (tic) <tic@odoo.com> | 2020-03-31 10:31:34 +0000 |
| commit | 18e96c6be2cc1d74c98ad04bd7995c1f6ab73660 (patch) | |
| tree | 9e3043e16550244dae142d1c3ee63faeacc0467e /addons/purchase/views | |
| parent | f7d7c53cd51c402672a49f98ddebab2cce7cb6ad (diff) | |
[IMP] purchase(_stock): Add more and update PO dates
Adds "Expected Date" and "Effective Date" fields to purchase orders to
match what exists in sales orders. "Effective Date" mirrors sales logic
(= first completed stock move). "Expected Date" has simplier logic due
to simplier nature of receiving stock vs shipping (= earliest "Scheduled
Date" of all PO lines). Form view has been updated to include these new fields.
Additionally code was changed to not have PO 'order_line.date_planned' be
overwritten by the 'purchase_order.date_planned' value. Previous behavior
was both confusing and made it so info was lost. Also logic for related
stock move picking line expected date values has been updated to now consider
'purchase_order.date_planned' value if set. Related changes include:
- not overwriting when PO is edited+saved (this only occurred in write()
logic, not create() which caused inconsistent behavior anyways.),
- updating related tests,
- removing PO line date_planned editing restriction when PO date_planned
is set
- updating of relevant stock moves/picking expected date due to
PO.line.propogate_date = True ('purchase_order.date_planned' if
exists, otherwise 'order_line.date_planned')
This change also includes some small related improvements:
- Removal of outdated code comment.
- Addition of Help strings to better explain fields.
- Prevent copy of 'date_planned' value into new POs (now mirrors sales
logic).
This change corresponds to "Receipt Date on PO's" subsection of Purchase
KPIs task.
Task #2198420
Diffstat (limited to 'addons/purchase/views')
| -rw-r--r-- | addons/purchase/views/purchase_views.xml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml index da5d47989b4..7c2ddb8e1a3 100644 --- a/addons/purchase/views/purchase_views.xml +++ b/addons/purchase/views/purchase_views.xml @@ -209,7 +209,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)], 'readonly': [('parent.date_planned', '!=', False)]}"/> + <field name="date_planned" optional="hide" attrs="{'required': [('display_type', '=', False)]}"/> <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"/> @@ -342,8 +342,9 @@ <group> <group name="planning"> <label for="date_planned"/> - <div> - <field name="date_planned" attrs="{'readonly': [('state', 'not in', ('draft', 'sent'))]}"/> + <div name="date_planned_div" class="o_row"> + <field name="date_planned" attrs="{'readonly': [('state', 'not in', ('draft', 'sent', 'to approve', 'purchase'))]}"/> + <span class="text-muted">Expected: <field name="expected_date" widget="date"/></span> </div> </group> <group name="other_info"> |
