Initial Commit

This commit is contained in:
Abdul Aziz Amrullah 2026-05-18 11:30:15 +07:00
commit 8bd21209d9
7 changed files with 82 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

36
README.md Normal file
View File

@ -0,0 +1,36 @@
# Res Partner Extended
This is a custom Odoo 19 module that extends the default `res.partner` (Contact) model to store additional personal information.
## Features
This module introduces two new custom fields to the Contact form:
1. **Gender (`gender`)**: A selection field that allows users to specify the gender of the contact.
- Available options: `Male`, `Female`.
2. **Birth Date (`birth_date`)**: A date field that allows users to record the date of birth of the contact.
## User Interface
The new fields are seamlessly integrated into the standard Odoo interface. They are placed in the main `res.partner` form view (`base.view_partner_form`), positioned immediately below the address format block. This ensures a natural flow of information when creating or editing a contact's profile.
## Technical Details
- **Model Extended**: `res.partner`
- **Fields Added**:
- `gender` (Type: `fields.Selection`)
- `birth_date` (Type: `fields.Date`)
- **View Inherited**: `base.view_partner_form`
- **Dependencies**: `base`, `contacts`
## Installation Instructions
1. Place the `res_partner_extended` folder into your Odoo addons directory.
2. Restart the Odoo service.
3. Enable **Developer Mode** in your Odoo instance (Settings -> Scroll down -> Activate the developer mode).
4. Navigate to the **Apps** menu and click on **Update Apps List**.
5. Remove the `Apps` filter in the search bar and search for `Res Partner Extended`.
6. Click the **Activate** (or **Install**) button.
## Author
Abdul Aziz Amrullah

1
__init__.py Normal file
View File

@ -0,0 +1 @@
from . import models

15
__manifest__.py Normal file
View File

@ -0,0 +1,15 @@
{
'name': 'Res Partner Extended',
'version': '1.0',
'summary': 'Add gender and birth date to Partner',
'description': 'Add custom fields gender and birth date below the address in res.partner model.',
'author': 'Abdul Aziz Amrullah',
'category': 'Sales/CRM',
'depends': ['base', 'contacts'],
'data': [
'views/res_partner_views.xml',
],
'installable': True,
'application': False,
'license': 'LGPL-3',
}

1
models/__init__.py Normal file
View File

@ -0,0 +1 @@
from . import res_partner

11
models/res_partner.py Normal file
View File

@ -0,0 +1,11 @@
from odoo import models, fields
class ResPartner(models.Model):
_inherit = 'res.partner'
gender = fields.Selection([
('Male', 'Male'),
('Female', 'Female'),
], string='Gender')
birth_date = fields.Date(string='Birth Date')

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_partner_form_inherit_res_partner_extended" model="ir.ui.view">
<field name="name">res.partner.form.inherit.res.partner.extended</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<!-- Place the new fields right after the address format block -->
<xpath expr="//div[hasclass('o_address_format')]" position="after">
<field name="gender"/>
<field name="birth_date"/>
</xpath>
</field>
</record>
</data>
</odoo>