This file contains hidden or 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
| if "internal_hold" in vals and vals["internal_hold"]: | |
| vals["state"] = "internally_held" | |
| else | |
| vals["state"] = "draft" |
This file contains hidden or 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
| vals['state'] = 'internally_held' if 'internal_hold' in vals and vals['internal_hold'] else 'draft' |
This file contains hidden or 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
| if "internal_hold" in vals and vals["internal_hold"]: | |
| vals["state"] = "internally_held" | |
| elif "internal_hold" in vals and not vals["internal_hold"]: | |
| vals["state"] = "draft" | |
| else: | |
| vals["state"] = "draft" |
This file contains hidden or 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
| if "acc_no" in vals and vals["acc_no"]: | |
| if "branch_code" in vals: | |
| cheques = self.search( | |
| [ | |
| ("reference", "=", vals["reference"]), | |
| ("acc_no", "=", vals["acc_no"]), | |
| ("branch_code", "=", vals["branch_code"]), | |
| ("state", "!=", "cancelled"), | |
| ] | |
| ) |
This file contains hidden or 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
| cheques = self.search( | |
| [ | |
| ("reference", "=", vals["reference"]), | |
| ("acc_no", "=", vals["acc_no"]), | |
| ("state", "!=", "cancelled"), | |
| ] | |
| ) | |
| if cheques: | |
| raise ValidationError( |
This file contains hidden or 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
| cheque_exists_domain_filter = [("reference", "=", vals["reference"]), ("state", "!=", "cancelled")] | |
| if "acc_no" in vals and vals["acc_no"]: | |
| cheque_exists_domain_filter += [("acc_no", "=", vals["acc_no"])] | |
| if "branch_code" in vals: | |
| cheque_exists_domain_filter += [("branch_code", "=", vals["branch_code"])] | |
| cheques = self.search(cheque_exists_domain_filter) | |
This file contains hidden or 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
| SELECT ie.name "invoice_number", | |
| pj.name "payment_journal", | |
| apr.amount "reconciliation_amount" | |
| FROM account_move_line iel --- invoice entry line | |
| INNER JOIN account_move ie --- invoice entry | |
| ON iel.move_id = ie.id | |
| INNER JOIN account_partial_reconcile apr | |
| ON apr.debit_move_id = iel.id | |
| INNER JOIN account_move_line pel --- payment entry line | |
| ON apr.credit_move_id = pel.id |
This file contains hidden or 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
| SELECT ie.name "invoice_number", | |
| pj.name "payment_journal", | |
| apr.amount "reconciliation_amount" | |
| FROM account_move_line iel, --- invoice entry line | |
| account_move ie, --- invoice entry | |
| account_partial_reconcile apr, --- partial payment | |
| account_move_line pel, --- payment entry line | |
| account_move pe, --- payment entry | |
| account_journal pj --- journal | |
| WHERE |
This file contains hidden or 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
| id | name | gender | age | |
|---|---|---|---|---|
| 1 | Donetta Brody | Female | 24 | |
| 2 | Otis Revell | Male | 52 | |
| 3 | Kecia Bollman | Female | 43 | |
| 4 | Retha Cottingham | Female | 24 | |
| 5 | Jerrold Villeda | Male | 32 | |
| 6 | Tawanda Sandridge | Female | 22 | |
| 7 | Ila Shingleton | Male | 24 | |
| 8 | Jean Gruner | Female | 60 | |
| 9 | Leonard Devino | Male | 55 |
This file contains hidden or 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
| id | phone_number | street_address | person_id | |
|---|---|---|---|---|
| 1 | (770) 936-5965 | 60 East Hickory Drive Mokena, IL 60448 | 1 | |
| 2 | (202) 911-3723 | 130 East Randall Mill St. Hoffman Estates, IL 60169 | 2 | |
| 3 | (309) 589-5589 | 76 Fulton Ave. Wantagh, NY 11793 | NULL | |
| 4 | (299) 505-4199 | 5 S. Lake View Street Windsor, CT 06095 | 4 | |
| 5 | (572) 968-5020 | 464 Pilgrim Drive Menomonee Falls, WI 53051 | NULL | |
| 6 | (488) 466-4899 | 999 Winding Way Avenue Newport News, VA 23601 | 6 | |
| 7 | (391) 304-8813 | 501 Sheffield Street Milledgeville, GA 31061 | 7 | |
| 8 | (422) 972-4219 | 38 Euclid Street Bergenfield, NJ 07621 | NULL | |
| 9 | (542) 582-8379 | 62 S. Brown St. Auburn, NY 13021 | NULL |