Skip to content

Commit

Permalink
[ADD] repair_order_partner_is_company: Add company filter in partner_…
Browse files Browse the repository at this point in the history
…id in repair_order
  • Loading branch information
unaiberis committed Feb 19, 2025
1 parent 3817dc6 commit 58987ae
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 0 deletions.
53 changes: 53 additions & 0 deletions repair_order_partner_is_company/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
:target: https://opensource.org/licenses/LGPL-3.0
:alt: License: LGPL-3

======================================
Repair Order Form Partner Only Company
======================================

Overview
========

The **Repair Order Form Partner Only Company** module restricts the selection of partners in the repair order form to only companies.

Features
========

- **Restricts Partner Selection**:

- The `partner_id` field in the repair order form will only display partners that are companies.

Usage
=====

1. **Install the Module**:

- Install the **Repair Order Form Partner Only Company** module from the Apps menu.

2. **Open Repair Orders**:

- Navigate to *Repairs* → *Repair Orders*.

- The `partner_id` field will only show partners marked as companies.

Bug Tracker
===========

If you encounter any issues, please report them on the GitHub repository at `GitHub Issues <https://github.com/avanzosc/odoo-addons/issues>`_.

Credits
=======

Contributors
------------

* Ana Juaristi <anajuaristi@avanzosc.es>
* Unai Beristain <unaiberistain@avanzosc.es>

For specific questions or support, please contact the contributors.

License
=======

This project is licensed under the LGPL-3 License. For more details, refer to the LICENSE file or visit <https://opensource.org/licenses/LGPL-3.0>.
1 change: 1 addition & 0 deletions repair_order_partner_is_company/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# No necesita lógica Python, solo vistas XML
12 changes: 12 additions & 0 deletions repair_order_partner_is_company/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Repair Order Form Partner Only Company",
"version": "16.0.1.0.0",
"category": "Repair",
"author": "Avanzosc",
"license": "LGPL-3",
"depends": ["repair"],
"data": ["views/repair_order_view.xml"],
"installable": True,
"application": False,
"website": "https://github.com/avanzosc/odoo-addons",
}
15 changes: 15 additions & 0 deletions repair_order_partner_is_company/views/repair_order_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_repair_order_form_inherit" model="ir.ui.view">
<field name="name">repair.order.form.partner.only.company</field>
<field name="model">repair.order</field>
<field name="inherit_id" ref="repair.view_repair_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute
name="domain"
>[('is_company', '=', True), ('customer_rank', '&gt;', 0)]</attribute>
</xpath>
</field>
</record>
</odoo>
6 changes: 6 additions & 0 deletions setup/repair_order_partner_is_company/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 58987ae

Please sign in to comment.