OCA / mis-builder-contrib

Modules that provide additional features on top of MIS Builder. A kind of incubator for MIS Builder features that may land in the core in the future.
GNU Affero General Public License v3.0
8 stars 43 forks source link

[13.0][MIG] mis_builder_analytic #15

Closed Kiplangatdan closed 11 months ago

hitrosol commented 3 years ago

I guess this module will make easier for creating the Analytical Report as per in EE version. Any further update about this module ? I wonder if this feature would also part of the core of MIS-Builder.... Thanks...

hbrunn commented 3 years ago

what's your rationale for not just adding a credit and debit column to analytic lines? That's the only thing we need to make the analytic line model compatible with mis_builder, as it already has an account_id field. For a customer I did it quick and dirty with

from odoo import api, fields, models

class AccountAnalyticLine(models.Model):
    _inherit = "account.analytic.line"

    credit = fields.Monetary(compute="_compute_credit_debit", store=True)
    debit = fields.Monetary(compute="_compute_credit_debit", store=True)

    @api.depends("amount")
    def _compute_credit_debit(self):
        for this in self:
            this.update(
                {
                    "credit": this.amount <= 0 and -this.amount or 0,
                    "debit": this.amount >= 0 and this.amount or 0,
                }
            )
github-actions[bot] commented 1 year ago

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.