Skip to content
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

Simple Commit for Creating a PR #192

Open
wants to merge 23 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#2a4d34", // Dark green for active background
"activityBar.background": "#2a4d34", // Dark green for background
"sash.hoverBorder": "#2a4d34", // Dark green hover border
"statusBar.background": "#1b362e", // Darker green for status bar
"statusBarItem.hoverBackground": "#2a4d34", // Dark green hover for status bar item
"statusBarItem.remoteBackground": "#1b362e", // Darker green for remote status bar item
"titleBar.activeBackground": "#1b362e", // Dark green for active title bar
"titleBar.inactiveBackground": "#1b362e99", // Dark green for inactive title bar with transparency
"tab.activeBorder": "#2a4d34", // Dark green active tab border
"activityBarBadge.background": "#b32d4f", // Retained red badge background
"activityBarBadge.foreground": "#e7e7e7", // White badge text
"activityBar.foreground": "#e7e7e7", // White activity bar text
"activityBar.inactiveForeground": "#e7e7e799", // Faded white for inactive activity bar
"commandCenter.border": "#e7e7e799", // Light grey border for command center
"statusBar.foreground": "#e7e7e7", // White text for status bar
"statusBarItem.remoteForeground": "#e7e7e7", // White text for remote status bar item
"titleBar.activeForeground": "#e7e7e7", // White text for active title bar
"titleBar.inactiveForeground": "#e7e7e799", // Faded white for inactive title bar
"statusBar.debuggingBackground": "#3a2c21", // Dark brownish-green for debugging status bar
"statusBar.debuggingForeground": "#e7e7e7", // White text for debugging status bar
"editorGroup.border": "#2a4d34", // Dark green for editor group border
"panel.border": "#2a4d34", // Dark green for panel border
"sideBar.border": "#2a4d34", // Dark green for sidebar border
"statusBar.border": "#1b362e", // Dark green for status bar border
"statusBar.debuggingBorder": "#3a2c21", // Dark brownish-green border for debugging status bar
"titleBar.border": "#1b362e", // Dark green for title bar border
"folderPathColor.custom1": "#4a6c34", // Dark olive green for custom folder path 1
"folderPathColor.custom2": "#8d5f3f", // Earthy brown for custom folder path 2
"folderPathColor.custom3": "#557e47", // Medium dark green for custom folder path 3
"folderPathColor.custom4": "#5a7d58", // Muted green for custom folder path 4
"folderPathColor.custom5": "#4c9f85" // Teal green for custom folder path 5
}

}
Copy link

Choose a reason for hiding this comment

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

IDE-specific configurations are user-dependent and should not be included in the codebase.

Suggested change
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#2a4d34", // Dark green for active background
"activityBar.background": "#2a4d34", // Dark green for background
"sash.hoverBorder": "#2a4d34", // Dark green hover border
"statusBar.background": "#1b362e", // Darker green for status bar
"statusBarItem.hoverBackground": "#2a4d34", // Dark green hover for status bar item
"statusBarItem.remoteBackground": "#1b362e", // Darker green for remote status bar item
"titleBar.activeBackground": "#1b362e", // Dark green for active title bar
"titleBar.inactiveBackground": "#1b362e99", // Dark green for inactive title bar with transparency
"tab.activeBorder": "#2a4d34", // Dark green active tab border
"activityBarBadge.background": "#b32d4f", // Retained red badge background
"activityBarBadge.foreground": "#e7e7e7", // White badge text
"activityBar.foreground": "#e7e7e7", // White activity bar text
"activityBar.inactiveForeground": "#e7e7e799", // Faded white for inactive activity bar
"commandCenter.border": "#e7e7e799", // Light grey border for command center
"statusBar.foreground": "#e7e7e7", // White text for status bar
"statusBarItem.remoteForeground": "#e7e7e7", // White text for remote status bar item
"titleBar.activeForeground": "#e7e7e7", // White text for active title bar
"titleBar.inactiveForeground": "#e7e7e799", // Faded white for inactive title bar
"statusBar.debuggingBackground": "#3a2c21", // Dark brownish-green for debugging status bar
"statusBar.debuggingForeground": "#e7e7e7", // White text for debugging status bar
"editorGroup.border": "#2a4d34", // Dark green for editor group border
"panel.border": "#2a4d34", // Dark green for panel border
"sideBar.border": "#2a4d34", // Dark green for sidebar border
"statusBar.border": "#1b362e", // Dark green for status bar border
"statusBar.debuggingBorder": "#3a2c21", // Dark brownish-green border for debugging status bar
"titleBar.border": "#1b362e", // Dark green for title bar border
"folderPathColor.custom1": "#4a6c34", // Dark olive green for custom folder path 1
"folderPathColor.custom2": "#8d5f3f", // Earthy brown for custom folder path 2
"folderPathColor.custom3": "#557e47", // Medium dark green for custom folder path 3
"folderPathColor.custom4": "#5a7d58", // Muted green for custom folder path 4
"folderPathColor.custom5": "#4c9f85" // Teal green for custom folder path 5
}
}

