Merge lp:~julie-w/unifield-server/US-7221 into lp:unifield-server
- US-7221
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5673 |
Proposed branch: | lp:~julie-w/unifield-server/US-7221 |
Merge into: | lp:unifield-server |
Diff against target: |
240 lines (+40/-79) 6 files modified
bin/addons/msf_profile/data/patches.xml (+5/-0) bin/addons/msf_profile/i18n/fr_MF.po (+3/-15) bin/addons/msf_profile/msf_profile.py (+28/-1) bin/addons/register_accounting/account_view.xml (+1/-13) bin/addons/register_accounting/wizard/register_opening.py (+3/-44) bin/addons/register_accounting/wizard/register_opening.xml (+0/-6) |
To merge this branch: | bzr merge lp:~julie-w/unifield-server/US-7221 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+381109@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/addons/msf_profile/data/patches.xml' | |||
2 | --- bin/addons/msf_profile/data/patches.xml 2020-03-20 14:08:02 +0000 | |||
3 | +++ bin/addons/msf_profile/data/patches.xml 2020-03-24 15:49:52 +0000 | |||
4 | @@ -522,5 +522,10 @@ | |||
5 | 522 | <field name="method">us_7025_7039_fix_nr_empty_ins</field> | 522 | <field name="method">us_7025_7039_fix_nr_empty_ins</field> |
6 | 523 | </record> | 523 | </record> |
7 | 524 | 524 | ||
8 | 525 | <!-- UF17.0 --> | ||
9 | 526 | <record id="us_7221_reset_starting_balance" model="patch.scripts"> | ||
10 | 527 | <field name="method">us_7221_reset_starting_balance</field> | ||
11 | 528 | </record> | ||
12 | 529 | |||
13 | 525 | </data> | 530 | </data> |
14 | 526 | </openerp> | 531 | </openerp> |
15 | 527 | 532 | ||
16 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
17 | --- bin/addons/msf_profile/i18n/fr_MF.po 2020-03-20 14:08:02 +0000 | |||
18 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2020-03-24 15:49:52 +0000 | |||
19 | @@ -4445,11 +4445,6 @@ | |||
20 | 4445 | msgid "There is no income account defined for this product: \"%s\" (id:%d)" | 4445 | msgid "There is no income account defined for this product: \"%s\" (id:%d)" |
21 | 4446 | msgstr "Il n'y a pas de compte de produit défini pour ce produit : \"%s\" (id : %d)." | 4446 | msgstr "Il n'y a pas de compte de produit défini pour ce produit : \"%s\" (id : %d)." |
22 | 4447 | 4447 | ||
23 | 4448 | #. module: register_accounting | ||
24 | 4449 | #: view:wizard.register.opening.confirmation:0 | ||
25 | 4450 | msgid "Register Starting Balance" | ||
26 | 4451 | msgstr "Solde Initial du Registre" | ||
27 | 4452 | |||
28 | 4453 | #. module: finance | 4448 | #. module: finance |
29 | 4454 | #: code:addons/finance/cash_request.py:276 | 4449 | #: code:addons/finance/cash_request.py:276 |
30 | 4455 | #, python-format | 4450 | #, python-format |
31 | @@ -60771,11 +60766,6 @@ | |||
32 | 60771 | msgid "In Progress..." | 60766 | msgid "In Progress..." |
33 | 60772 | msgstr "En Cours..." | 60767 | msgstr "En Cours..." |
34 | 60773 | 60768 | ||
35 | 60774 | #. module: register_accounting | ||
36 | 60775 | #: field:wizard.register.opening.confirmation,confirm_opening_balance:0 | ||
37 | 60776 | msgid "Do you want to open the register with the following starting balance?" | ||
38 | 60777 | msgstr "Voulez-vous ouvrir le registre avec le solde initial suivant ?" | ||
39 | 60778 | |||
40 | 60779 | #. module: msf_outgoing | 60769 | #. module: msf_outgoing |
41 | 60780 | #: field:stock.move.memory.shipment.create,selected_weight:0 | 60770 | #: field:stock.move.memory.shipment.create,selected_weight:0 |
42 | 60781 | #: field:stock.move.memory.shipment.returnpacks,selected_weight:0 | 60771 | #: field:stock.move.memory.shipment.returnpacks,selected_weight:0 |
43 | @@ -61304,7 +61294,6 @@ | |||
44 | 61304 | #. modules: account, register_accounting | 61294 | #. modules: account, register_accounting |
45 | 61305 | #: view:account.bank.statement:0 | 61295 | #: view:account.bank.statement:0 |
46 | 61306 | #: view:account.bank.statement:0 | 61296 | #: view:account.bank.statement:0 |
47 | 61307 | #: field:wizard.register.opening.confirmation,opening_balance:0 | ||
48 | 61308 | #: field:account.bank.statement,balance_start:0 | 61297 | #: field:account.bank.statement,balance_start:0 |
49 | 61309 | msgid "Starting Balance" | 61298 | msgid "Starting Balance" |
50 | 61310 | msgstr "Solde Initial" | 61299 | msgstr "Solde Initial" |
51 | @@ -68451,12 +68440,11 @@ | |||
52 | 68451 | msgid "External Partners" | 68440 | msgid "External Partners" |
53 | 68452 | msgstr "External Partners" | 68441 | msgstr "External Partners" |
54 | 68453 | 68442 | ||
56 | 68454 | #. modules: register_accounting, finance | 68443 | #. module: finance |
57 | 68455 | #: field:cash.request.liquidity,type:0 | 68444 | #: field:cash.request.liquidity,type:0 |
58 | 68456 | #: field:cash.request.liquidity.bank,type:0 | 68445 | #: field:cash.request.liquidity.bank,type:0 |
59 | 68457 | #: field:cash.request.liquidity.cash,type:0 | 68446 | #: field:cash.request.liquidity.cash,type:0 |
60 | 68458 | #: field:cash.request.liquidity.cheque,type:0 | 68447 | #: field:cash.request.liquidity.cheque,type:0 |
61 | 68459 | #: field:wizard.register.opening.confirmation,register_type:0 | ||
62 | 68460 | msgid "Register Type" | 68448 | msgid "Register Type" |
63 | 68461 | msgstr "Type de Registre" | 68449 | msgstr "Type de Registre" |
64 | 68462 | 68450 | ||
65 | @@ -99664,8 +99652,8 @@ | |||
66 | 99664 | #. module: register_accounting | 99652 | #. module: register_accounting |
67 | 99665 | #: code:addons/register_accounting/wizard/register_opening.py:91 | 99653 | #: code:addons/register_accounting/wizard/register_opening.py:91 |
68 | 99666 | #, python-format | 99654 | #, python-format |
71 | 99667 | msgid "You must tick the boxes before clicking on Yes." | 99655 | msgid "You must tick the box before clicking on Yes." |
72 | 99668 | msgstr "Vous devez cocher les cases avant de cliquer sur Oui." | 99656 | msgstr "Vous devez cocher la case avant de cliquer sur Oui." |
73 | 99669 | 99657 | ||
74 | 99670 | #. module: msf_partner | 99658 | #. module: msf_partner |
75 | 99671 | #: view:res.partner:0 | 99659 | #: view:res.partner:0 |
76 | 99672 | 99660 | ||
77 | === modified file 'bin/addons/msf_profile/msf_profile.py' | |||
78 | --- bin/addons/msf_profile/msf_profile.py 2020-03-20 14:08:02 +0000 | |||
79 | +++ bin/addons/msf_profile/msf_profile.py 2020-03-24 15:49:52 +0000 | |||
80 | @@ -53,6 +53,34 @@ | |||
81 | 53 | } | 53 | } |
82 | 54 | 54 | ||
83 | 55 | 55 | ||
84 | 56 | # UF17.0 | ||
85 | 57 | def us_7221_reset_starting_balance(self, cr, uid, *a, **b): | ||
86 | 58 | """ | ||
87 | 59 | Reset the Starting Balance of the first register created for each journal if it is still in Draft state | ||
88 | 60 | """ | ||
89 | 61 | # Cashbox details set to zero | ||
90 | 62 | cr.execute(""" | ||
91 | 63 | UPDATE account_cashbox_line | ||
92 | 64 | SET number = 0 | ||
93 | 65 | WHERE starting_id IN ( | ||
94 | 66 | SELECT id FROM account_bank_statement | ||
95 | 67 | WHERE state = 'draft' | ||
96 | 68 | AND prev_reg_id IS NULL | ||
97 | 69 | AND journal_id IN (SELECT id FROM account_journal WHERE type='cash') | ||
98 | 70 | ); | ||
99 | 71 | """) | ||
100 | 72 | # Starting Balance set to zero | ||
101 | 73 | cr.execute(""" | ||
102 | 74 | UPDATE account_bank_statement | ||
103 | 75 | SET balance_start = 0.0 | ||
104 | 76 | WHERE state = 'draft' | ||
105 | 77 | AND prev_reg_id IS NULL | ||
106 | 78 | AND journal_id IN (SELECT id FROM account_journal WHERE type in ('bank', 'cash')); | ||
107 | 79 | """) | ||
108 | 80 | self._logger.warn('Starting Balance set to zero in %s registers.' % (cr.rowcount,)) | ||
109 | 81 | return True | ||
110 | 82 | |||
111 | 83 | # UF16.1 | ||
112 | 56 | def remove_ir_actions_linked_to_deleted_modules(self, cr, uid, *a, **b): | 84 | def remove_ir_actions_linked_to_deleted_modules(self, cr, uid, *a, **b): |
113 | 57 | # delete remove actions | 85 | # delete remove actions |
114 | 58 | cr.execute("delete from ir_act_window where id in (select res_id from ir_model_data where module in ('procurement_report', 'threshold_value') and model='ir.actions.act_window')") | 86 | cr.execute("delete from ir_act_window where id in (select res_id from ir_model_data where module in ('procurement_report', 'threshold_value') and model='ir.actions.act_window')") |
115 | @@ -65,7 +93,6 @@ | |||
116 | 65 | 93 | ||
117 | 66 | return True | 94 | return True |
118 | 67 | 95 | ||
119 | 68 | # UF17.0 | ||
120 | 69 | def us_7025_7039_fix_nr_empty_ins(self, cr, uid, *a, **b): | 96 | def us_7025_7039_fix_nr_empty_ins(self, cr, uid, *a, **b): |
121 | 70 | """ | 97 | """ |
122 | 71 | 1. Set the Not Runs to run: | 98 | 1. Set the Not Runs to run: |
123 | 72 | 99 | ||
124 | === modified file 'bin/addons/register_accounting/account_view.xml' | |||
125 | --- bin/addons/register_accounting/account_view.xml 2020-02-11 13:28:59 +0000 | |||
126 | +++ bin/addons/register_accounting/account_view.xml 2020-03-24 15:49:52 +0000 | |||
127 | @@ -24,7 +24,7 @@ | |||
128 | 24 | <field name="bank_account_number"/> | 24 | <field name="bank_account_number"/> |
129 | 25 | <newline/> | 25 | <newline/> |
130 | 26 | <field name="prev_reg_id" invisible="1"/> | 26 | <field name="prev_reg_id" invisible="1"/> |
132 | 27 | <field name="balance_start" attrs="{'readonly': ['|', ('prev_reg_id', '!=', False), ('closing_balance_frozen', '=', True)]}"/> | 27 | <field name="balance_start" readonly="1"/> |
133 | 28 | <group col="3" colspan="4"> | 28 | <group col="3" colspan="4"> |
134 | 29 | <field name="balance_end_real" colspan="2" attrs="{'readonly': ['|', ('closing_balance_frozen', '=', True), ('state', 'in', ['confirm'])]}" string="Bank statement balance"/> | 29 | <field name="balance_end_real" colspan="2" attrs="{'readonly': ['|', ('closing_balance_frozen', '=', True), ('state', 'in', ['confirm'])]}" string="Bank statement balance"/> |
135 | 30 | <button name="button_confirm_closing_bank_balance" type="object" string="Confirm End-of-Month Balance" icon="gtk-apply" | 30 | <button name="button_confirm_closing_bank_balance" type="object" string="Confirm End-of-Month Balance" icon="gtk-apply" |
136 | @@ -340,18 +340,6 @@ | |||
137 | 340 | <page string="CashBox"> | 340 | <page string="CashBox"> |
138 | 341 | <field name="prev_reg_id" invisible="1"/> | 341 | <field name="prev_reg_id" invisible="1"/> |
139 | 342 | <group col="4" colspan="4"> | 342 | <group col="4" colspan="4"> |
140 | 343 | <field name="starting_details_ids" nolabel="1" colspan="2" attrs="{'invisible':['|',('state','!=','draft'),('prev_reg_id','!=',False)], 'readonly':['|',('state','!=','draft'),('prev_reg_id','!=',False)]}"> | ||
141 | 344 | <tree string="Starting Balance" editable="bottom"> | ||
142 | 345 | <field name="pieces"/> | ||
143 | 346 | <field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/> | ||
144 | 347 | <field name="subtotal" sum="Total"/> | ||
145 | 348 | </tree> | ||
146 | 349 | <form string="Starting Balance"> | ||
147 | 350 | <field name="pieces"/> | ||
148 | 351 | <field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/> | ||
149 | 352 | <field name="subtotal"/> | ||
150 | 353 | </form> | ||
151 | 354 | </field> | ||
152 | 355 | <field name="closing_balance_frozen" invisible="1"/> | 343 | <field name="closing_balance_frozen" invisible="1"/> |
153 | 356 | <field name="ending_details_ids" nolabel="1" colspan="2" attrs="{'readonly':['|', ('state','!=','open'), ('closing_balance_frozen', '=', True)]}"> | 344 | <field name="ending_details_ids" nolabel="1" colspan="2" attrs="{'readonly':['|', ('state','!=','open'), ('closing_balance_frozen', '=', True)]}"> |
154 | 357 | <tree string = "Closing Balance" editable="bottom"> | 345 | <tree string = "Closing Balance" editable="bottom"> |
155 | 358 | 346 | ||
156 | === modified file 'bin/addons/register_accounting/wizard/register_opening.py' | |||
157 | --- bin/addons/register_accounting/wizard/register_opening.py 2018-10-04 13:56:00 +0000 | |||
158 | +++ bin/addons/register_accounting/wizard/register_opening.py 2020-03-24 15:49:52 +0000 | |||
159 | @@ -29,44 +29,8 @@ | |||
160 | 29 | 29 | ||
161 | 30 | _name = 'wizard.register.opening.confirmation' | 30 | _name = 'wizard.register.opening.confirmation' |
162 | 31 | 31 | ||
163 | 32 | def _get_opening_balance(self, cr, uid, ids, name, arg, context=None): | ||
164 | 33 | """ | ||
165 | 34 | Returns a dict with key = id of the wizard, and value = amount of the starting balance of the related register | ||
166 | 35 | The Starting Balance is: | ||
167 | 36 | - equal to the value of "balance_start" for Bank Registers | ||
168 | 37 | - based on the Cashbox lines for Cash Registers | ||
169 | 38 | - always equal to 0.00 for Cheque Registers | ||
170 | 39 | """ | ||
171 | 40 | res = {} | ||
172 | 41 | if context is None: | ||
173 | 42 | context = {} | ||
174 | 43 | reg_obj = self.pool.get('account.bank.statement') | ||
175 | 44 | for wiz in self.browse(cr, uid, ids, fields_to_fetch=['register_id', 'register_type'], context=context): | ||
176 | 45 | res[wiz.id] = 0.0 | ||
177 | 46 | if wiz.register_id: | ||
178 | 47 | reg_id = wiz.register_id.id | ||
179 | 48 | reg_type = wiz.register_type | ||
180 | 49 | if reg_type == 'bank': | ||
181 | 50 | res[wiz.id] = wiz.register_id.balance_start or 0.0 | ||
182 | 51 | elif reg_type == 'cash': | ||
183 | 52 | computed_balance = reg_obj._get_starting_balance(cr, uid, [reg_id], context=context) | ||
184 | 53 | res[wiz.id] = computed_balance[reg_id].get('balance_start', 0.0) | ||
185 | 54 | return res | ||
186 | 55 | |||
187 | 56 | def _get_journal_type(self, cr, uid, context=None): | ||
188 | 57 | """ | ||
189 | 58 | Returns a list of tuples containing the different Journal Types | ||
190 | 59 | """ | ||
191 | 60 | return self.pool.get('account.journal').get_journal_type(cr, uid, context=context) | ||
192 | 61 | |||
193 | 62 | _columns = { | 32 | _columns = { |
194 | 63 | 'confirm_opening_balance': fields.boolean(string='Do you want to open the register with the following starting balance?', | ||
195 | 64 | required=False), | ||
196 | 65 | 'register_id': fields.many2one('account.bank.statement', 'Register', required=True, readonly=True), | 33 | 'register_id': fields.many2one('account.bank.statement', 'Register', required=True, readonly=True), |
197 | 66 | 'register_type': fields.related('register_id', 'journal_id', 'type', string='Register Type', type='selection', | ||
198 | 67 | selection=_get_journal_type, readonly=True), | ||
199 | 68 | 'opening_balance': fields.function(_get_opening_balance, method=True, type='float', readonly=True, | ||
200 | 69 | string='Starting Balance'), | ||
201 | 70 | 'confirm_opening_period': fields.boolean(string='Do you want to open the register on the following period?', | 34 | 'confirm_opening_period': fields.boolean(string='Do you want to open the register on the following period?', |
202 | 71 | required=False), | 35 | required=False), |
203 | 72 | 'opening_period': fields.related('register_id', 'period_id', string='Opening Period', type='many2one', | 36 | 'opening_period': fields.related('register_id', 'period_id', string='Opening Period', type='many2one', |
204 | @@ -84,16 +48,11 @@ | |||
205 | 84 | reg_obj = self.pool.get('account.bank.statement') | 48 | reg_obj = self.pool.get('account.bank.statement') |
206 | 85 | wiz = self.browse(cr, uid, ids[0], context=context) | 49 | wiz = self.browse(cr, uid, ids[0], context=context) |
207 | 86 | reg_id = wiz.register_id.id | 50 | reg_id = wiz.register_id.id |
208 | 87 | reg_type = wiz.register_type | ||
209 | 88 | balance_ok = wiz.confirm_opening_balance or reg_type == 'cheque' | ||
210 | 89 | period_ok = wiz.confirm_opening_period | 51 | period_ok = wiz.confirm_opening_period |
213 | 90 | if not balance_ok or not period_ok: | 52 | if not period_ok: |
214 | 91 | raise osv.except_osv(_('Warning'), _('You must tick the boxes before clicking on Yes.')) | 53 | raise osv.except_osv(_('Warning'), _('You must tick the box before clicking on Yes.')) |
215 | 92 | else: | 54 | else: |
220 | 93 | cash_opening_balance = 0.0 | 55 | reg_obj.open_register(cr, uid, reg_id, cash_opening_balance=0.0, context=context) |
217 | 94 | if reg_type == 'cash': | ||
218 | 95 | cash_opening_balance = wiz.opening_balance | ||
219 | 96 | reg_obj.open_register(cr, uid, reg_id, cash_opening_balance=cash_opening_balance, context=context) | ||
221 | 97 | return {'type': 'ir.actions.act_window_close'} | 56 | return {'type': 'ir.actions.act_window_close'} |
222 | 98 | 57 | ||
223 | 99 | 58 | ||
224 | 100 | 59 | ||
225 | === modified file 'bin/addons/register_accounting/wizard/register_opening.xml' | |||
226 | --- bin/addons/register_accounting/wizard/register_opening.xml 2018-10-04 13:56:00 +0000 | |||
227 | +++ bin/addons/register_accounting/wizard/register_opening.xml 2020-03-24 15:49:52 +0000 | |||
228 | @@ -7,12 +7,6 @@ | |||
229 | 7 | <field name='type'>form</field> | 7 | <field name='type'>form</field> |
230 | 8 | <field name='arch' type='xml'> | 8 | <field name='arch' type='xml'> |
231 | 9 | <form string="Open Register Confirmation"> | 9 | <form string="Open Register Confirmation"> |
232 | 10 | <group colspan="4" attrs="{'invisible': [('register_type', '=', 'cheque')]}"> | ||
233 | 11 | <separator string="Register Starting Balance"/> | ||
234 | 12 | <field name="register_type" invisible="1"/> | ||
235 | 13 | <field name="confirm_opening_balance"/> | ||
236 | 14 | <field name="opening_balance"/> | ||
237 | 15 | </group> | ||
238 | 16 | <group colspan="4"> | 10 | <group colspan="4"> |
239 | 17 | <separator string="Register Opening Period"/> | 11 | <separator string="Register Opening Period"/> |
240 | 18 | <field name="confirm_opening_period"/> | 12 | <field name="confirm_opening_period"/> |