Add initial Odoo FSM modules and deployment make targets
This commit is contained in:
1
odoo/addons/dsrpt_repair_customers/__init__.py
Normal file
1
odoo/addons/dsrpt_repair_customers/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
14
odoo/addons/dsrpt_repair_customers/__manifest__.py
Normal file
14
odoo/addons/dsrpt_repair_customers/__manifest__.py
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "DSRPT Repair Customers",
|
||||
"summary": "Customers, contacts, and addresses",
|
||||
"version": "19.0.1.0.0",
|
||||
"category": "Services",
|
||||
"author": "DisruptLab",
|
||||
"license": "LGPL-3",
|
||||
"depends": ["base", "dsrpt_repair_main"],
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
"views/customer_views.xml",
|
||||
],
|
||||
"installable": True,
|
||||
}
|
||||
1
odoo/addons/dsrpt_repair_customers/models/__init__.py
Normal file
1
odoo/addons/dsrpt_repair_customers/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import customer
|
||||
42
odoo/addons/dsrpt_repair_customers/models/customer.py
Normal file
42
odoo/addons/dsrpt_repair_customers/models/customer.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class RepairCustomer(models.Model):
|
||||
_name = "repair.customer"
|
||||
_description = "Repair Customer"
|
||||
_order = "name"
|
||||
|
||||
name = fields.Char(required=True)
|
||||
zone_id = fields.Many2one("repair.fsm.zone", string="FSM Zone")
|
||||
note = fields.Text()
|
||||
contact_ids = fields.One2many("repair.customer.contact", "customer_id", string="Contacts")
|
||||
address_ids = fields.One2many("repair.customer.address", "customer_id", string="Addresses")
|
||||
|
||||
|
||||
class RepairCustomerContact(models.Model):
|
||||
_name = "repair.customer.contact"
|
||||
_description = "Repair Customer Contact"
|
||||
|
||||
customer_id = fields.Many2one("repair.customer", required=True, ondelete="cascade")
|
||||
contact_type = fields.Selection(
|
||||
selection=[
|
||||
("phone", "Phone"),
|
||||
("email", "Email"),
|
||||
("telegram", "Telegram"),
|
||||
("other", "Other"),
|
||||
],
|
||||
required=True,
|
||||
default="phone",
|
||||
)
|
||||
value = fields.Char(required=True)
|
||||
|
||||
|
||||
class RepairCustomerAddress(models.Model):
|
||||
_name = "repair.customer.address"
|
||||
_description = "Repair Customer Address"
|
||||
|
||||
customer_id = fields.Many2one("repair.customer", required=True, ondelete="cascade")
|
||||
label = fields.Char(required=True, default="Service Address")
|
||||
street = fields.Char(required=True)
|
||||
zone_id = fields.Many2one("repair.fsm.zone", string="FSM Zone")
|
||||
details = fields.Text()
|
||||
@@ -0,0 +1,4 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_repair_customer_user,repair.customer user,model_repair_customer,base.group_user,1,1,1,1
|
||||
access_repair_customer_contact_user,repair.customer.contact user,model_repair_customer_contact,base.group_user,1,1,1,1
|
||||
access_repair_customer_address_user,repair.customer.address user,model_repair_customer_address,base.group_user,1,1,1,1
|
||||
|
57
odoo/addons/dsrpt_repair_customers/views/customer_views.xml
Normal file
57
odoo/addons/dsrpt_repair_customers/views/customer_views.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<record id="view_repair_customer_tree" model="ir.ui.view">
|
||||
<field name="name">repair.customer.tree</field>
|
||||
<field name="model">repair.customer</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<field name="name"/>
|
||||
<field name="zone_id"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_repair_customer_form" model="ir.ui.view">
|
||||
<field name="name">repair.customer.form</field>
|
||||
<field name="model">repair.customer</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="zone_id"/>
|
||||
<field name="note"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Contacts">
|
||||
<field name="contact_ids" context="{'default_customer_id': id}">
|
||||
<list editable="bottom">
|
||||
<field name="contact_type"/>
|
||||
<field name="value"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Addresses">
|
||||
<field name="address_ids" context="{'default_customer_id': id}">
|
||||
<list editable="bottom">
|
||||
<field name="label"/>
|
||||
<field name="street"/>
|
||||
<field name="zone_id"/>
|
||||
<field name="details"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_repair_customer" model="ir.actions.act_window">
|
||||
<field name="name">Customers</field>
|
||||
<field name="res_model">repair.customer</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_repair_customers" name="Customers" parent="dsrpt_repair_main.menu_repair_root" action="action_repair_customer" sequence="20"/>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user