2 changes: 2 additions & 0 deletions awesome_kanban/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
},
'license': 'AGPL-3'
}

#Comment for creating a pull request.
Copy link

Choose a reason for hiding this comment

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

Don't forget to remove this.

2 changes: 2 additions & 0 deletions estate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
cgun-odoo marked this conversation as resolved.
Show resolved Hide resolved
from . import models
Copy link

Choose a reason for hiding this comment

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

Suggested change
from . import models
from . import models

Remember to leave an empty line at the end of files. While it seems trivial, it ensures compatibility with many tools and version control systems.

34 changes: 34 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
{
'name': "Estate",

'summary': """
Tutorial starting module
""",

'description': """
Tutorial starting module
""",

'author': "Cemal Faruk Guney",

# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/data/ir_module_category_data.xml
# for the full list
cgun-odoo marked this conversation as resolved.
Show resolved Hide resolved
'category': 'Tutorials/Estate',
'version': '0.1',

# any module necessary for this one to work correctly
cgun-odoo marked this conversation as resolved.
Show resolved Hide resolved
'depends': ['base'],
'application': True,
'installable': True,
Copy link

Choose a reason for hiding this comment

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

Suggested change
'installable': True,

installable is true by default.

'data': [
'security/ir.model.access.csv',
'views/estate_property_tag_views.xml',
'views/estate_property_type_views.xml',
'views/estate_property_views.xml',
'views/estate_property_offer_views.xml',
'views/estate_menus.xml'
],
'license': 'AGPL-3'
}
4 changes: 4 additions & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import estate_property
from . import estate_property_type
from . import estate_property_tag
from . import estate_property_offer
Copy link

Choose a reason for hiding this comment

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

Same as before, missing trailing line.

54 changes: 54 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from odoo import fields, models
from datetime import date, timedelta

class EstateProperty(models.Model):
_name = "estate.property"
_description = "Estate Property"

name = fields.Char('Title', required=True)

description = fields.Text('Description')

postcode = fields.Char('Postcode')

date_availability = fields.Date('Available From', copy=False, default=date.today() + timedelta(days=90))
Copy link

Choose a reason for hiding this comment

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

Suggested change
date_availability = fields.Date('Available From', copy=False, default=date.today() + timedelta(days=90))
date_availability = fields.Date('Available From', copy=False, default=lambda: fields.Date.today() + timedelta(days=90))
  • With the way things are now, the default date will be calculated only once at the start of the server. To make sure that it is calculated correctly every time it is need, you need to wrap the value inside a function.
  • for date default values, we prefer to get today's date from fields.Date.today()
  • also, you can use months=3 instead of days=90,


expected_price = fields.Float('Expected Price', required=True)

selling_price = fields.Float('Selling Price', readonly=True, copy=False)

bedrooms = fields.Integer('Bedrooms', default=2)

living_area = fields.Integer('Living Area (sqm)')

facades = fields.Integer('Facades')

garage = fields.Boolean('Garage')

garden = fields.Boolean('Garden')

garden_area = fields.Integer('Garden Area (sqm)')

