Skip to content

First commit #823

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 1 commit into
base: 18.0
Choose a base branch
from
Open

First commit #823

wants to merge 1 commit into from

Conversation

etpr-odoo
Copy link

No description provided.

@robodoo
Copy link

robodoo commented Jun 18, 2025

Pull request status dashboard

Copy link

@aboo-odoo aboo-odoo left a comment

Choose a reason for hiding this comment

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

Hey! Good job for this PR, I have left some comments for you to fix 🎉

I'd say the biggest thing you need to pay attention to is your consistency and overall code cleanliness. Sometimes you place spaces, sometimes you don't, you put upper case when you shouldn't, etc.

A few generic comments:

  • Could you add a description to the PR and change the PR title according to the guideline [XYZ] module: short desc. like for a commit message link
  • Usually, you'll want one commit / task to keep the chain of commits as clean and small as possible. As here, the task is to create the module Estate, it should be the one commit on your branch. Could you squash your commits into 1 ?

'author': "PRIN",
'category': 'Category',
'description': """
Just a dummy estate app

Choose a reason for hiding this comment

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

Not nice to call it dummy ... It has feeling too :/

@@ -0,0 +1 @@
from . import models

Choose a reason for hiding this comment

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

Try to always add a EOL in each file so that when someone adds lines in the future, the last line of the previous devs is not in the diff

@@ -0,0 +1,74 @@
from odoo import api,fields,models

Choose a reason for hiding this comment

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

Suggested change
from odoo import api,fields,models
from odoo import api, fields, models

_name = "estate.property"
_description = "Estate property file"

name = fields.Char('Name',required=True, translate=True, default='Unknown')

Choose a reason for hiding this comment

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

What do you think the translate does here ?


class estate_property_offer(models.Model):
_name = "estate.property.offer"
_description = "Estate property offer file"

Choose a reason for hiding this comment

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

file ? Your description what this model is, not the file

@api.depends("validity")
def _compute_date_deadline(self):
for record in self:
record.date_dateline=fields.Date.context_today(self)+relativedelta(days=record.validity)

Choose a reason for hiding this comment

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

Should the validity be computed from the creation date ? I mean, you create an offer today with a validity of 7 days. It should expire next Monday. Currently, it always expires 7 days after today so, if I look tomorrow, it will expire next Tuesday


def _inverser_date_deadline(self):
for record in self:
record.validity = (record.date_dateline - fields.Date.context_today(self)).days

Choose a reason for hiding this comment

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

Same here

</list>
</field>
</record>
<record id="estate_property_offer_view" model="ir.actions.act_window">

Choose a reason for hiding this comment

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

You're creating an action not a view here. The convention is <model_name>_action

Choose a reason for hiding this comment

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

Mind that the convention for model ordering is:

  1. Private attributes (_name, _description, _inherit, _sql_constraints, …)
  2. Default method and default_get
  3. Field declarations
  4. Compute, inverse and search methods in the same order as field declaration
  5. Selection method (methods used to return computed values for selection fields)
  6. Constrains methods (@api.constrains) and onchange methods (@api.onchange)
  7. CRUD methods (ORM overrides)
  8. Action methods
  9. And finally, other business methods.

@etpr-odoo etpr-odoo force-pushed the 18.0-tutorial-etpr branch from 0140323 to f14ce88 Compare June 26, 2025 08:36
@aboo-odoo
Copy link

  1. git add <files> - to add changes to your future commit
  2. git commit - to commit the change
  3. git fetch origin 18.0 - to fetch the latest change on the main branch
  4. git rebase 18.0 -i - to get the lastest change on your branch (may trigger conflicts) and squash all your commits into one
  5. git push --force-with-lease dev - to push on your branch

Utils:

  • git stash - to store current change in a stack
  • git stash pop - to add back the earliest change in the stack

git status - to help you overall

@aboo-odoo
Copy link

Now that your onboarding is done, could you close the PR ? 😄

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