[FIX] sale_timesheet: show date fields in invoice wizard
Current behaviour: If you have an SO, with an SOL that is a service invoiced based on Timesheet's task, with some logged hours (therefor it can be invoiced), the wizard wasn't showing the date range fields to allow user to specify a begin and end date for invoicing. Expected behaviour: You should be able to choose a date in the wizard when you have a service based on timesheet, and "normal invoice" is chosen as a radio option. Steps to reproduce: - Install Sale and Timesheet - Create a Product of type service, invoiced on timesheet, on create task, chose a project (doesn't matter), unit = hours - Create an SO and sell 50 hours of the newly created service, confirm the SO - Log 20 hours on the task related to the sol - Return to the SO and click on "Create Invoice", normally 2 fields for "Date Begin" and "Date End" should be present, but it is not the case. You can test the desired behaviour in version 15.3 and before. Reason for the problem: The xml view was attaching itself after a field `deposit_taxes_id` which is inside a group that is invisible if there are no downpayment. Fix: Attach the xml view after the before mentioned group (`down_payment_specification`), in a separate group of its own, with visibility that depends on `invoicing_timesheet_enabled` field. Affected versions: - 16.0 - master opw-2994036 closes odoo/odoo#101406 X-original-commit: 3eb1660e7bee4c5b2fe63f82daad5f4acbea2dd2 Signed-off-by: Xavier <xbo@odoo.com> Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
This commit is contained in:
@@ -9,21 +9,24 @@
|
||||
<xpath expr="//form" position="attributes">
|
||||
<attribute name="disable_autofocus">true</attribute>
|
||||
</xpath>
|
||||
<field name="deposit_taxes_id" position="after">
|
||||
<group name="down_payment_specification" position="after">
|
||||
<field name="invoicing_timesheet_enabled" invisible="1"/>
|
||||
<label for="date_start_invoice_timesheet" string="Timesheets Period" attrs="{'invisible': [ '|', ('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}"/>
|
||||
<div class="o_row" attrs="{'invisible': [ '|',('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}">
|
||||
<field name="date_start_invoice_timesheet"
|
||||
class="oe_inline" widget="daterange"
|
||||
options="{'related_end_date': 'date_end_invoice_timesheet'}"
|
||||
title="Only timesheets not yet invoiced (and validated, if applicable) from this period will be invoiced. If the period is not indicated, all timesheets not yet invoiced (and validated, if applicable) will be invoiced without distinction."/>
|
||||
<i class="fa fa-long-arrow-right mx-2" aria-label="Arrow icon" title="Arrow"/>
|
||||
<field name="date_end_invoice_timesheet"
|
||||
class="oe_inline" widget="daterange"
|
||||
options="{'related_start_date': 'date_start_invoice_timesheet'}"
|
||||
title="Only timesheets not yet invoiced (and validated, if applicable) from this period will be invoiced. If the period is not indicated, all timesheets not yet invoiced (and validated, if applicable) will be invoiced without distinction."/>
|
||||
</div>
|
||||
</field>
|
||||
<group name="timesheet_invoice_date_range"
|
||||
attrs="{'invisible': [ '|', ('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}">
|
||||
<label for="date_start_invoice_timesheet" string="Timesheets Period" attrs="{'invisible': [ '|', ('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}"/>
|
||||
<div class="o_row" attrs="{'invisible': [ '|',('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}">
|
||||
<field name="date_start_invoice_timesheet"
|
||||
class="oe_inline" widget="daterange"
|
||||
options="{'related_end_date': 'date_end_invoice_timesheet'}"
|
||||
title="Only timesheets not yet invoiced (and validated, if applicable) from this period will be invoiced. If the period is not indicated, all timesheets not yet invoiced (and validated, if applicable) will be invoiced without distinction."/>
|
||||
<i class="fa fa-long-arrow-right mx-2" aria-label="Arrow icon" title="Arrow"/>
|
||||
<field name="date_end_invoice_timesheet"
|
||||
class="oe_inline" widget="daterange"
|
||||
options="{'related_start_date': 'date_start_invoice_timesheet'}"
|
||||
title="Only timesheets not yet invoiced (and validated, if applicable) from this period will be invoiced. If the period is not indicated, all timesheets not yet invoiced (and validated, if applicable) will be invoiced without distinction."/>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user