garden_orientation = fields.Selection(
string='Garden Orientation',
selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')])

state = fields.Selection(
string='Status',
required=True,
copy=False,
default='new',
selection=[('new', 'New'), ('received', 'Offer Received'), ('accepted', 'Offer Accepted'), ('sold', 'Sold'), ('cancelled', 'Cancelled')])
Copy link

Choose a reason for hiding this comment

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

nitpick 😄

Suggested change
garden_orientation = fields.Selection(
string='Garden Orientation',
selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')])
state = fields.Selection(
string='Status',
required=True,
copy=False,
default='new',
selection=[('new', 'New'), ('received', 'Offer Received'), ('accepted', 'Offer Accepted'), ('sold', 'Sold'), ('cancelled', 'Cancelled')])
garden_orientation = fields.Selection(
string="Garden Orientation",
selection=[
('north', "North"),
('south', "South"),
('east', "East"),
('west', "West"),
],
)
state = fields.Selection(
string="Status",
required=True,
copy=False,
default='new',
selection=[
('new', "New"),
('received', "Offer Received"),
('accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled"),
],
)


active = fields.Boolean('Active', default=True)

property_type_id = fields.Many2one('estate.property.type', 'Property Type')

buyer_id = fields.Many2one('res.partner', 'Buyer', copy=False)

salesperson_id = fields.Many2one('res.users', 'Salesperson', default=lambda self: self.env.user)

tag_ids = fields.Many2many('estate.property.tag')

offer_ids = fields.One2many('estate.property.offer', 'property_id')

Copy link

Choose a reason for hiding this comment

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

Same as before, missing trailing line.

10 changes: 10 additions & 0 deletions estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import models, fields

class EstatePropertyOffer(models.Model):
_name="estate.property.offer"
_description="Estate Property Offer"

price=fields.Float("Price")
status=fields.Selection([("accepted", "Accepted"), ("refused", "Refused")], copy=False)
partner_id = fields.Many2one('res.partner', 'Partner', required=True)
property_id = fields.Many2one('estate.property', 'Property', required=True)
7 changes: 7 additions & 0 deletions estate/models/estate_property_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import models, fields

class EstatePropertyTag(models.Model):
_name="estate.property.tag"
_description="Estate Property Tag"

name=fields.Char("Name", required=True)
Copy link

Choose a reason for hiding this comment

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

Same as before, missing trailing line.

7 changes: 7 additions & 0 deletions estate/models/estate_property_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models

class EstatePropertyType(models.Model):
_name="estate.property.type"
_description="Estate Property Type"

name = fields.Char('Type', required=True)
Copy link

Choose a reason for hiding this comment

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

Same as before, missing trailing line.

5 changes: 5 additions & 0 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1
access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1
access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1
cgun-odoo marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<odoo>
<menuitem id="estate_menu_root" name="Estate">
<menuitem id="estate_first_level_menu" name="Advertisements">
<menuitem id="estate_menu_action" action="estate_property_action"/>
</menuitem>
<menuitem id="estate_settings_menu" name="Settings">
<menuitem id="estate_settings_menu_type_action" action="estate_property_type_action"/>
<menuitem id="estate_settings_menu_tag_action" action="estate_property_tag_action"/>
</menuitem>
</menuitem>
</odoo>
cgun-odoo marked this conversation as resolved.
Show resolved Hide resolved
31 changes: 31 additions & 0 deletions estate/views/estate_property_offer_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<odoo>
<record id="estate_property_offer_view_list" model="ir.ui.view">
<field name="name">estate.property.offer.list</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<list string="Offers">
<field name="price"/>
<field name="partner_id"/>
<field name="status"/>
</list>
</field>
</record>

<record id="estate_property_offer_view_form" model="ir.ui.view">
<field name="name">estate.property.offer.form</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<form string="Property Offer">
<sheet>
<group>
<field name="price" />
<field name="status" />
<field name="partner_id" />
</group>
</sheet>
</form>
</field>
</record>

</odoo>
cgun-odoo marked this conversation as resolved.
Show resolved Hide resolved
43 changes: 43 additions & 0 deletions estate/views/estate_property_tag_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0"?>
<odoo>

<record id="estate_property_tag_view_list" model="ir.ui.view">
<field name="name">estate.property.tag.list</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<list string="Property Tags">
<field name="name"/>
</list>
</field>
</record>

<record id="estate_property_tag_view_form" model="ir.ui.view">
<field name="name">estate.property.tag.form</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<form string="Property Tag">
<sheet>
<group>
<field name="name" placeholder="e.g. Cozy" />
</group>
</sheet>
</form>
</field>
</record>

<record id="estate_property_tag_view_search" model="ir.ui.view">
<field name="name">estate.property.tag.search</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<search string="Search Tags">
<field name="name"/>
</search>
</field>
Copy link

Choose a reason for hiding this comment

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

Suggested change
<field name="name">estate.property.tag.search</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<search string="Search Tags">
<field name="name"/>
</search>
</field>
<field name="name">estate.property.tag.search</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<search string="Search Tags">
<field name="name" />
</search>
</field>

</record>

<record id="estate_property_tag_action" model="ir.actions.act_window">
<field name="name">Property Tags</field>
<field name="res_model">estate.property.tag</field>
<field name="view_mode">list,form</field>
</record>
</odoo>
cgun-odoo marked this conversation as resolved.
Show resolved Hide resolved
43 changes: 43 additions & 0 deletions estate/views/estate_property_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0"?>
<odoo>

<record id="estate_property_type_view_list" model="ir.ui.view">
<field name="name">estate.property.type.list</field>
<field name="model">estate.property.type</field>
<field name="arch" type="xml">
<list string="Property Types">
<field name="name"/>
</list>
</field>
</record>

<record id="estate_property_type_view_form" model="ir.ui.view">
<field name="name">estate.property.type.form</field>
<field name="model">estate.property.type</field>
<field name="arch" type="xml">
<form string="Property Type">
<sheet>
<div class="oe_title">
<h1><field class="text-break" options="{'line_breaks': False}" widget="text" name="name" placeholder="e.g. House" /></h1>
</div>
</sheet>
</form>
</field>
</record>

<record id="estate_property_type_view_search" model="ir.ui.view">
<field name="name">estate.property.type.search</field>
<field name="model">estate.property.type</field>
<field name="arch" type="xml">
<search string="Search Property Types">
<field name="name"/>
</search>
</field>
</record>

<record id="estate_property_type_action" model="ir.actions.act_window">
<field name="name">Property Types</field>
<field name="res_model">estate.property.type</field>
<field name="view_mode">list,form</field>
</record>
</odoo>
cgun-odoo marked this conversation as resolved.
Show resolved Hide resolved
Loading