Skip to content
Health
90/100
good
  • Security25/25
    No findings
  • Activity25/25
    Human commit this month
  • Required by15/25
    1 module depends on it
  • Maturity25/25
    In 9 Odoo series since 11.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
1
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.18 MB
Module directory on disk
Code analysis 1 migration note 5 models 4 views 0 HTTP endpoints

Description

Apply global discounts to invoices

Dependencies

Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
sale_global_discount

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

Views touched 4

XML IDNameModelTypeStatus
global_discount_view_form global.discount form Inherits base_global_discount.global_discount_view_form
global_discount_view_tree global.discount tree Inherits base_global_discount.global_discount_view_tree
report_invoice_document report_invoice_document ir.ui.view qweb Inherits account.report_invoice_document
view_move_form account.move form Inherits account.view_move_form

HTTP endpoints 0

No HTTP endpoints found for this module.

Models touched 5

New fields (13)
  • account_analytic_id Many2one → account.analytic.account
    comodel_name='account.analytic.account' string='Analytic account'
  • account_id Many2one → account.account
    comodel_name='account.account' domain="[('account_type', 'not in', ['asset_receivable', 'liability_payable'])]" required=True
  • base Float
    digits='Product Price' string='Base before discount'
  • base_discounted Float
    digits='Product Price' string='Base after discount'
  • company_id Many2one
    readonly=True related='invoice_id.company_id'
  • currency_id Many2one
    readonly=True related='invoice_id.currency_id'
  • discount Float
    string='Discount (number)'
  • discount_amount Monetary
    compute='_compute_discount_amount' compute_sudo=True currency_field='currency_id' string='Discounted Amount'
  • discount_display Char
    compute='_compute_discount_display' string='Discount'
  • global_discount_id Many2one → global.discount
    comodel_name='global.discount'
  • invoice_id Many2one → account.move
    domain=[('move_type', 'in', ['out_invoice', 'out_refund', 'in_invoice', 'in_refund'])] index=True ondelete='cascade' readonly=True args: 'account.move'
  • name Char
    required=True string='Discount Name'
  • tax_ids Many2many → account.tax
    comodel_name='account.tax' string='Taxes'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (5)
  • amount_global_discount Monetary
    compute='_compute_amount' compute_sudo=True currency_field='currency_id' readonly=True store=True string='Total Global Discounts'
  • amount_untaxed_before_global_discounts Monetary
    compute='_compute_amount' compute_sudo=True currency_field='currency_id' readonly=True store=True string='Amount Untaxed Before Discounts'
  • global_discount_ids Many2many → global.discount
    column1='invoice_id' column2='global_discount_id' comodel_name='global.discount' compute='_compute_global_discount_ids' domain="[('discount_scope', 'in', { 'out_invoice': ['sale'], 'out_refund': ['sale'], 'in_refund': ['purchase'], 'in_invoice': ['purchase']}.get(move_type, [])), ('account_id', '!=', False), '|', ('company_id', '=', company_id), ('company_id', '=', False)]" readonly=False store=True string='Invoice Global Discounts'
  • global_discount_ids_readonly Many2many
    readonly=True related='global_discount_ids' string='Invoice Global Discounts (readonly)'
  • invoice_global_discount_ids One2many → account.invoice.global.discount
    comodel_name='account.invoice.global.discount' inverse_name='invoice_id' readonly=True
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
    If we create the invoice with the discounts already set like from a sales order, we must compute the global discounts as well, as some data like ``tax_ids`` is not set until the final step.
  • write(self, vals)

New fields (2)
  • base_before_global_discounts Monetary
    readonly=True string='Amount Untaxed Before Discounts'
  • invoice_global_discount_id Many2one → account.invoice.global.discount
    comodel_name='account.invoice.global.discount'
Public methods (0)

No public methods.

New fields (2)
  • account_analytic_id Many2one → account.analytic.account
    check_company=True comodel_name='account.analytic.account' string='Analytic account'
  • account_id Many2one → account.account
    check_company=True comodel_name='account.account' domain="[('account_type', 'not in', ['asset_receivable', 'liability_payable'])]"
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…