Merge pull request #2646 from expsa/task_11959

Task 11959
This commit is contained in:
FathiaBMExp 2025-03-13 13:13:51 +01:00 committed by GitHub
commit 01ba8a17e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 67 additions and 3 deletions

View File

@ -147,3 +147,13 @@ msgstr "منظمين الفعاليات"
#: model:ir.actions.act_window,name:odex25_website_event_track_gantt.action_organizer_form
msgid "Event Organizers"
msgstr "منظمين الفعاليات"
#. module: odex25_website_event_track_gantt
#: model:ir.model.fields,field_description:odex25_website_event_track_gantt.field_res_partner__contact_person
msgid "Contact person"
msgstr "أسم مسؤول التواصل"
#. module: odex25_website_event_track_gantt
#: model:ir.model.fields,field_description:odex25_website_event_track_gantt.field_event_sponsor__contact_person
msgid "Partner contact person"
msgstr "أسم مسؤول التواصل عند الشريك"

View File

@ -2,3 +2,4 @@
from . import event_event
from . import res_partner
from . import event_sponsor

View File

@ -0,0 +1,7 @@
from odoo import fields, models
class Sponsor(models.Model):
_inherit = "event.sponsor"
contact_person = fields.Char(string="Partner contact person", related="partner_id.contact_person")

View File

@ -7,3 +7,4 @@ class ResPartner(models.Model):
is_event_address = fields.Boolean(string="Event address")
is_organizer = fields.Boolean(string="Organizer")
is_sponsor = fields.Boolean(string="Sponsor")
contact_person = fields.Char(string="Contact person")

View File

@ -28,10 +28,12 @@
<attribute name="context">{'show_address': 1, 'default_is_event_address': True,'default_is_company':
True}
</attribute>
<attribute name="options">{'no_create': True, 'no_create_edit': True}</attribute>
<attribute name="domain">[('is_event_address','=',True)]</attribute>
</xpath>
<xpath expr="//field[@name='organizer_id']" position="attributes">
<attribute name="context">{'default_is_company': True,'default_is_organizer': True,}</attribute>
<attribute name="options">{'no_create': True, 'no_create_edit': True}</attribute>
<attribute name="domain">[('is_organizer','=',True)]</attribute>
</xpath>
<xpath expr="//field[@name='address_id']" position="after">
@ -49,4 +51,19 @@
</xpath>
</field>
</record>
<!-- Allow "Create and Edit" only for a specific group -->
<record id="event_event_form_view_group" model="ir.ui.view">
<field name="name">event.event.form.view.group</field>
<field name="model">event.event</field>
<field name="inherit_id" ref="event_event_view_form"/>
<field name="groups_id" eval="[(4, ref('event.group_event_manager'))]"/>
<field name="arch" type="xml">
<field name="address_id" position="attributes">
<attribute name="options">{'no_create': False, 'no_create_edit': False}</attribute>
</field>
<field name="organizer_id" position="attributes">
<attribute name="options">{'no_create': False, 'no_create_edit': False}</attribute>
</field>
</field>
</record>
</odoo>

View File

@ -8,15 +8,40 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="context">{'default_is_company': True, 'default_is_sponsor': True}</attribute>
<attribute name="options">{'no_create': True, 'no_create_edit': True}</attribute>
<attribute name="domain">[('is_sponsor','=',True)]</attribute>
</xpath>
<xpath expr="//field[@name='partner_id']" position="after">
<field name="contact_person"/>
</xpath>
</field>
</record>
<record id="event_sponsor_view_form_group" model="ir.ui.view">
<field name="name">event.sponsor.view.form.group</field>
<field name="model">event.sponsor</field>
<field name="inherit_id" ref="website_event_track.event_sponsor_view_form"/>
<field name="groups_id" eval="[(4, ref('event.group_event_manager'))]"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="options">{'no_create': False, 'no_create_edit': False}</attribute>
</xpath>
</field>
</record>
<record id="event_sponsors_action" model="ir.actions.act_window">
<field name="name">Event Sponsors</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">event.sponsor</field>
<field name="view_mode">kanban,tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a Sponsor
</p>
</field>
</record>
<menuitem name="Event Sponsors"
id="menu_event_sponsor"
id="menu_event_sponsors"
sequence="4"
parent="event.menu_event_configuration"
action="website_event_track.event_sponsor_action_from_event"
action="event_sponsors_action"
groups="event.group_event_manager"/>
</odoo>

View File

@ -20,6 +20,9 @@
<xpath expr="//field[@name='mobile']" position="attributes">
<attribute name="attrs">{'required': [('is_sponsor', '=', True)]}</attribute>
</xpath>
<xpath expr="//field[@name='mobile']" position="after">
<field name="contact_person"/>
</xpath>
</field>
</record>
<record id="res_partner_view_form_inherit_sponsor" model="ir.ui.view">