What I need is to automatically write some quantities to a specific journal, read'em and write them on debit or credit fields, depending on the situation.
But, the whole point is, that I need to do this:
1.- Without creating invoices
2.- Depending on the state of class/table
3.- Without adding the function to any field, so as soon as it changes state, the quantites are written into the journal.
Ive tried this method, but I think this doesn't works because it should be on a computed Float or Integer field:
@api.multi
@api.depends('order_picking', 'order_picking.isbn', 'contract_worksheet')
def accounting_scenarios(self):
for record in self:
if record.state == awaitingraw:
record.isbn.printer_wip_account.debit = record.contract_worksheet.total_alles
elif record.state == work_in_progress:
record.transporter.transp_transit.debit = record.contract_worksheet.total_alles
So, it basically does nothing.
I need a behaviour like, when a purchase or sale is done, the debit or credit fieds are updated with the invoices generated. BUT in this case, the invoice isn't necessary, I just need to read, and copy some field (computed or not), and then "paste" this on the aforementioned fields of the selected journal.
I hope I've explained myself.
Any ideas?
isbn,printer_wip_account,transporter,transp_transit,contract_worksheetandtotal_alles? - forvas