forked from ingadhoc/account-financial-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] account_check: some improvment to checks (ingadhoc#151)
Add a constrians to set amount_company_currency or amount if some of them are not setting
- Loading branch information
1 parent
b53d60a
commit 28ef2fd
Showing
4 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from openupgradelib import openupgrade | ||
import logging | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
|
||
_logger.info('Setting inital values for amount_company_currency') | ||
env.cr.execute(""" | ||
UPDATE account_check AS ac SET amount_company_currency = ac.amount | ||
FROM res_company AS rc | ||
WHERE rc.id = ac.company_id and ac.currency_id = rc.currency_id | ||
and ac.amount_company_currency = 0.0 | ||
""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters