diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 00000000000..e4a1269e945
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,5 @@
+repos:
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.15.1
+ hooks:
+ - id: ruff
\ No newline at end of file
diff --git a/awesome_clicker/__init__.py b/awesome_clicker/__init__.py
index 40a96afc6ff..e69de29bb2d 100644
--- a/awesome_clicker/__init__.py
+++ b/awesome_clicker/__init__.py
@@ -1 +0,0 @@
-# -*- coding: utf-8 -*-
diff --git a/awesome_clicker/__manifest__.py b/awesome_clicker/__manifest__.py
index 56dc2f779b9..757187fcf37 100644
--- a/awesome_clicker/__manifest__.py
+++ b/awesome_clicker/__manifest__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
{
'name': "Awesome Clicker",
@@ -25,5 +24,5 @@
],
},
- 'license': 'AGPL-3'
+ 'license': 'AGPL-3',
}
diff --git a/awesome_dashboard/__init__.py b/awesome_dashboard/__init__.py
index b0f26a9a602..f705942f8f1 100644
--- a/awesome_dashboard/__init__.py
+++ b/awesome_dashboard/__init__.py
@@ -1,3 +1,2 @@
-# -*- coding: utf-8 -*-
from . import controllers
diff --git a/awesome_dashboard/__manifest__.py b/awesome_dashboard/__manifest__.py
index a1cd72893d7..36b6884bc3a 100644
--- a/awesome_dashboard/__manifest__.py
+++ b/awesome_dashboard/__manifest__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
{
'name': "Awesome Dashboard",
@@ -26,5 +25,5 @@
'awesome_dashboard/static/src/**/*',
],
},
- 'license': 'AGPL-3'
+ 'license': 'AGPL-3',
}
diff --git a/awesome_dashboard/controllers/__init__.py b/awesome_dashboard/controllers/__init__.py
index 457bae27e11..f705942f8f1 100644
--- a/awesome_dashboard/controllers/__init__.py
+++ b/awesome_dashboard/controllers/__init__.py
@@ -1,3 +1,2 @@
-# -*- coding: utf-8 -*-
-from . import controllers
\ No newline at end of file
+from . import controllers
diff --git a/awesome_dashboard/controllers/controllers.py b/awesome_dashboard/controllers/controllers.py
index 05977d3bd7f..f82423c6b9e 100644
--- a/awesome_dashboard/controllers/controllers.py
+++ b/awesome_dashboard/controllers/controllers.py
@@ -1,13 +1,12 @@
-# -*- coding: utf-8 -*-
import logging
import random
from odoo import http
-from odoo.http import request
logger = logging.getLogger(__name__)
+
class AwesomeDashboard(http.Controller):
@http.route('/awesome_dashboard/statistics', type='jsonrpc', auth='user')
def get_statistics(self):
@@ -31,6 +30,5 @@ def get_statistics(self):
's': random.randint(0, 150),
'xl': random.randint(0, 150),
},
- 'total_amount': random.randint(100, 1000)
+ 'total_amount': random.randint(100, 1000),
}
-
diff --git a/awesome_gallery/__init__.py b/awesome_gallery/__init__.py
index a0fdc10fe11..0650744f6bc 100644
--- a/awesome_gallery/__init__.py
+++ b/awesome_gallery/__init__.py
@@ -1,2 +1 @@
-# -*- coding: utf-8 -*-
from . import models
diff --git a/awesome_gallery/__manifest__.py b/awesome_gallery/__manifest__.py
index f0fe026a9c6..d02b7cf4a2a 100644
--- a/awesome_gallery/__manifest__.py
+++ b/awesome_gallery/__manifest__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
{
'name': "Gallery View",
'summary': """
@@ -23,5 +22,5 @@
],
},
'author': 'Odoo S.A.',
- 'license': 'AGPL-3'
+ 'license': 'AGPL-3',
}
diff --git a/awesome_gallery/models/__init__.py b/awesome_gallery/models/__init__.py
index 7f0930ee744..c1bbf7a7f7d 100644
--- a/awesome_gallery/models/__init__.py
+++ b/awesome_gallery/models/__init__.py
@@ -1,4 +1,2 @@
-# -*- coding: utf-8 -*-
# import filename_python_file_within_folder_or_subfolder
-from . import ir_action
-from . import ir_ui_view
+from . import ir_action, ir_ui_view
diff --git a/awesome_gallery/models/ir_action.py b/awesome_gallery/models/ir_action.py
index eae20acbf5c..39b702ed039 100644
--- a/awesome_gallery/models/ir_action.py
+++ b/awesome_gallery/models/ir_action.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
from odoo import fields, models
@@ -6,5 +5,5 @@ class ActWindowView(models.Model):
_inherit = 'ir.actions.act_window.view'
view_mode = fields.Selection(selection_add=[
- ('gallery', "Awesome Gallery")
- ], ondelete={'gallery': 'cascade'})
+ ('gallery', "Awesome Gallery"),
+ ], ondelete={'gallery': 'cascade'})
diff --git a/awesome_gallery/models/ir_ui_view.py b/awesome_gallery/models/ir_ui_view.py
index 0c11b8298ac..96120decb62 100644
--- a/awesome_gallery/models/ir_ui_view.py
+++ b/awesome_gallery/models/ir_ui_view.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
from odoo import fields, models
diff --git a/awesome_kanban/__init__.py b/awesome_kanban/__init__.py
index 40a96afc6ff..e69de29bb2d 100644
--- a/awesome_kanban/__init__.py
+++ b/awesome_kanban/__init__.py
@@ -1 +0,0 @@
-# -*- coding: utf-8 -*-
diff --git a/awesome_kanban/__manifest__.py b/awesome_kanban/__manifest__.py
index 6f31bc8de0d..df0b9427a54 100644
--- a/awesome_kanban/__manifest__.py
+++ b/awesome_kanban/__manifest__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
{
'name': "Awesome Kanban",
'summary': """
@@ -23,5 +22,5 @@
],
},
'author': 'Odoo S.A.',
- 'license': 'AGPL-3'
+ 'license': 'AGPL-3',
}
diff --git a/awesome_owl/__init__.py b/awesome_owl/__init__.py
index 457bae27e11..f705942f8f1 100644
--- a/awesome_owl/__init__.py
+++ b/awesome_owl/__init__.py
@@ -1,3 +1,2 @@
-# -*- coding: utf-8 -*-
-from . import controllers
\ No newline at end of file
+from . import controllers
diff --git a/awesome_owl/__manifest__.py b/awesome_owl/__manifest__.py
index 55002ab81de..c7b3e867a47 100644
--- a/awesome_owl/__manifest__.py
+++ b/awesome_owl/__manifest__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
{
'name': "Awesome Owl",
@@ -39,5 +38,5 @@
'awesome_owl/static/src/**/*',
],
},
- 'license': 'AGPL-3'
+ 'license': 'AGPL-3',
}
diff --git a/awesome_owl/controllers/__init__.py b/awesome_owl/controllers/__init__.py
index 457bae27e11..f705942f8f1 100644
--- a/awesome_owl/controllers/__init__.py
+++ b/awesome_owl/controllers/__init__.py
@@ -1,3 +1,2 @@
-# -*- coding: utf-8 -*-
-from . import controllers
\ No newline at end of file
+from . import controllers
diff --git a/awesome_owl/controllers/controllers.py b/awesome_owl/controllers/controllers.py
index bccfd6fe283..a50010bfca1 100644
--- a/awesome_owl/controllers/controllers.py
+++ b/awesome_owl/controllers/controllers.py
@@ -1,5 +1,6 @@
from odoo import http
-from odoo.http import request, route
+from odoo.http import request
+
class OwlPlayground(http.Controller):
@http.route(['/awesome_owl'], type='http', auth='public')
diff --git a/estate/__init__.py b/estate/__init__.py
new file mode 100644
index 00000000000..0650744f6bc
--- /dev/null
+++ b/estate/__init__.py
@@ -0,0 +1 @@
+from . import models
diff --git a/estate/__manifest__.py b/estate/__manifest__.py
new file mode 100644
index 00000000000..d7eecfb32a0
--- /dev/null
+++ b/estate/__manifest__.py
@@ -0,0 +1,16 @@
+{
+ 'name': 'Estate',
+ 'author': 'Sébastien Laurent',
+ "license": 'LGPL-3',
+ 'depends': ['base'],
+ 'application': True,
+ 'data': [
+ 'security/ir.model.access.csv',
+ 'views/estate_property_offer_views.xml',
+ 'views/estate_property_views.xml',
+ 'views/estate_property_type_views.xml',
+ 'views/estate_property_tag_views.xml',
+ 'views/estate_menus.xml',
+ 'views/res_users_views.xml',
+ ],
+}
diff --git a/estate/models/__init__.py b/estate/models/__init__.py
new file mode 100644
index 00000000000..8d1b0ed8937
--- /dev/null
+++ b/estate/models/__init__.py
@@ -0,0 +1,7 @@
+from . import (
+ estate_property,
+ estate_property_offer,
+ estate_property_tag,
+ estate_property_type,
+ res_users,
+)
diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py
new file mode 100644
index 00000000000..51c59cff650
--- /dev/null
+++ b/estate/models/estate_property.py
@@ -0,0 +1,119 @@
+from odoo import api, exceptions, fields, models, tools
+
+
+class EstateProperty(models.Model):
+ _name = "estate.property"
+ _description = "This is my first model"
+ _order = "id desc"
+
+ @api.ondelete(at_uninstall=False)
+ def cannot_delete_new_cancelled_properties(self):
+ for property in self:
+ if not property.state in ['new', 'cancelled']:
+ error_message = "You can not delete a property in new or cancelled state!"
+ raise exceptions.ValidationError(error_message)
+
+ # Atomic fields
+ name = fields.Char(required=True)
+ description = fields.Text()
+ postcode = fields.Char()
+ date_availability = fields.Date(copy=False, default=fields.Date.add(fields.Date.today(), month=3))
+ expected_price = fields.Float(required=True)
+ selling_price = fields.Float(readonly=True, copy=False)
+ bedrooms = fields.Integer(default=2)
+ living_area = fields.Integer()
+ facades = fields.Integer()
+ garage = fields.Boolean()
+ garden = fields.Boolean()
+ garden_area = fields.Integer()
+ garden_orientation = fields.Selection(
+ string='Garden Orientation',
+ selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')],
+ help="Orientation of the estate",
+ )
+ active = fields.Boolean(default=True)
+ state = fields.Selection(
+ string="Status",
+ selection=[
+ ('new', 'New'),
+ ('offer_received', 'Offer Received'),
+ ('offer_accepted', 'Offer Accepted'),
+ ('sold', 'Sold'),
+ ('cancelled', 'Cancelled'),
+ ],
+ help='Status of the estate',
+ default='new',
+ )
+
+ # Relational fields
+ property_type_id = fields.Many2one("estate.property.type", string="Property Type")
+ salesman_id = fields.Many2one("res.users", string="Salesman")
+ buyer_id = fields.Many2one("res.partner", string="Buyer", readonly=True)
+ accepted_price = fields.Integer(readonly=True)
+ tag_ids = fields.Many2many("estate.property.tag", string="Tags")
+ offer_ids = fields.One2many("estate.property.offer", "property_id", string="Offers")
+
+ # Computed fields
+ total_area = fields.Float(compute="_compute_total_area")
+ best_price = fields.Float(compute="_compute_best_price")
+
+ # Constraints
+ _check_expected_price = models.Constraint(
+ 'CHECK(expected_price > 0)',
+ 'The expected price should be strictly greater than zero!',
+ )
+
+ _check_seling_price = models.Constraint(
+ 'CHECK(selling_price >= 0)',
+ 'The seling price should be greater than zero!',
+ )
+
+ @api.constrains('selling_price')
+ def _check_selling_price(self):
+ for record in self:
+ if tools.float_is_zero(record.selling_price, precision_digits=2) is True:
+ continue
+
+ if tools.float_compare(record.selling_price, 0.9 * record.expected_price, precision_digits=2) < 1:
+ error_message = "Selling price can not be lower than 90% of the expected price"
+ raise exceptions.ValidationError(error_message)
+
+ # Compute methods
+ @api.depends("living_area", "garden_area")
+ def _compute_total_area(self):
+ for record in self:
+ record.total_area = (record.garden_area or 0) + (record.living_area or 0)
+
+ @api.depends("offer_ids")
+ def _compute_best_price(self):
+ for record in self:
+ record.best_price = max(record.offer_ids.mapped("price"), default=0) or 0
+
+ # Onchange
+ @api.onchange("garden")
+ def _onchange_garden(self):
+ if self.garden is True:
+ self.garden_orientation = 'north'
+ self.garden_area = 10
+ else:
+ self.garden_orientation = False
+ self.garden_area = False
+
+ # Button logic
+ def sold_button(self):
+ for record in self:
+ if record.state == 'cancelled':
+ error_message = "This estate property is cancelled. You can not sell it!"
+ raise exceptions.UserError(error_message)
+ record.state = 'sold'
+
+ return True
+
+ def cancelled_button(self):
+ for record in self:
+ if record.state == 'sold':
+ error_message = "This estate property is sold. You can not cancel it!"
+ raise exceptions.UserError(error_message)
+ record.state = 'cancelled'
+
+ return True
diff --git a/estate/models/estate_property_offer.py b/estate/models/estate_property_offer.py
new file mode 100644
index 00000000000..02b8bc079fb
--- /dev/null
+++ b/estate/models/estate_property_offer.py
@@ -0,0 +1,88 @@
+from dateutil.relativedelta import relativedelta
+
+from odoo import api, exceptions, fields, models
+from odoo.tools.float_utils import float_compare
+
+
+class EstatePropertyOffer(models.Model):
+ _name = "estate.property.offer"
+ _description = "This is my fourth model"
+ _order = "price desc"
+
+ @api.model_create_multi
+ def create(self, vals_list):
+ for vals in vals_list:
+ property = self.env['estate.property'].browse(vals['property_id'])
+ if float_compare(vals['price'] or -1, property.best_price, precision_digits=2) <= 0:
+ error_message = "You can not add offer with a price lower than the current best price!"
+ raise exceptions.UserError(error_message)
+
+ records = super().create(vals_list)
+
+ for record in records:
+ record.property_id.state = 'offer_received'
+
+ return records
+
+ # Atomic fields
+
+ price = fields.Float()
+ status = fields.Selection(
+ string="Status",
+ selection=[
+ ("accepted", 'Accepted'),
+ ("refused", "Refused"),
+ ],
+ copy=False,
+ )
+ validity = fields.Integer(default=7)
+ date_deadline = fields.Date(compute="_compute_date_deadline", inverse="_inverse_date_deadline")
+
+ # Relational fields
+
+ partner_id = fields.Many2one("res.partner", string="Partner", required=True)
+ property_id = fields.Many2one("estate.property", string="Property", required=True)
+ property_type_id = fields.Many2one(
+ "estate.property.type",
+ string="Property type",
+ related="property_id.property_type_id",
+ store=True,
+ )
+
+ # Constraints
+ _check_offer_price = models.Constraint(
+ 'CHECK(price > 0)',
+ 'The price of the offer should be strictly greater than zero!',
+ )
+
+ # Compute methods
+ @api.depends("validity")
+ def _compute_date_deadline(self):
+ for record in self:
+ start_date = record.create_date or fields.Date.today()
+
+ record.date_deadline = start_date + relativedelta(days=record.validity)
+
+ def _inverse_date_deadline(self):
+ for record in self:
+ start_date = record.create_date or fields.Date.today()
+
+ record.validity = (record.date_deadline - start_date.date()).days
+
+ # Button logic
+ def accept_button(self):
+ for record in self:
+ offer_recordset = record.property_id.offer_ids
+ for offer in offer_recordset:
+ if offer.status == 'accepted' and offer != record:
+ error_message = "You can not accept multiple offer!"
+ raise exceptions.UserError(error_message)
+
+ record.property_id.buyer_id = record.partner_id
+ record.property_id.selling_price = record.price
+ record.property_id.state = 'offer_accepted'
+ record.status = 'accepted'
+
+ def refuse_button(self):
+ for record in self:
+ record.status = 'refused'
diff --git a/estate/models/estate_property_tag.py b/estate/models/estate_property_tag.py
new file mode 100644
index 00000000000..a102e8ba36b
--- /dev/null
+++ b/estate/models/estate_property_tag.py
@@ -0,0 +1,16 @@
+from odoo import fields, models
+
+
+class EstatePropertyTag(models.Model):
+ _name = "estate.property.tag"
+ _description = "This is my third model"
+ _order = "name"
+
+ name = fields.Char(required=True, string="Tag")
+
+ color = fields.Integer(default=0)
+
+ _unique_name = models.Constraint(
+ 'UNIQUE(name)',
+ 'The name of the tag should be unique!',
+ )
diff --git a/estate/models/estate_property_type.py b/estate/models/estate_property_type.py
new file mode 100644
index 00000000000..92e6ee381c4
--- /dev/null
+++ b/estate/models/estate_property_type.py
@@ -0,0 +1,24 @@
+from odoo import api, fields, models
+
+
+class EstatePropertyType(models.Model):
+ _name = "estate.property.type"
+ _description = "This is my second model"
+ _order = "sequence, name"
+
+ name = fields.Char(required=True)
+ sequence = fields.Integer()
+ offer_count = fields.Integer(compute="_compute_offer_count")
+
+ property_ids = fields.One2many('estate.property', 'property_type_id', string="Properties")
+ offer_ids = fields.One2many("estate.property.offer", "property_type_id", string="Offers")
+
+ _unique_name = models.Constraint(
+ 'UNIQUE(name)',
+ 'The name of the type must be unique!',
+ )
+
+ @api.depends("offer_ids")
+ def _compute_offer_count(self):
+ for record in self:
+ record.offer_count = len(record.offer_ids)
diff --git a/estate/models/res_users.py b/estate/models/res_users.py
new file mode 100644
index 00000000000..affb04a466e
--- /dev/null
+++ b/estate/models/res_users.py
@@ -0,0 +1,14 @@
+from odoo import fields, models
+
+
+class ResUsers(models.Model):
+ _name = "res.users"
+ _description = "Adding fields for the user model"
+ _inherit = ['res.users']
+
+ property_ids = fields.One2many(
+ 'estate.property',
+ 'salesman_id',
+ string="Estates",
+ domain=['|', ('state', '=', 'new'), ('state', '=', 'offer_received')],
+ )
diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv
new file mode 100644
index 00000000000..4c593ed42e4
--- /dev/null
+++ b/estate/security/ir.model.access.csv
@@ -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
\ No newline at end of file
diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml
new file mode 100644
index 00000000000..80e5a6e609f
--- /dev/null
+++ b/estate/views/estate_menus.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/estate/views/estate_property_offer_views.xml b/estate/views/estate_property_offer_views.xml
new file mode 100644
index 00000000000..321fd6c8e47
--- /dev/null
+++ b/estate/views/estate_property_offer_views.xml
@@ -0,0 +1,27 @@
+
+
+
+ Property Offer
+ estate.property.offer
+ list,form
+ [('property_type_id', '=', active_id)]
+
+
+
+ estate.property.offer.list
+ estate.property.offer
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/estate/views/estate_property_tag_views.xml b/estate/views/estate_property_tag_views.xml
new file mode 100644
index 00000000000..80522fa2f0c
--- /dev/null
+++ b/estate/views/estate_property_tag_views.xml
@@ -0,0 +1,30 @@
+
+
+
+ Property Tag
+ estate.property.tag
+ list
+
+
+
+ estate.property.tag.view.list
+ estate.property.tag
+
+
+
+
+
+
+
+
+ estate.property.tag.view.form
+ estate.property.tag
+
+
+
+
+
diff --git a/estate/views/estate_property_type_views.xml b/estate/views/estate_property_type_views.xml
new file mode 100644
index 00000000000..8e7b4f19ec3
--- /dev/null
+++ b/estate/views/estate_property_type_views.xml
@@ -0,0 +1,51 @@
+
+
+
+ Property Type
+ estate.property.type
+ list,form
+
+
+
+ estate.property.type.view.form
+ estate.property.type
+
+
+
+
+
+
+ estate.property.type.list
+ estate.property.type
+
+
+
+
+
+
+
+
diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml
new file mode 100644
index 00000000000..5f96b4a6716
--- /dev/null
+++ b/estate/views/estate_property_views.xml
@@ -0,0 +1,143 @@
+
+
+
+ Estates
+ estate.property
+ kanban,list,form
+
+ {'search_default_filter_availability': True}
+
+
+
+
+ estate.property.list
+ estate.property
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ estate.property.view.form
+ estate.property
+
+
+
+
+
+
+ estate.view.search
+ estate.property
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ estate.property.kanban
+ estate.property
+
+
+
+
+
+
+
+ Expected Price:
+
+
+ Best price:
+
+
+ Selling Price:
+
+
+
+
+
+
+
+
diff --git a/estate/views/res_users_views.xml b/estate/views/res_users_views.xml
new file mode 100644
index 00000000000..d838876f631
--- /dev/null
+++ b/estate/views/res_users_views.xml
@@ -0,0 +1,15 @@
+
+
+
+ res.users.view.form.inherit.estate
+ res.users
+
+
+
+
+
+
+
+
+
+
diff --git a/estate_account/__init__.py b/estate_account/__init__.py
new file mode 100644
index 00000000000..0650744f6bc
--- /dev/null
+++ b/estate_account/__init__.py
@@ -0,0 +1 @@
+from . import models
diff --git a/estate_account/__manifest__.py b/estate_account/__manifest__.py
new file mode 100644
index 00000000000..5da281c9e26
--- /dev/null
+++ b/estate_account/__manifest__.py
@@ -0,0 +1,14 @@
+{
+ 'name': 'Estate',
+ 'author': 'Sébastien Laurent',
+ "license": 'LGPL-3',
+ 'depends': [
+ 'base',
+ 'estate',
+ 'account',
+ ],
+ 'application': True,
+ 'data': [
+
+ ],
+}
diff --git a/estate_account/models/__init__.py b/estate_account/models/__init__.py
new file mode 100644
index 00000000000..18f646d0a62
--- /dev/null
+++ b/estate_account/models/__init__.py
@@ -0,0 +1,3 @@
+from . import (
+ estate_property,
+)
diff --git a/estate_account/models/estate_property.py b/estate_account/models/estate_property.py
new file mode 100644
index 00000000000..72c35313a10
--- /dev/null
+++ b/estate_account/models/estate_property.py
@@ -0,0 +1,37 @@
+from odoo import Command, exceptions, fields, models
+
+
+class EstateProperty(models.Model):
+ _name = "estate.property"
+ _description = "Adding fields for the estate property model"
+ _inherit = ['estate.property']
+
+ def sold_button(self):
+ for record in self:
+ if not record.buyer_id:
+ error_message = "The estate need a buyer to be sold!"
+ raise exceptions.UserError(error_message)
+
+ self.env['account.move'].create({
+ 'invoice_date': fields.Date.context_today(self),
+ 'move_type': 'out_invoice',
+ 'partner_id': record.buyer_id.id,
+ 'invoice_line_ids': [
+ Command.create({
+ 'name': record.name,
+ 'quantity': 1.0,
+ 'price_unit': record.selling_price,
+ }),
+ Command.create({
+ 'name': "I want more money from you",
+ 'quantity': 1.0,
+ 'price_unit': record.selling_price * 0.06,
+ }),
+ Command.create({
+ 'name': "Administrative fees",
+ 'quantity': 1.0,
+ 'price_unit': 100,
+ }),
+ ]})
+
+ return super().sold_button()
diff --git a/website_airproof/__manifest__.py b/website_airproof/__manifest__.py
index 2c2c62d6a18..aa1f26cab19 100644
--- a/website_airproof/__manifest__.py
+++ b/website_airproof/__manifest__.py
@@ -53,7 +53,7 @@
},
'new_page_templates': {
'airproof': {
- 'services': ['s_parallax', 's_airproof_key_benefits_h2', 's_call_to_action', 's_airproof_carousel']
- }
+ 'services': ['s_parallax', 's_airproof_key_benefits_h2', 's_call_to_action', 's_airproof_carousel'],
+ },
},
}