Public release from ruodoo-project: 19.0 - 2026-05-10 21:19:01 UTC
This commit is contained in:
1
dadata_connector/wizard/__init__.py
Normal file
1
dadata_connector/wizard/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from . import res_partner_auto_data_wizard
|
||||
40
dadata_connector/wizard/res_partner_auto_data_wizard.py
Normal file
40
dadata_connector/wizard/res_partner_auto_data_wizard.py
Normal file
@ -0,0 +1,40 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartnerAutoDataWizard(models.TransientModel):
|
||||
_name = "res.partner.auto_data.wizard"
|
||||
_description = "Wizard for autofilling partner"
|
||||
|
||||
partner_id = fields.Many2one(
|
||||
string="Partner",
|
||||
comodel_name="res.partner",
|
||||
)
|
||||
|
||||
vat = fields.Char(
|
||||
string="Identification Number", help="Identification Number for selected type"
|
||||
)
|
||||
|
||||
status = fields.Selection(
|
||||
string="Status",
|
||||
selection=[
|
||||
("active", "Active"),
|
||||
("liquidating", "Liquidating"),
|
||||
("liquidated", "Liquidated"),
|
||||
("bankrupt", "Bankrupt"),
|
||||
("reorganizing", "Reorganizing"),
|
||||
],
|
||||
)
|
||||
organization_type = fields.Selection(
|
||||
string="Type of organization",
|
||||
selection=[
|
||||
("legal", "Legal entity"),
|
||||
("individual", "Individual entrepreneur"),
|
||||
],
|
||||
help="Legal entity or individual entrepreneur",
|
||||
)
|
||||
name = fields.Char(string="Full name")
|
||||
|
||||
full_address = fields.Text(string="Full legal address")
|
||||
|
||||
def button_yes(self):
|
||||
return {"type": "ir.actions.act_window_close", "infos": {"update": True}}
|
||||
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="res_partner_auto_data_wizard_view_form" model="ir.ui.view">
|
||||
<field name="name">Partner with auto data wizard view form</field>
|
||||
<field name="model">res.partner.auto_data.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form create="0" delete="0" edit="0">
|
||||
<group>
|
||||
<field name="status"
|
||||
decoration-success="status == 'active'"
|
||||
decoration-danger="status != 'active'"/>
|
||||
<field name="organization_type"/>
|
||||
<field name="name"/>
|
||||
<field name="full_address"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Yes" class="oe_highlight" name="button_yes" type="object"/>
|
||||
<button string="No" class="btn btn-secondary" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user