From 8bd21209d927a54489c27202d15a6af467550798 Mon Sep 17 00:00:00 2001 From: Abdul Aziz Amrullah Date: Mon, 18 May 2026 11:30:15 +0700 Subject: [PATCH] Initial Commit --- .gitignore | 1 + README.md | 36 ++++++++++++++++++++++++++++++++++++ __init__.py | 1 + __manifest__.py | 15 +++++++++++++++ models/__init__.py | 1 + models/res_partner.py | 11 +++++++++++ views/res_partner_views.xml | 17 +++++++++++++++++ 7 files changed, 82 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 __init__.py create mode 100644 __manifest__.py create mode 100644 models/__init__.py create mode 100644 models/res_partner.py create mode 100644 views/res_partner_views.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed8ebf5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ba44410 --- /dev/null +++ b/README.md @@ -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 diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..d7ba7df --- /dev/null +++ b/__manifest__.py @@ -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', +} diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..91fed54 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/models/res_partner.py b/models/res_partner.py new file mode 100644 index 0000000..a15426f --- /dev/null +++ b/models/res_partner.py @@ -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') diff --git a/views/res_partner_views.xml b/views/res_partner_views.xml new file mode 100644 index 0000000..93f2db8 --- /dev/null +++ b/views/res_partner_views.xml @@ -0,0 +1,17 @@ + + + + + res.partner.form.inherit.res.partner.extended + res.partner + + + + + + + + + + +