Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I need to edit the function action_move_create because I had edit the field amount_total
I need that debit in account_move_line to be equal to the new amount_total
I had tried this but I'm getting an error.
def action_move_create(self, cr, uid, ids, context=None):
res = super(snc_invoice, self).action_move_create(cr, uid, ids, context=context)
account_move = self.pool.get('account.move')
for inv in self.browse(cr, uid, ids, context=context):
if inv.type == 'out_invoice':
sql = "update account_move_line set debit="+str(inv.amount_total) +",credit="+str(inv.amount_total) + " where move_id = " + str(inv.move_id.id)
the error that I'm getting :"
ValueError: "ERREUR: la nouvelle ligne viole la contrainte de v\xe9rification \xab account_move_line \xbb de la relation \xab account_move_line_credit_debit1 \xbb
DETAIL: La ligne en \xe9chec contient (104, 2016-04-22 11:30:12.059, null, 1, null, 2016-04-22, 8, null, f, null, 1, 1518.5, normal, 1, null, null, valid, 1518.5, null, 8, 5, 2016-04-22 11:30:12.059, 2016-04-22, 2016-04-22, 1, 32, /, null, 0.00, null, null, null, 0.00, 1.00)
" while evaluating
-> res = self._obj.execute(query, params)
Any help please
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/22/16, 7:30 AM|
|Seen: 459 times|
|Last updated: 4/25/16, 3:33 AM|