Skip to content

Commit

Permalink
[FIX] sale_timesheet_invoice_description: Fix bug TID
Browse files Browse the repository at this point in the history
Fix bug of setting Timesheet Invoice Description field as false by default or in the configuration and sales view
Improve sale model allowing for a False situation of Timesheet Invoice Description
  • Loading branch information
mario committed May 6, 2024
1 parent 1f08500 commit 8305bbf
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sale_timesheet_invoice_description/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Contributors

- `Binhex Systems Solutions <https://binhex.cloud>`__:

- Mario Luis Mora <m.luis@binhex.cloud>
- Mario Luis <m.luis@binhex.cloud>

Maintainers
-----------
Expand Down
1 change: 1 addition & 0 deletions sale_timesheet_invoice_description/models/res_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ResConfigSettings(models.TransientModel):
selection="_get_timesheet_invoice_description",
string="Timesheet Invoice Description",
default_model="sale.order",
default="000",
)

@api.model
Expand Down
2 changes: 2 additions & 0 deletions sale_timesheet_invoice_description/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def _get_timesheet_invoice_description(self):

def _get_timesheet_details(self, timesheet, desc_rule):
details = []
if not desc_rule:
return details

Check warning on line 30 in sale_timesheet_invoice_description/models/sale.py

View check run for this annotation

Codecov / codecov/patch

sale_timesheet_invoice_description/models/sale.py#L30

Added line #L30 was not covered by tests
if desc_rule[0] == "1":
details.append(fields.Date.to_string(timesheet.date))
if desc_rule[1] == "1":
Expand Down
2 changes: 1 addition & 1 deletion sale_timesheet_invoice_description/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
- Dhara Solanki \<<dhara.solanki@initos.com>\>
- Andreas Zöllner \<<andreas.zoellner@initos.com>\>
- [Binhex Systems Solutions](https://binhex.cloud):
- Mario Luis Mora \<<m.luis@binhex.cloud>\>
- Mario Luis \<<m.luis@binhex.cloud>\>
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
</ul>
</li>
<li><a class="reference external" href="https://binhex.cloud">Binhex Systems Solutions</a>:<ul>
<li>Mario Luis Mora &lt;<a class="reference external" href="mailto:m.luis&#64;binhex.cloud">m.luis&#64;binhex.cloud</a>&gt;</li>
<li>Mario Luis &lt;<a class="reference external" href="mailto:m.luis&#64;binhex.cloud">m.luis&#64;binhex.cloud</a>&gt;</li>
</ul>
</li>
</ul>
Expand Down
5 changes: 4 additions & 1 deletion sale_timesheet_invoice_description/views/res_config_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
Default timesheet details on invoice lines
</div>
<div class="text-muted">
<field name="default_timesheet_invoice_description" />
<field
name="default_timesheet_invoice_description"
required="1"
/>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sale_timesheet_invoice_description/views/sale_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<field name="show_update_fpos" position="after">
<field name="timesheet_invoice_description" />
<field name="timesheet_invoice_description" required="1" />
<field name="timesheet_invoice_split" />
</field>
</field>
Expand Down

0 comments on commit 8305bbf

Please sign in to comment.