summaryrefslogtreecommitdiff
path: root/addons/account/partner.py
diff options
context:
space:
mode:
authorMahendra barad <mba@openerp.com>2015-05-14 15:31:34 +0530
committerJosse Colpaert <jco@odoo.com>2015-06-23 14:00:43 +0200
commit75d7bbb46e100b7ffda091a11183d4ed14d3bbed (patch)
tree107ccd62ba2aef250d3110dd9070996ec4ecf668 /addons/account/partner.py
parentbfbc22cdc20c88889661bb68d6321ec61fda4d0b (diff)
[REF]Account: Refactoring the account, Change some fields name according to new api guidelines
code improvement code improvement payment_method to payment_method_id writeoff_account to writeoff_account_id property_account_receivable to property_account_receivable_id property_account_payable to property_account_payable_id property_account_expense_categ to property_account_expense_categ_id property_account_income_categ to property_account_income_categ_id property_account_expense to property_account_expense_id property_account_income to property_account_income_id property_account_expense_categ fix sale_tax to sale_tax_id and default_sale_tax to default_sale_tax_id purchase_tax to purchase_tax_id and default_purchase_tax to default_purchase_tax_id ref_companies to ref_companies_ids property_account_position to property_account_position_id property_payment_term to property_payment_term_id property_supplier_payment_term to property_supplier_payment_term_id bank_accounts_id to bank_accounts_ids payment_method fix after rebase user_type after rebase payment_method fix after rebase after rebase invoice to invoice_id fix payment_method_id after rebase code improvement [IMP]user_type to user_type_id [IMP]property_stock_account_input_categ, property_stock_account_output_categ to _id [IMP]improve after rebase [IMP]fix type [IMP]Account: code improvement
Diffstat (limited to 'addons/account/partner.py')
-rw-r--r--addons/account/partner.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/addons/account/partner.py b/addons/account/partner.py
index 8dc46b9df49..85a17f07559 100644
--- a/addons/account/partner.py
+++ b/addons/account/partner.py
@@ -106,8 +106,8 @@ class AccountFiscalPosition(models.Model):
partner = PartnerObj.browse(partner_id)
# partner manually set fiscal position always win
- if partner.property_account_position:
- return partner.property_account_position.id
+ if partner.property_account_position_id:
+ return partner.property_account_position_id.id
# if no delivery use invocing
if delivery_id:
@@ -184,7 +184,7 @@ class ResPartner(models.Model):
self._cr.execute("""SELECT l.partner_id, act.type, SUM(l.debit-l.credit)
FROM account_move_line l
LEFT JOIN account_account a ON (l.account_id=a.id)
- LEFT JOIN account_account_type act ON (a.user_type=act.id)
+ LEFT JOIN account_account_type act ON (a.user_type_id=act.id)
WHERE act.type IN ('receivable','payable')
AND l.partner_id IN %s
AND l.reconciled IS FALSE
@@ -335,27 +335,27 @@ class ResPartner(models.Model):
contracts_count = fields.Integer(compute='_journal_item_count', string="Contracts", type='integer')
journal_item_count = fields.Integer(compute='_journal_item_count', string="Journal Items", type="integer")
issued_total = fields.Char(compute='_compute_issued_total', string="Journal Items")
- property_account_payable = fields.Many2one('account.account', company_dependent=True,
- string="Account Payable",
+ property_account_payable_id = fields.Many2one('account.account', company_dependent=True,
+ string="Account Payable", oldname="property_account_payable",
domain="[('internal_type', '=', 'payable'), ('deprecated', '=', False)]",
help="This account will be used instead of the default one as the payable account for the current partner",
required=True)
- property_account_receivable = fields.Many2one('account.account', company_dependent=True,
- string="Account Receivable",
+ property_account_receivable_id = fields.Many2one('account.account', company_dependent=True,
+ string="Account Receivable", oldname="property_account_receivable",
domain="[('internal_type', '=', 'receivable'), ('deprecated', '=', False)]",
help="This account will be used instead of the default one as the receivable account for the current partner",
required=True)
- property_account_position = fields.Many2one('account.fiscal.position', company_dependent=True,
+ property_account_position_id = fields.Many2one('account.fiscal.position', company_dependent=True,
string="Fiscal Position",
- help="The fiscal position will determine taxes and accounts used for the partner.")
- property_payment_term = fields.Many2one('account.payment.term', company_dependent=True,
+ help="The fiscal position will determine taxes and accounts used for the partner.", oldname="property_account_position")
+ property_payment_term_id = fields.Many2one('account.payment.term', company_dependent=True,
string ='Customer Payment Term',
- help="This payment term will be used instead of the default one for sale orders and customer invoices")
- property_supplier_payment_term = fields.Many2one('account.payment.term', company_dependent=True,
+ help="This payment term will be used instead of the default one for sale orders and customer invoices", oldname="property_payment_term")
+ property_supplier_payment_term_id = fields.Many2one('account.payment.term', company_dependent=True,
string ='Supplier Payment Term',
- help="This payment term will be used instead of the default one for purchase orders and supplier bills")
- ref_companies = fields.One2many('res.company', 'partner_id',
- string='Companies that refers to partner')
+ help="This payment term will be used instead of the default one for purchase orders and supplier bills", oldname="property_supplier_payment_term")
+ ref_company_ids = fields.One2many('res.company', 'partner_id',
+ string='Companies that refers to partner', oldname="ref_companies")
has_unreconciled_entries = fields.Boolean(compute='_compute_has_unreconciled_entries',
help="The partner has at least one unreconciled debit and credit since last time the invoices & payments matching was performed.")
last_time_entries_checked = fields.Datetime(oldname='last_reconciliation_date',
@@ -373,5 +373,5 @@ class ResPartner(models.Model):
@api.model
def _commercial_fields(self):
return super(ResPartner, self)._commercial_fields() + \
- ['debit_limit', 'property_account_payable', 'property_account_receivable', 'property_account_position',
- 'property_payment_term', 'property_supplier_payment_term', 'last_time_entries_checked']
+ ['debit_limit', 'property_account_payable_id', 'property_account_receivable_id', 'property_account_position_id',
+ 'property_payment_term_id', 'property_supplier_payment_term_id', 'last_time_entries_checked']