|
| 1 | +# Account Invoice Move Currency |
| 2 | + |
| 3 | +This module extends Odoo's accounting functionality to enable dual-currency tracking on invoices. It allows storing invoice values in a secondary currency alongside the primary invoice currency, providing better visibility for businesses operating in multi-currency environments. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Secondary Currency Tracking**: Add a secondary currency to invoices to track values in an additional currency |
| 8 | +- **Custom Exchange Rates**: Define specific exchange rates for the secondary currency independently from the primary currency |
| 9 | +- **Real-time Rate Calculation**: Automatically calculate exchange rates based on company currency and selected secondary currency |
| 10 | +- **Currency Change Integration**: Optionally save the original currency as secondary when changing invoice currency |
| 11 | +- **Multi-currency Validation**: Prevent conflicts between primary and secondary currencies with built-in validation rules |
| 12 | +- **Reporting Support**: Display secondary currency values on invoice reports |
| 13 | + |
| 14 | +## Configuration |
| 15 | + |
| 16 | +### Prerequisites |
| 17 | + |
| 18 | +- Ensure currency rates are configured under Accounting > Configuration > Currencies |
| 19 | + |
| 20 | +### Installation |
| 21 | + |
| 22 | +1. Install the module from the Apps menu |
| 23 | +2. The module will automatically extend invoice forms with secondary currency fields |
| 24 | + |
| 25 | +## Usage |
| 26 | + |
| 27 | +### Adding a Secondary Currency to an Invoice |
| 28 | + |
| 29 | +1. Navigate to Accounting > Customers > Invoices (or Vendors > Bills) |
| 30 | +2. Open a draft invoice |
| 31 | +3. In the invoice form, locate the **Secondary Currency** field (visible only with multi-currency enabled) |
| 32 | +4. Select a secondary currency from the dropdown |
| 33 | +5. The **Account Move Secondary Currency Rate** will be automatically calculated |
| 34 | +6. You can manually adjust the rate if needed |
| 35 | +7. Save the invoice |
| 36 | + |
| 37 | +### Important Constraints |
| 38 | + |
| 39 | +- **Same Currency Restriction**: The secondary currency cannot be the same as the invoice currency |
| 40 | +- **Company Currency Requirement**: Secondary currency can only be used when the invoice currency matches the company currency |
| 41 | +- If these conditions are not met, the system will display a validation error |
| 42 | + |
| 43 | +### Changing Invoice Currency |
| 44 | + |
| 45 | +When using the "Change Currency" wizard: |
| 46 | + |
| 47 | +1. Open a draft invoice |
| 48 | +2. Use the currency change wizard (available from `account_ux` module) |
| 49 | +3. Select the new currency |
| 50 | +4. Check the **Save in secondary currency?** option if you want to preserve the original currency as the secondary currency |
| 51 | +5. When changing to the company currency, this option allows tracking the original currency values |
| 52 | +6. Confirm the change |
| 53 | + |
| 54 | +### Example Use Case |
| 55 | + |
| 56 | +**Scenario**: A company operates in USD but wants to track invoice values in EUR for reporting purposes. |
| 57 | + |
| 58 | +1. Create an invoice with currency = USD (company currency) |
| 59 | +2. Set Secondary Currency = EUR |
| 60 | +3. The system calculates the EUR rate automatically (or enter manually) |
| 61 | +4. The invoice values are now tracked in both USD (primary) and EUR (secondary) |
| 62 | +5. The secondary currency information is available for reporting and analysis |
| 63 | + |
| 64 | +## Technical Details |
| 65 | + |
| 66 | +### Dependencies |
| 67 | + |
| 68 | +- `account_ux`: Provides extended accounting functionality and the currency change wizard |
| 69 | + |
| 70 | +### Models Extended |
| 71 | + |
| 72 | +#### account.move |
| 73 | + |
| 74 | +**New Fields:** |
| 75 | +- `move_currency_id`: Many2one field to store the secondary currency |
| 76 | +- `move_inverse_currency_rate`: Float field (16,4 digits) to store the exchange rate |
| 77 | + |
| 78 | +**Methods:** |
| 79 | +- `change_move_currency()`: Onchange method that calculates the exchange rate when secondary currency is selected |
| 80 | +- `check_move_currency()`: Constraint method that validates currency selection rules |
| 81 | + |
| 82 | +#### account.change.currency (TransientModel) |
| 83 | + |
| 84 | +**New Fields:** |
| 85 | +- `save_secondary_currency`: Boolean field to enable saving original currency as secondary |
| 86 | +- `same_currency`: Computed field to determine if target currency matches company currency |
| 87 | +- `currency_company_id`: Related field for company currency |
| 88 | + |
| 89 | +**Methods:** |
| 90 | +- `_compute_same_currency()`: Computes whether the target currency is the company currency |
| 91 | +- `change_currency()`: Extended to handle secondary currency preservation logic |
| 92 | + |
| 93 | +### Views |
| 94 | + |
| 95 | +- **Invoice Form View**: Adds secondary currency fields to the invoice header (visible only for invoices/bills in multi-currency setups) |
| 96 | +- **Change Currency Wizard**: Adds checkbox to save original currency as secondary |
| 97 | +- **Invoice Report**: Shows secondary currency information on printed invoices |
| 98 | + |
| 99 | +### Security |
| 100 | + |
| 101 | +No additional security groups or access rights are required beyond standard Odoo accounting permissions. |
| 102 | + |
| 103 | +## Known Issues / Limitations |
| 104 | + |
| 105 | +- Secondary currency is only available when the invoice currency is the same as the company currency |
| 106 | +- The secondary currency and invoice currency cannot be the same |
| 107 | +- Exchange rate modifications are only allowed in draft state |
| 108 | + |
| 109 | +## Bug Tracker |
| 110 | + |
| 111 | +Bugs are tracked on [GitHub Issues](https://github.com/ingadhoc/account-invoicing/issues). In case of trouble, please check there if your issue has already been reported. |
| 112 | + |
| 113 | +## Credits |
| 114 | + |
| 115 | +### Authors |
| 116 | + |
| 117 | +* ADHOC SA |
| 118 | + |
| 119 | +### Contributors |
| 120 | + |
| 121 | +* ADHOC SA <info@adhoc.com.ar> |
| 122 | + |
| 123 | +### Maintainers |
| 124 | + |
| 125 | +This module is maintained by ADHOC SA. |
| 126 | + |
| 127 | +To learn more about ADHOC SA, visit [www.adhoc.com.ar](http://www.adhoc.com.ar). |
| 128 | + |
| 129 | +## License |
| 130 | + |
| 131 | +This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. |
| 132 | + |
| 133 | +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. |
| 134 | + |
| 135 | +You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. |
0 commit comments