Skip to content

Commit

Permalink
Added formio default js options
Browse files Browse the repository at this point in the history
  • Loading branch information
Q-Niranjan committed Jan 8, 2025
1 parent c72e7c9 commit db9c53b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions g2p_formio/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"g2p_program_documents",
],
"data": [
"data/formio_default_js_option.xml",
"views/formio_builder.xml",
"views/program_view.xml",
"wizard/g2p_self_service_program_view_wizard.xml",
Expand Down
10 changes: 10 additions & 0 deletions g2p_formio/data/formio_default_js_option.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Inherit and modify the existing record -->
<record id="formio.config_param_formio_builder_js_options_default" model="ir.config_parameter">
<field
name="value"
eval="ref('formio_storage_filestore.formio_builder_js_options_storage_filestore')"
/>
</record>
</odoo>
2 changes: 1 addition & 1 deletion g2p_formio/wizard/g2p_self_service_program_view_wizard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
<page string="Portal Form">
<group>
<field name="is_multiple_form_submission" />
<field name="self_service_portal_form" />
<field name="portal_form_builder_id" />
</group>
</page>
</xpath>
Expand Down
8 changes: 5 additions & 3 deletions g2p_formio/wizard/program_form_mapping_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
class G2PCreateProgramWizard(models.TransientModel):
_inherit = "g2p.program.create.wizard"

self_service_portal_form = fields.Many2one("formio.builder", string="Program Form")
portal_form_builder_id = fields.Many2one(
"formio.builder", string="Program Form", domain="[('is_form_mapped_with_program', '=', False)]"
)

is_multiple_form_submission = fields.Boolean(default=False)

def create_program(self):
res = super().create_program()

program = self.env["g2p.program"].browse(res["res_id"])
portal_form = self.self_service_portal_form
portal_form = self.portal_form_builder_id

if portal_form:
program.self_service_portal_form = portal_form
program.portal_form_builder_id = portal_form

program.is_multiple_form_submission = self.is_multiple_form_submission

Expand Down

0 comments on commit db9c53b

Please sign in to comment.