Skip to content

18.0 tutorial importable modules aras #811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: 18.0
Choose a base branch
from

Conversation

abdrahmanrashed
Copy link

No description provided.

-added menus to access estate views from main menu.
-Added list view to estate property type.
-Added menu to access estate property type.
-Added access rights to estate property type.
-Added some related fields to estate property.
-Added the new fields to the view.
-created list view for estate property tag.
-created menu to access estate property tags.
-created a filed for tag ids in estate property.
-Added the new field to estate property view.
-Added access rights to the model.
-created list and form view to model.
-Added offer ids field to estate property model, and added it to its view.
… field to evaluate its value.

-Added the new field to the models form view.
… country.

-Added the field to the model's form view.
-Added the action to a button in estate property view.
-Added access rights to public user.
-Added read and write record rules to public user.
-Added server action to return estate property list.
@robodoo
Copy link

robodoo commented Jun 6, 2025

Pull request status dashboard

Copy link

@vava-odoo vava-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job. Please find a few remarks while going through your code. Hope it helps

<field name="name">x_user_id</field>
<field name="field_description">Salesperson</field>
<field name="ttype">many2one</field>
<field name="relation">res.partner</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Salesperson is a user, no?

</record>

<record id="field_estate_property_proprty_type_id" model="ir.model.fields">
<field name="model_id" ref="estate.model_estate_property" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref to an id of the same module works without having to specify the complete xmlid

Suggested change
<field name="model_id" ref="estate.model_estate_property" />
<field name="model_id" ref="model_estate_property" />

This is not true when dealing with env.ref

<field name="model_id" ref="estate.model_estate_property" />
<field name="name">x_total_area</field>
<field name="field_description">Total Area</field>
<field name="ttype">float</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since both areas are integers, you may want to stick with integers

Suggested change
<field name="ttype">float</field>
<field name="ttype">integer</field>

Comment on lines +56 to +61
for offer in records:
offer.write({'x_status': 'accepted'})
offer.x_property_id.write({'x_selling_price': offer.x_price, 'x_partner_id': offer.x_partner_id})
for rejected_offer in offer.x_property_id.x_property_offer_ids:
if rejected_offer != offer:
rejected_offer.write({'x_status': 'refused'})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but what if you accept two offers for the same property? It seems like only one will be accepted, but it is kind of magic, no? Shouldn't we take more care (and maybe raise in such cases)?


<record id="field_estate_property_api_published" model="ir.model.fields">
<field name="model_id" ref="estate.model_estate_property" />
<field name="name">x_api_published</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you find out how to set a default value for this field?

<field name="model_id" ref="model_estate_property"/>
<field name="domain_force">[('x_api_published','=',True)]</field>
<field name="groups" eval="[(4, ref('base.group_public'))]"/>
<field name="perm_read" eval="True"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default the rule applies to all perm_* fields, so this one is not mandatory (and somehow misleading, because you are giving other rights too)

Suggested change
<field name="perm_read" eval="True"/>



registry.category("web_tour.tours").add('estate_tour', {
url: "/web",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url is now defined in the xml web_tour (and should point to /odoo). But since this is the default value, you don't have to :-)

Suggested change
url: "/web",

url: "/web",
steps: () => [{
trigger: '.o_app[data-menu-xmlid="estate.menu_root"]',
content: 'Start selling your properties from this app!',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you want to translate the string here?

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>

<odoo>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User probably don't want this tour to show up anytime they upgrade, so setting this as noupdate seems appropriate

Comment on lines +61 to +63
<group>
<field name="x_property_offer_ids"/>
</group>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better without a group here

Suggested change
<group>
<field name="x_property_offer_ids"/>
</group>
<field name="x_property_offer_ids"/>


<record id="field_estate_property_total_area" model="ir.model.fields">
<field name="model_id" ref="estate.model_estate_property" />
<field name="name">x_total_area</field>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to store that field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants