Black on account_fiscal_position_payable_receivable
This commit is contained in:
@@ -2,12 +2,12 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Account Fiscal Position Payable Receivable',
|
"name": "Account Fiscal Position Payable Receivable",
|
||||||
'version': '12.0.1.0.0',
|
"version": "12.0.1.0.0",
|
||||||
'category': 'Accounting & Finance',
|
"category": "Accounting & Finance",
|
||||||
'license': 'AGPL-3',
|
"license": "AGPL-3",
|
||||||
'summary': 'Configure payable/receivable accounts on fiscal positions',
|
"summary": "Configure payable/receivable accounts on fiscal positions",
|
||||||
'description': """
|
"description": """
|
||||||
Account Fiscal Position Payable Receivable
|
Account Fiscal Position Payable Receivable
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
@@ -15,11 +15,9 @@ This module allows to configure a special *Partner Receivable Account* and a spe
|
|||||||
|
|
||||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||||
""",
|
""",
|
||||||
'author': "Akretion",
|
"author": "Akretion",
|
||||||
'website': 'http://www.akretion.com',
|
"website": "http://www.akretion.com",
|
||||||
'depends': ['account'],
|
"depends": ["account"],
|
||||||
'data': [
|
"data": ["views/account_fiscal_position_view.xml"],
|
||||||
'views/account_fiscal_position_view.xml',
|
"installable": True,
|
||||||
],
|
|
||||||
'installable': True,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,17 @@ from odoo import models, fields
|
|||||||
|
|
||||||
|
|
||||||
class AccountFiscalPosition(models.Model):
|
class AccountFiscalPosition(models.Model):
|
||||||
_inherit = 'account.fiscal.position'
|
_inherit = "account.fiscal.position"
|
||||||
|
|
||||||
receivable_account_id = fields.Many2one(
|
receivable_account_id = fields.Many2one(
|
||||||
'account.account', string='Partner Receivable Account',
|
"account.account",
|
||||||
company_dependent=True, domain=[('internal_type', '=', 'receivable')])
|
string="Partner Receivable Account",
|
||||||
|
company_dependent=True,
|
||||||
|
domain=[("internal_type", "=", "receivable")],
|
||||||
|
)
|
||||||
payable_account_id = fields.Many2one(
|
payable_account_id = fields.Many2one(
|
||||||
'account.account', string='Partner Payable Account',
|
"account.account",
|
||||||
company_dependent=True, domain=[('internal_type', '=', 'payable')])
|
string="Partner Payable Account",
|
||||||
|
company_dependent=True,
|
||||||
|
domain=[("internal_type", "=", "payable")],
|
||||||
|
)
|
||||||
|
|||||||
@@ -5,19 +5,21 @@ from odoo import models, api
|
|||||||
|
|
||||||
|
|
||||||
class ResPartner(models.Model):
|
class ResPartner(models.Model):
|
||||||
_inherit = 'res.partner'
|
_inherit = "res.partner"
|
||||||
|
|
||||||
@api.onchange('property_account_position_id')
|
@api.onchange("property_account_position_id")
|
||||||
def fiscal_position_receivable_payable_change(self):
|
def fiscal_position_receivable_payable_change(self):
|
||||||
fp = self.property_account_position_id
|
fp = self.property_account_position_id
|
||||||
ipo = self.env['ir.property']
|
ipo = self.env["ir.property"]
|
||||||
if fp.receivable_account_id:
|
if fp.receivable_account_id:
|
||||||
self.property_account_receivable_id = fp.receivable_account_id
|
self.property_account_receivable_id = fp.receivable_account_id
|
||||||
else:
|
else:
|
||||||
self.property_account_receivable_id = ipo.get(
|
self.property_account_receivable_id = ipo.get(
|
||||||
'property_account_receivable_id', 'res.partner')
|
"property_account_receivable_id", "res.partner"
|
||||||
|
)
|
||||||
if fp.payable_account_id:
|
if fp.payable_account_id:
|
||||||
self.property_account_payable_id = fp.payable_account_id
|
self.property_account_payable_id = fp.payable_account_id
|
||||||
else:
|
else:
|
||||||
self.property_account_payable_id = ipo.get(
|
self.property_account_payable_id = ipo.get(
|
||||||
'property_account_payable_id', 'res.partner')
|
"property_account_payable_id", "res.partner"
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user