-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0][IMP] add ability to set intrastat only for in_ or out_ invoice…
…s in l10n_it_intrastat
- Loading branch information
1 parent
55e4c1c
commit 53b8fd7
Showing
5 changed files
with
69 additions
and
12 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,33 @@ | ||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
for table, column in [ | ||
("account_fiscal_position", "intrastat_sale"), | ||
("account_fiscal_position", "intrastat_purchase"), | ||
]: | ||
if not openupgrade.column_exists(env.cr, table, column): | ||
openupgrade.add_fields( | ||
env, | ||
[ | ||
( | ||
column, | ||
".".join(table.split("_")), | ||
False, | ||
"boolean", | ||
False, | ||
"l10n_it_intrastat", | ||
) | ||
], | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE account_fiscal_position | ||
SET | ||
intrastat_sale = intrastat, | ||
intrastat_purchase = intrastat | ||
WHERE intrastat is true; | ||
""", | ||
) |
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
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