Python错误缩进

时间:2016-07-29 08:44:59

标签: python-2.7 openerp

我有缩进错误但我不知道如何解决它,我试图unindent和缩进但它不工作请帮助我这是我的代码python:

class account_invoice(osv.osv):
    _name = "account.invoice"
    _inherit = "account.invoice"
    _columns = {

       'methodedepaiement': fields.selection([
            ('cheque','Chèque'),
            ('virement','Virement'),
            ('espece','Espèce'),
            ('carteb','Carte bancaire'),
            ('prelev','Prélèvement'),], string='Méthode de paiement'),

    }

    @api.multi
    def amount_to_text_fr(self, amount, currency='Dirhams'):
        return amount_to_text_fr(amount,currency)

    @api.depends('control_amount_total')
    def _compute_control_amount_total_text(self):
        for record in self:
            if record.control_amount_total :
                amount = record.control_amount_total
                list = str(amount).split('.')
                start_word = amount_to_text_fr(abs(int(list[0])),  'Dirhams').split('Dirhams')[0]
                end_word = amount_to_text_fr(int(list[1]),  'Centimes').split('Centimes')[0]
                record.control_amount_total_text = start_word + ' Dirhams et ' + end_word + ' Centimes'
                #self.control_amount_total_text = amount_to_text(self.control_amount_total,'fr','Dirhams')

我的功能有问题

1 个答案:

答案 0 :(得分:0)

您可以使用Spyder IDE

来源菜单 - >修复缩进 enter image description here