1. 06 Dec, 2017 3 commits
    • Jérome Perrin's avatar
      Merge !495 Fix bank reconciliation with internal transaction · 9f3fa956
      Jérome Perrin authored
      In internal transactions, we can have a payment line where source is using a bank account and destination is using another bank account.
      
      Bank Reconciliation did not support these lines properly, because it simply assumed that *"if there's a bank reconciliation on this line, it means the line is reconciled"*, but this was incorrect, because source and destination needs to be able to reconcile this line independently.
      
      The fixes is to change the rule from *"if there's a bank reconciliation on this line, it means the line is reconciled"* to *"if there's a bank reconciliation with the same bank account as this line's source payment, it means the line is reconciled for source"* and *"if there's a bank reconciliation with the same bank account as this line's destination payment, it means the line is reconciled for destination"*.
      
      The related  key used to select the already reconciled lines or lines to reconcile becomes a bit more complex, it joins with category table to ensure the bank reconciliation's bank account  (which is `source_payment` on the bank reconciliation) is the same as the `section_uid` of the line in stock table that we are considering. This also has a side effect that this related key only work with queries on stock table, but it was never intended to be used elsewhere.
      
      Another problem is that queries made by bank reconciliation module become a bit more slower. For sites where this is a problem, the recommended approach is to replace the related keys by columns on stock table. In cfec8d2b (which is part of this MR) we add indexation methods. In 5afb002090cd965bd17ffcf5c4c54ba73dfcbfc4 (which is not part of this MR and not planned for inclusion in "default" ERP5) we show an example of how to enable these methods to actually add the columns in stock table.
      
      /reviewed-on nexedi/erp5!495
      9f3fa956
    • Jérome Perrin's avatar
      Merge !506 Persist the language cookie when changing language · a1d47205
      Jérome Perrin authored
      The fact that ERP5 does not remember the selected language has been reported as a bug to us.
      
      Instead of using a session cookie, this change make the cookie persists. For one year. This is a bit arbitrary, I copied that behavior from the "remember my username" [cookie](https://lab.nexedi.com/nexedi/erp5/blob/557c20bdf0e/product/ERP5Type/patches/CookieCrumbler.py#L138) that we use to have on the login page.
      
      /reviewed-on nexedi/erp5!506
      a1d47205
    • Jérome Perrin's avatar
      Merge !492 Normalize notification message references · b16313d1
      Jérome Perrin authored
      We realized that the references of notification messages used in credential request management had a typo (`crendential` vs `credential`) and that the message used for a new credential request was not using the same `credential_request` prefix as others.
      
      This MR changes the messages as follow:
      
      | Wrong Reference | Correct Reference |
      | --- | --- |
      | erp5-subscription.notification | credential_request-subscription |
      | crendential_request-confirmation-without-password | credential_request-confirmation-without-password |
      | crendential_request-confirmation-with-password | credential_request-confirmation-with-password |
      | crendential_request-confirmation-without-password | credential_request-confirmation-without-password |
      | crendential_recovery-reset-link | credential_recover-reset-link |
      | crendential_recovery-username | credential_recovery-username |
      
      This is an incompatible change that can affect projects that have defined some custom notification messages without explicitly setting the references on the system preferences (ie. getting the default value from the property definition).
      I found one project using custom notification messages, but preference was defined.
      Other projects I checked did not override these notification messages.
      
      In our projects, we mostly use messages for credential requests, but the reference for the notification message is usually defined as a property of the web section.
      
      So I'm confident this should not affect projects and we can proceed with this clean up without causing too much troubles. To check if you need to adjust notification messages, check if you have customized notification message with reference *Wrong Reference*.
      
      /reviewed-on nexedi/erp5!492
      b16313d1
  2. 05 Dec, 2017 3 commits
  3. 04 Dec, 2017 2 commits
  4. 01 Dec, 2017 6 commits
  5. 30 Nov, 2017 15 commits
  6. 29 Nov, 2017 2 commits
  7. 28 Nov, 2017 1 commit
  8. 27 Nov, 2017 2 commits
  9. 24 Nov, 2017 6 commits