2
0

[IMP] account_spread_cost_revenue: black, isort, prettier

This commit is contained in:
Kitti U 2021-10-01 14:37:13 +07:00 committed by Andrea Stirpe
parent 22e57f872e
commit 01a2998bf2
5 changed files with 45 additions and 18 deletions

View File

@ -9,7 +9,7 @@
"author": "Onestein,Odoo Community Association (OCA)",
"maintainers": ["astirpe"],
"license": "AGPL-3",
"website": "https://github.com/OCA/account-financial-tools/",
"website": "https://github.com/OCA/account-financial-tools",
"category": "Accounting & Finance",
"depends": ["account"],
"data": [

View File

@ -63,10 +63,22 @@ class AccountSpread(models.Model):
compute="_compute_deprecated_accounts"
)
is_debit_account_deprecated = fields.Boolean(compute="_compute_deprecated_accounts")
unspread_amount = fields.Float(digits="Account", compute="_compute_amounts",)
unposted_amount = fields.Float(digits="Account", compute="_compute_amounts",)
posted_amount = fields.Float(digits="Account", compute="_compute_amounts",)
total_amount = fields.Float(digits="Account", compute="_compute_amounts",)
unspread_amount = fields.Float(
digits="Account",
compute="_compute_amounts",
)
unposted_amount = fields.Float(
digits="Account",
compute="_compute_amounts",
)
posted_amount = fields.Float(
digits="Account",
compute="_compute_amounts",
)
total_amount = fields.Float(
digits="Account",
compute="_compute_amounts",
)
all_posted = fields.Boolean(compute="_compute_all_posted", store=True)
line_ids = fields.One2many(
"account.spread.line", "spread_id", string="Spread Lines"
@ -92,7 +104,9 @@ class AccountSpread(models.Model):
store=True,
)
invoice_id = fields.Many2one(
related="invoice_line_id.move_id", readonly=True, store=True,
related="invoice_line_id.move_id",
readonly=True,
store=True,
)
estimated_amount = fields.Float(digits="Account")
company_id = fields.Many2one(

View File

@ -178,10 +178,23 @@ class AccountSpreadTemplateAuto(models.Model):
ondelete="cascade",
index=True,
)
company_id = fields.Many2one(related="template_id.company_id", store=True,)
name = fields.Char(required=True, default="/",)
product_id = fields.Many2one(comodel_name="product.product", string="Product",)
account_id = fields.Many2one(comodel_name="account.account", string="Account",)
analytic_account_id = fields.Many2one(
comodel_name="account.analytic.account", string="Analytic",
company_id = fields.Many2one(
related="template_id.company_id",
store=True,
)
name = fields.Char(
required=True,
default="/",
)
product_id = fields.Many2one(
comodel_name="product.product",
string="Product",
)
account_id = fields.Many2one(
comodel_name="account.account",
string="Account",
)
analytic_account_id = fields.Many2one(
comodel_name="account.analytic.account",
string="Analytic",
)

View File

@ -46,7 +46,8 @@ class AccountSpreadInvoiceLineLinkWizard(models.TransientModel):
store=True,
)
spread_invoice_type_domain_ids = fields.One2many(
"account.spread", compute="_compute_spread_invoice_type_domain",
"account.spread",
compute="_compute_spread_invoice_type_domain",
)
spread_id = fields.Many2one(
"account.spread",
@ -115,7 +116,6 @@ class AccountSpreadInvoiceLineLinkWizard(models.TransientModel):
def _inverse_spread_journal_account(self):
"""Keep this for making the fields editable"""
pass
@api.depends("company_id", "invoice_type")
def _compute_spread_invoice_type_domain(self):