<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Damien Crier</title>
    <description>The latest articles on DEV Community by Damien Crier (@damdam_s).</description>
    <link>https://dev.to/damdam_s</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F621674%2Faf4deb0e-d7dc-46c3-8613-339f394cba80.jpeg</url>
      <title>DEV Community: Damien Crier</title>
      <link>https://dev.to/damdam_s</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/damdam_s"/>
    <language>en</language>
    <item>
      <title>Odoo: Customizing the values when timesheeting </title>
      <dc:creator>Damien Crier</dc:creator>
      <pubDate>Wed, 09 Mar 2022 12:58:32 +0000</pubDate>
      <link>https://dev.to/camptocamp-odoo/odoo-customizing-the-values-when-timesheeting-1jdo</link>
      <guid>https://dev.to/camptocamp-odoo/odoo-customizing-the-values-when-timesheeting-1jdo</guid>
      <description>&lt;p&gt;Your company uses Odoo &amp;gt;= v14 to manage timesheet and has a default setting to timesheet in Days?&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnu0l5k5u1anuknqhff7q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnu0l5k5u1anuknqhff7q.png" alt="Timesheet config settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, the only values you can select are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;0.0&lt;/li&gt;
&lt;li&gt;0.5&lt;/li&gt;
&lt;li&gt;1.0&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdbvk05p1vpafr1oi1le.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdbvk05p1vpafr1oi1le.gif" alt="TS range selectable"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fortunately, the widget supports customization!&lt;/p&gt;

&lt;p&gt;In the view definition, you can add an option to define a new range usable for the widget for this view. With the following code, you will be able to select any tenth of a day:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;options="{'range':[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]}"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Demonstration:&lt;/p&gt;

&lt;p&gt;In the tree view of the timesheets, change the definition of the field &lt;code&gt;unit_amount&lt;/code&gt; by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;field name="unit_amount"
    optional="show" 
    widget="timesheet_uom" 
    sum="Total" 
    decoration-danger="unit_amount &amp;gt; 24" 
    options="{'range':[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]}"
/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here is the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxhg0iaamxn3dym7e6kx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxhg0iaamxn3dym7e6kx.gif" alt="TS range selectable customized"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>odoo</category>
      <category>widget</category>
      <category>tips</category>
      <category>camptocamp</category>
    </item>
  </channel>
</rss>
