classAccountMove(models.Model):_inherit="account.move"_description="Vendor Invoices"
allow_bill=fields.Boolean (string='Allow Overdue Bills')original_copy_received=fields.Boolean(string='Original Copy Received')sob_id=fields.Many2many('sob', string="SOB Numbers", store=True)
defaction_post(self):result=super(AccountMove,self).action_post()print("=================>>")ifnotself.original_copy_received :print("ffffffffffffff")date_one=self.date +timedelta(days=7)today=datetime.today().date()print("Accounting Date", date_one)print("Today Date", today)iftoday>date_oneandnotself.allow_bill:print("++++++++++++++")raiseUserError("Bill Cannot send for approval")else:print("??????????????")result=super(AccountMove,self).action_post()# self.write({'state': 'posted'})# result = super(AccountMove,self).action_post()
elifself.allow_bill:print('qqqqqqqqqqqqqqqqqqq')result=super(AccountMove,self).action_post()# self.write({'state':'posted'})returnresult
Denna fråga har flaggats
3582
Vyer
Njuter du av diskussionen? Läs inte bara, delta också!
Skapa ett konto idag för att ta del av exklusiva funktioner och engagera dig i vår fantastiska community!
Registrera dig| Relaterade inlägg | Svar | Vyer | Verksamhet | |
|---|---|---|---|---|
|
|
0
feb. 24
|
2932 | ||
|
|
1
feb. 24
|
6127 | ||
|
|
0
feb. 24
|
3596 | ||
|
|
1
juni 23
|
4432 | ||
|
|
1
apr. 23
|
128 |
This is not a question