Skip to content

Commit

Permalink
Merge PR #190 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Dec 22, 2023
2 parents f798bbc + 7c9e8eb commit 440b9f6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
1 change: 1 addition & 0 deletions sale_margin_security/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import models
from . import report
1 change: 1 addition & 0 deletions sale_margin_security/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
25 changes: 25 additions & 0 deletions sale_margin_security/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2023 Carlos Dauden - Tecnativa
# Copyright 2023 Sergio Teruel - Tecnativa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models


class SaleOrder(models.Model):
_inherit = "sale.order"

margin = fields.Monetary(groups="sale_margin_security.group_sale_margin_security")
margin_percent = fields.Float(
groups="sale_margin_security.group_sale_margin_security"
)


class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

margin = fields.Float(groups="sale_margin_security.group_sale_margin_security")
margin_percent = fields.Float(
groups="sale_margin_security.group_sale_margin_security"
)
purchase_price = fields.Float(
groups="sale_margin_security.group_sale_margin_security"
)
7 changes: 4 additions & 3 deletions sale_margin_security/report/sale_report.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2023 Carlos Dauden - Tecnativa
# Copyright 2023 Sergio Teruel - Tecnativa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models


class SaleReport(models.Model):
_inherit = "sale.report"

margin = fields.Float(
groups="sale_margin_security.group_sale_margin_security",
)
margin = fields.Float(groups="sale_margin_security.group_sale_margin_security")

0 comments on commit 440b9f6

Please sign in to comment.