File tree 5 files changed +41
-1
lines changed
academic_sale_subscription
5 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 2
2
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3
3
{
4
4
"name" : "Academic Sale Subscription" ,
5
- "version" : "18.0.1.0 .0" ,
5
+ "version" : "18.0.1.1 .0" ,
6
6
"sequence" : 14 ,
7
7
"summary" : "" ,
8
8
"author" : "ADHOC SA" ,
17
17
"wizard/academic_order_wizard_views.xml" ,
18
18
"views/res_partner_views.xml" ,
19
19
"views/sale_subscription_views.xml" ,
20
+ "views/res_config_settings_views.xml" ,
20
21
],
21
22
"installable" : True ,
22
23
"auto_install" : False ,
Original file line number Diff line number Diff line change 5
5
from . import res_partner
6
6
from . import sale_order_line
7
7
from . import academic_group
8
+ from . import res_config_settings
Original file line number Diff line number Diff line change
1
+ from odoo import fields , models
2
+
3
+
4
+ class ResConfigSettings (models .TransientModel ):
5
+ _inherit = "res.config.settings"
6
+
7
+ enable_zero_price_subscription_invoice = fields .Boolean (
8
+ config_parameter = "academic_sale_subscription.enable_zero_price_subscription_invoice" ,
9
+ string = "Invoice subscriptions with zero total" ,
10
+ )
Original file line number Diff line number Diff line change @@ -121,3 +121,14 @@ def action_show_duplicate_subscriptions(self):
121
121
"domain" : self .get_duplicate_subscription_ids (),
122
122
"context" : "{'search_default_customer': 1}" ,
123
123
}
124
+
125
+ def _invoice_is_considered_free (self , invoiceable_lines ):
126
+ is_free , is_exception = super ()._invoice_is_considered_free (invoiceable_lines )
127
+ param_enabled = (
128
+ self .env ["ir.config_parameter" ]
129
+ .sudo ()
130
+ .get_param ("academic_sale_subscription.enable_zero_price_subscription_invoice" )
131
+ )
132
+ if is_free and param_enabled :
133
+ is_free = False
134
+ return is_free , is_exception
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <odoo >
3
+ <record id =" res_config_settings_view_form_inherit" model =" ir.ui.view" >
4
+ <field name =" name" >res.config.settings.view.form.inherit</field >
5
+ <field name =" model" >res.config.settings</field >
6
+ <field name =" inherit_id" ref =" sale_subscription.res_config_settings_view_form" />
7
+ <field name =" arch" type =" xml" >
8
+ <setting id =" invoice_consolidation" position =" after" >
9
+ <setting
10
+ id =" enable_zero_price_subscription_invoice"
11
+ help =" Enable this to allow invoicing subscription lines even if their total is zero." >
12
+ <field name =" enable_zero_price_subscription_invoice" />
13
+ </setting >
14
+ </setting >
15
+ </field >
16
+ </record >
17
+ </odoo >
You can’t perform that action at this time.
0 commit comments