Refactor action_move_line_create on account_voucher

Registered by Nhomar - Vauxoo

THe method that create the move lines in account_voucher is too long, we will refactor to separate the generation of the dicts and data, in ths way in localization we can make the work more modular, and overwriting just what we need to comply with laws.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Essential
Drafter:
None
Direction:
Needs approval
Assignee:
Nhomar - Vauxoo
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Nhomar - Vauxoo
Completed by
Nhomar - Vauxoo

Sprints

Whiteboard

This method have 207 lines we will refactor for merge proposal.
We will follow this guidelines:

http://doc.openerp.com/v6.0/contribute/15_guidelines/coding_guidelines_framework.html#keep-your-methods-short-simple-when-possible
http://doc.openerp.com/v6.0/contribute/15_guidelines/coding_guidelines_framework.html
http://doc.openerp.com/v6.0/contribute/15_guidelines/coding_guidelines_framework.html#call-your-fish-a-fish

Deleted unused method:
1.- _get_payment_term_lines deleted
------------------------------------------------------------
revno: 5323
revision-id: openerp@cl-t076-283cl-20111008224641-omo5xikllr1xryg7
parent: <email address hidden>
author: Nhomar Hernandez <email address hidden>
committer: openerp <openerp@cl-t076-283cl>
branch nick: openobject-addons
timestamp: Sat 2011-10-08 18:46:41 -0400
message:
  [REF] Deleted unused method _get_payment_term_lines on account_voucher, avoiding noise and so much lines in this code.

2.- call-your-fish-a-fish

The method is iterating with a variable called "inv" but we are iterating over Voucher, the variable is renamed in all the method following the guideline call-your-fish-a-fish.

------------------------------------------------------------
revno: 5325
revision-id: <email address hidden>
parent: <email address hidden>
author: Javier Duran <email address hidden>
committer: Servidor Desarrollo <email address hidden>
branch nick: openobject-addons
timestamp: Sat 2011-10-08 19:06:26 -0400
message:
  [REF] The method call the voucher as 'inv' it is confusing whe you are reading a lot of lines and you are refering to something called diferently

3.- The creation of the first line can be different depends of the voucher and localization, we go out this method from the original ones.

------------------------------------------------------------
revno: 5327
revision-id: <email address hidden>
parent: <email address hidden>
author: Javier Duran <email address hidden>
committer: Servidor Desarrollo <email address hidden>
branch nick: openobject-addons
timestamp: Sat 2011-10-08 22:43:46 -0400
message:
  [REF] Creation of the first line in an external method call first_move_line_create

4.- The writeoff process in an external method, in this way we can override this depend of context of the voucher, and put some intelligence to this process in an external module.

------------------------------------------------------------
revno: 5329
revision-id: <email address hidden>
parent: <email address hidden>
author: Javier Duran <email address hidden>
committer: Servidor Desarrollo <email address hidden>
branch nick: openobject-addons
timestamp: Sun 2011-10-09 00:08:36 -0400
message:
  [REF] writeoff_move_line_create We put in an external methos the writeoff process

5.- Modifying action_move_create method to return a dict, rename action_move_create method to account_move_get, added docstring of account_move_get, methods follows the guideline

------------------------------------------------------------
revno: 5332
revision-id: <email address hidden>
parent: javier@cl-t076-283cl-20111010170727-r7rh4th9e42x08mp
author: <email address hidden>
committer: Javier Duran <email address hidden>
branch nick: openobject-addons-r1
timestamp: Mon 2011-10-10 15:39:34 -0400
message:
  [REF] Modifying action_move_create method to return a dict,
  rename action_move_create method to account_move_get,
  added docstring of account_move_get, methods follows the guideline.

6.- Modifying first_move_line_create method to return a dict, rename first_move_line_create method to first_move_line_get and added docstring of first_move_line_get method follows the guideline.

------------------------------------------------------------
revno: 5333
revision-id: <email address hidden>
parent: <email address hidden>
author: <email address hidden>
committer: Javier Duran <email address hidden>
branch nick: openobject-addons
timestamp: Mon 2011-10-10 17:08:06 -0400
message:
  [REF] Modifying first_move_line_create method to return a dict,
  rename first_move_line_create method to first_move_line_get
  added docstring of first_move_line_get method follows the guideline.

7.- Modifying writeoff_move_line_create method to return a dict, rename writeoff_move_line_create method to writeoff_move_line_get, added docstring of writeoff_move_line_get methods follows the guideline.

------------------------------------------------------------
revno: 5334
revision-id: <email address hidden>
parent: <email address hidden>
author: <email address hidden>
committer: Javier Duran <email address hidden>
branch nick: openobject-addons
timestamp: Mon 2011-10-10 18:19:15 -0400
message:
  [REF] Modifying writeoff_move_line_create method to return a dict,
  rename writeoff_move_line_create method to writeoff_move_line_get,
  added docstring of writeoff_move_line_get methods follows the guideline.

8.- Changing obtain company currency and current currency in an eternal method and rename one method.
------------------------------------------------------------
revno: 5335
revision-id: <email address hidden>
parent: <email address hidden>
committer: Javier Duran <email address hidden>
branch nick: openobject-addons
timestamp: Mon 2011-10-10 19:10:46 -0400
message:

  [REF] Changing to an external method curr currency and comp currency
  renaming a method from create to get

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.