Skip to content

Commit

Permalink
[MIG] partner_invoicing_mode_weekly: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
acsonefho committed Dec 31, 2024
1 parent 1b1e09e commit e21d806
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 33 deletions.
2 changes: 0 additions & 2 deletions partner_invoicing_mode_weekly/data/ir_cron.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
<field name="model_id" ref="model_sale_order" />
<field name="code">model.cron_generate_weekly_invoices()</field>
<field
Expand Down
3 changes: 2 additions & 1 deletion partner_invoicing_mode_weekly/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from odoo import api, models
from odoo.fields import Datetime
from odoo.osv import expression


class SaleOrder(models.Model):
Expand Down Expand Up @@ -33,7 +34,7 @@ def _get_companies_weekly_invoicing(self):
"""Get company ids for which today is weekly invoicing day."""
today = Datetime.now()
domain = [
"|",
expression.OR_OPERATOR,
("invoicing_mode_weekly_last_execution", "<", today),
("invoicing_mode_weekly_last_execution", "=", False),
("invoicing_mode_weekly_day_todo", "=", today.weekday()),
Expand Down
52 changes: 22 additions & 30 deletions partner_invoicing_mode_weekly/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,31 @@
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="model">res.config.settings</field>
<field name="arch" type="xml">
<div id="standard_invoicing_settings" position="after">
<div
class="row mt16 o_settings_container"
id="weekly_invoicing_settings"
>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<span class="o_form_label">Weekly Invoicing Options</span>
<div class="content-group">
<div class="row mt16">
<label
string="Weekly invoicing day"
for="res_invoicing_mode_weekly_day_todo"
class="col-lg-4 o_light_label"
/>
<field name="res_invoicing_mode_weekly_day_todo" />
</div>
<div class="row mt16">
<label
string="Last executed on"
for="invoicing_mode_weekly_last_execution"
class="col-lg-4 o_light_label"
/>
<field
name="invoicing_mode_weekly_last_execution"
/>
</div>
</div>
<xpath expr="//setting[@id='invoicing_mode']" position="inside">
<div class="mt16">
<div class="text-muted">
<span>Weekly Invoicing Options</span>
</div>
<div class="content-group">
<div class="row mt16">
<label
string="Weekly invoicing day"
for="res_invoicing_mode_weekly_day_todo"
class="col-lg-4 o_light_label"
/>
<field name="res_invoicing_mode_weekly_day_todo" />
</div>
<div class="row mt16">
<label
string="Last executed on"
for="invoicing_mode_weekly_last_execution"
class="col-lg-4 o_light_label"
/>
<field name="invoicing_mode_weekly_last_execution" />
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

0 comments on commit e21d806

Please sign in to comment.