Skip to content

[ADD] module: add new module real estate (Onboarding)#1238

Open
yogietama wants to merge 15 commits intoodoo:19.0from
odoo-dev:19.0-onboarding-yomet
Open

[ADD] module: add new module real estate (Onboarding)#1238
yogietama wants to merge 15 commits intoodoo:19.0from
odoo-dev:19.0-onboarding-yomet

Conversation

@yogietama
Copy link
Copy Markdown

Create Real Estate Module for onboarding program

@robodoo
Copy link
Copy Markdown

robodoo commented Apr 21, 2026

Pull request status dashboard

@yogietama yogietama requested a review from delcourtfl April 21, 2026 15:16
@yogietama yogietama force-pushed the 19.0-onboarding-yomet branch from 2dd0080 to 5d0a3ce Compare April 22, 2026 08:23
@yogietama yogietama force-pushed the 19.0-onboarding-yomet branch from 5d0a3ce to aeda88e Compare April 22, 2026 08:37
Comment thread estate/__manifest__.py Outdated
Comment thread estate/models/__init__.py Outdated
Comment thread estate/__manifest__.py Outdated
Comment thread estate/__manifest__.py Outdated
Comment thread estate/views/estate_property_views.xml Outdated
Comment thread estate/views/estate_property_views.xml Outdated
Comment thread estate/models/estate_property.py
Comment thread estate/models/estate_property.py Outdated
Comment thread estate/models/estate_property.py Outdated
Comment thread estate/__manifest__.py Outdated
@delcourtfl
Copy link
Copy Markdown

Hello there ! Good work already, just added a few comments.

Also it seems your first commit has the wrong author set (most probably because your config was not properly set before pushing, might want to check into this as a general git exercise)

Copy link
Copy Markdown

@delcourtfl delcourtfl left a comment

Choose a reason for hiding this comment

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

Hello there ! Good work already, just a few comments.

(Might also need to check runbot style CI for some additional issues)

Comment thread estate/models/estate_property.py Outdated
Comment thread estate/models/estate_property.py Outdated
Comment thread estate/models/estate_property.py Outdated
Comment thread estate/models/estate_propery_offer.py
Comment thread estate/models/estate_propery_offer.py Outdated
Comment thread estate/models/estate_propery_offer.py Outdated
Comment thread estate/security/ir.model.access.csv Outdated
Comment thread estate/__manifest__.py Outdated
yogietama and others added 5 commits April 27, 2026 16:47
This commit is here to introduce the testing framework of Odoo. Try running the
tests using `--test-tags :TestEstateProperty`.

Doc:
https://www.odoo.com/documentation/18.0/developer/reference/backend/testing.html?highlight=tests#invocation

The tests were made such that the first one should work but the second one
should fail. Your job is to ensure both tests pass in the end. You should update
the behaviour of the appropriate models.

If you want, you can also add a small test of your own to get a feel for it.

Chapter 15: The final word
@yogietama yogietama force-pushed the 19.0-onboarding-yomet branch 3 times, most recently from 46168e4 to d9f9dcd Compare April 29, 2026 07:17
@yogietama yogietama force-pushed the 19.0-onboarding-yomet branch from d9f9dcd to 2cbde50 Compare April 29, 2026 07:24
@yogietama yogietama force-pushed the 19.0-onboarding-yomet branch from 6c038b6 to 014cf91 Compare April 29, 2026 09:39
Copy link
Copy Markdown

@delcourtfl delcourtfl left a comment

Choose a reason for hiding this comment

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

Hello there ! Really good work, not much to say, you got the general idea for module development.

Also to end this part in a clean way you should squash your commits (using an interactive rebase) into:

  • one for estate module
  • one for estate_account module

(And don't forget to check the runbot style CI 👀)


def action_sold(self):
for record in self:
if record.state == "sancelled":
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Small typo there

Suggested change
if record.state == "sancelled":
if record.state == "cancelled":

Comment on lines +108 to +110
@api.model
def create(self, vals_list):
return super().create(vals_list)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Better to remove if unused

record.property_id.partner_id = record.partner_id
record.property_id.state = "offer accepted"

def refused_offer(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Better to explicitly keep action in the name in this case: action_refuse_offer

Comment on lines +77 to +81
for vals in val_list:
property_id = vals.get('property_id')

if property_id:
property_record = self.env['estate.property'].browse(property_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid making search and browse calls on each iteration of the loop (this is quite important as it could cause performance issues). Batching the search and filtering inside the loop for the relevant results could be a better approach for that.

sequence = "2"
/>
</data>
</odoo> No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

😢

Comment on lines +8 to +25
for record in self:
self.env['account.move'].create({
'partner_id': record.user_id.id,
'move_type': 'out_invoice',

'invoice_line_ids': [
Command.create({
'name': record.name,
'quantity': 1,
'price_unit': record.selling_price * 0.06,
}),
Command.create({
'name': 'Administrative Fees',
'quantity': 1,
'price_unit': 100.00,
}),
],
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For performance you could also avoid creating in the loop, you can make a list of values to create and call the create on all of them at once at the end.

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.

4 participants