Its common to import a file contaning all the moves of a statement, especially if this statement is a bank or a online system one. When introduced to tryton, each of this move will be mapped to one or more statement lines.
Create a new ‘account.statement.origin’ Model which will be filled by the process of importing this file. This model will have the following fields:
- Name: Required Char
- Date: Required Date
- Amount: Required Numeric
- Description: Optional Text
- Party: Optional Many2One
- Account: Optional Many2One
On the statement lines a new Many2One field referencing the origin will be added. This filed should be invisible when not set and if set the account will not be required on draft state.
When changing the lines amount, if the record is related to an origin, a new line will be created to match the origin amount, similar in what is done now with the invoice field.
A new wizard for importing the files will be added. This wizard will ask for the file format and file to be imported. It will create draft statements filled with origins.