File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
sale_order_add_byproduct/models Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def _add_byproducts_to_sale_order(self):
102102 )
103103 else :
104104 # Get the template from the config parameter
105- config_settings = self .env [' res.config.settings' ].create ({})
105+ config_settings = self .env [" res.config.settings" ].create ({})
106106 note_template = config_settings .get_byproduct_note_template ()
107107 if note_template :
108108 note = note_template .format (
Original file line number Diff line number Diff line change @@ -15,15 +15,19 @@ class ResConfigSettings(models.TransientModel):
1515
1616 def get_byproduct_note_template (self ):
1717 """Get the byproduct note template from config parameters."""
18- return self .env ['ir.config_parameter' ].sudo ().get_param (
19- 'sale_order_add_byproduct.byproduct_note_template' ,
20- '{product_name} (By-product from MO: {mo_name})'
18+ return (
19+ self .env ["ir.config_parameter" ]
20+ .sudo ()
21+ .get_param (
22+ "sale_order_add_byproduct.byproduct_note_template" ,
23+ "{product_name} (By-product from MO: {mo_name})" ,
24+ )
2125 )
2226
2327 def set_byproduct_note_template (self ):
2428 """Set the byproduct note template in config parameters."""
2529 if self .byproduct_note_template is not False : # Check for False specifically
26- self .env [' ir.config_parameter' ].sudo ().set_param (
27- ' sale_order_add_byproduct.byproduct_note_template' ,
28- self .byproduct_note_template or ''
30+ self .env [" ir.config_parameter" ].sudo ().set_param (
31+ " sale_order_add_byproduct.byproduct_note_template" ,
32+ self .byproduct_note_template or "" ,
2933 )
You can’t perform that action at this time.
0 commit comments