feat: separate fusion field service and LTC into standalone modules, update core modules
- fusion_claims: separated field service logic, updated controllers/views - fusion_tasks: updated task views and map integration - fusion_authorizer_portal: added page 11 signing, schedule booking, migrations - fusion_shipping: new standalone shipping module (Canada Post, FedEx, DHL, Purolator) - fusion_ltc_management: new standalone LTC management module
This commit is contained in:
5
fusion_ltc_management/wizard/__init__.py
Normal file
5
fusion_ltc_management/wizard/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2024-2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
|
||||
from . import ltc_repair_create_so_wizard
|
||||
48
fusion_ltc_management/wizard/ltc_repair_create_so_wizard.py
Normal file
48
fusion_ltc_management/wizard/ltc_repair_create_so_wizard.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2024-2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class LTCRepairCreateSOWizard(models.TransientModel):
|
||||
_name = 'fusion.ltc.repair.create.so.wizard'
|
||||
_description = 'LTC Repair - Link Contact & Create Sale Order'
|
||||
|
||||
repair_id = fields.Many2one(
|
||||
'fusion.ltc.repair',
|
||||
string='Repair Request',
|
||||
required=True,
|
||||
readonly=True,
|
||||
)
|
||||
client_name = fields.Char(
|
||||
string='Client Name',
|
||||
readonly=True,
|
||||
)
|
||||
action_type = fields.Selection([
|
||||
('create_new', 'Create New Contact'),
|
||||
('link_existing', 'Link to Existing Contact'),
|
||||
], string='Action', default='create_new', required=True)
|
||||
partner_id = fields.Many2one(
|
||||
'res.partner',
|
||||
string='Existing Contact',
|
||||
)
|
||||
|
||||
def action_confirm(self):
|
||||
self.ensure_one()
|
||||
repair = self.repair_id
|
||||
|
||||
if self.action_type == 'create_new':
|
||||
if not self.client_name:
|
||||
raise UserError(_('Client name is required to create a new contact.'))
|
||||
partner = self.env['res.partner'].create({
|
||||
'name': self.client_name,
|
||||
})
|
||||
repair.client_id = partner
|
||||
elif self.action_type == 'link_existing':
|
||||
if not self.partner_id:
|
||||
raise UserError(_('Please select an existing contact.'))
|
||||
repair.client_id = self.partner_id
|
||||
|
||||
return repair._create_linked_sale_order()
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_ltc_repair_create_so_wizard_form" model="ir.ui.view">
|
||||
<field name="name">fusion.ltc.repair.create.so.wizard.form</field>
|
||||
<field name="model">fusion.ltc.repair.create.so.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Link Contact">
|
||||
<group>
|
||||
<field name="repair_id" invisible="1"/>
|
||||
<field name="client_name"/>
|
||||
<field name="action_type" widget="radio"/>
|
||||
<field name="partner_id"
|
||||
invisible="action_type != 'link_existing'"
|
||||
required="action_type == 'link_existing'"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="action_confirm" type="object"
|
||||
string="Confirm & Create Sale Order"
|
||||
class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-secondary"
|
||||
special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user