forked from OCA/server-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.
[12.0][MIG] - onchange_helper migration to 12.0
- Loading branch information
1 parent
515944a
commit ea30f4c
Showing
4 changed files
with
17 additions
and
1 deletion.
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,3 @@ | ||
* Guewen Baconnier <[email protected]> | ||
* Florian da Costa <[email protected]> | ||
* Andrea Stirpe <[email protected]> |
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 @@ | ||
This is a technical module. Its goal is to ease the play of onchange method directly called from Python code. |
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,12 @@ | ||
To use this module, you need to: | ||
|
||
* depend on this module | ||
* call `yourmodel.play_onchanges(values, ['field'])` | ||
|
||
Example if you want to create a sale order and you want to get the values relative to partner_id field (as if you fill the field from UI) | ||
|
||
`vals = {'partner_id': 1}` | ||
|
||
`vals = self.env['sale.order'].play_onchanges(vals, ['partner_id'])` | ||
|
||
Then, `vals` will be updated with partner_invoice_id, partner_shipping_id, pricelist_id, etc... |