[FIX] base_action_rule: define patched methods inside a function to fix their closure.
[FIX] account: _get_analytic_lines needs the date_invoice

During the conversion of account_invoice.py to the new API, the date_invoice written on the invoice has been moved in the end of the action_move_create method.

But, the method _get_analytic_lines needs it sooner.