You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
820 B
19 lines
820 B
# -*- coding: utf-8 -*-
|
|
""" find the total amount in company currency """
|
|
|
|
from odoo import api, models, fields
|
|
|
|
class PurchaseCurrency(models.Model):
|
|
""" Creates the new field to store the total amount in company currency"""
|
|
_inherit = 'sale.order'
|
|
|
|
company_currency_amount = fields.Float(string='Company Currency Total',
|
|
compute='find_amount')
|
|
@api.model
|
|
def find_amount(self):
|
|
""" Function to calculate the total amount in company currency"""
|
|
for this in self:
|
|
price = self.env['res.currency']._compute(this.currency_id,
|
|
this.company_id.currency_id,
|
|
this.amount_total)
|
|
this.company_currency_amount = price
|
|
|