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 | <field name="method">us_7025_7039_fix_nr_empty_ins</field> |
6 | </record> |
7 | |
8 | + <!-- UF17.0 --> |
9 | + <record id="us_7221_reset_starting_balance" model="patch.scripts"> |
10 | + <field name="method">us_7221_reset_starting_balance</field> |
11 | + </record> |
12 | + |
13 | </data> |
14 | </openerp> |
15 | |
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 | msgid "There is no income account defined for this product: \"%s\" (id:%d)" |
21 | msgstr "Il n'y a pas de compte de produit défini pour ce produit : \"%s\" (id : %d)." |
22 | |
23 | -#. module: register_accounting |
24 | -#: view:wizard.register.opening.confirmation:0 |
25 | -msgid "Register Starting Balance" |
26 | -msgstr "Solde Initial du Registre" |
27 | - |
28 | #. module: finance |
29 | #: code:addons/finance/cash_request.py:276 |
30 | #, python-format |
31 | @@ -60771,11 +60766,6 @@ |
32 | msgid "In Progress..." |
33 | msgstr "En Cours..." |
34 | |
35 | -#. module: register_accounting |
36 | -#: field:wizard.register.opening.confirmation,confirm_opening_balance:0 |
37 | -msgid "Do you want to open the register with the following starting balance?" |
38 | -msgstr "Voulez-vous ouvrir le registre avec le solde initial suivant ?" |
39 | - |
40 | #. module: msf_outgoing |
41 | #: field:stock.move.memory.shipment.create,selected_weight:0 |
42 | #: field:stock.move.memory.shipment.returnpacks,selected_weight:0 |
43 | @@ -61304,7 +61294,6 @@ |
44 | #. modules: account, register_accounting |
45 | #: view:account.bank.statement:0 |
46 | #: view:account.bank.statement:0 |
47 | -#: field:wizard.register.opening.confirmation,opening_balance:0 |
48 | #: field:account.bank.statement,balance_start:0 |
49 | msgid "Starting Balance" |
50 | msgstr "Solde Initial" |
51 | @@ -68451,12 +68440,11 @@ |
52 | msgid "External Partners" |
53 | msgstr "External Partners" |
54 | |
55 | -#. modules: register_accounting, finance |
56 | +#. module: finance |
57 | #: field:cash.request.liquidity,type:0 |
58 | #: field:cash.request.liquidity.bank,type:0 |
59 | #: field:cash.request.liquidity.cash,type:0 |
60 | #: field:cash.request.liquidity.cheque,type:0 |
61 | -#: field:wizard.register.opening.confirmation,register_type:0 |
62 | msgid "Register Type" |
63 | msgstr "Type de Registre" |
64 | |
65 | @@ -99664,8 +99652,8 @@ |
66 | #. module: register_accounting |
67 | #: code:addons/register_accounting/wizard/register_opening.py:91 |
68 | #, python-format |
69 | -msgid "You must tick the boxes before clicking on Yes." |
70 | -msgstr "Vous devez cocher les cases avant de cliquer sur Oui." |
71 | +msgid "You must tick the box before clicking on Yes." |
72 | +msgstr "Vous devez cocher la case avant de cliquer sur Oui." |
73 | |
74 | #. module: msf_partner |
75 | #: view:res.partner:0 |
76 | |
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 | } |
82 | |
83 | |
84 | + # UF17.0 |
85 | + def us_7221_reset_starting_balance(self, cr, uid, *a, **b): |
86 | + """ |
87 | + Reset the Starting Balance of the first register created for each journal if it is still in Draft state |
88 | + """ |
89 | + # Cashbox details set to zero |
90 | + cr.execute(""" |
91 | + UPDATE account_cashbox_line |
92 | + SET number = 0 |
93 | + WHERE starting_id IN ( |
94 | + SELECT id FROM account_bank_statement |
95 | + WHERE state = 'draft' |
96 | + AND prev_reg_id IS NULL |
97 | + AND journal_id IN (SELECT id FROM account_journal WHERE type='cash') |
98 | + ); |
99 | + """) |
100 | + # Starting Balance set to zero |
101 | + cr.execute(""" |
102 | + UPDATE account_bank_statement |
103 | + SET balance_start = 0.0 |
104 | + WHERE state = 'draft' |
105 | + AND prev_reg_id IS NULL |
106 | + AND journal_id IN (SELECT id FROM account_journal WHERE type in ('bank', 'cash')); |
107 | + """) |
108 | + self._logger.warn('Starting Balance set to zero in %s registers.' % (cr.rowcount,)) |
109 | + return True |
110 | + |
111 | + # UF16.1 |
112 | def remove_ir_actions_linked_to_deleted_modules(self, cr, uid, *a, **b): |
113 | # delete remove actions |
114 | 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 | |
117 | return True |
118 | |
119 | - # UF17.0 |
120 | def us_7025_7039_fix_nr_empty_ins(self, cr, uid, *a, **b): |
121 | """ |
122 | 1. Set the Not Runs to run: |
123 | |
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 | <field name="bank_account_number"/> |
129 | <newline/> |
130 | <field name="prev_reg_id" invisible="1"/> |
131 | - <field name="balance_start" attrs="{'readonly': ['|', ('prev_reg_id', '!=', False), ('closing_balance_frozen', '=', True)]}"/> |
132 | + <field name="balance_start" readonly="1"/> |
133 | <group col="3" colspan="4"> |
134 | <field name="balance_end_real" colspan="2" attrs="{'readonly': ['|', ('closing_balance_frozen', '=', True), ('state', 'in', ['confirm'])]}" string="Bank statement balance"/> |
135 | <button name="button_confirm_closing_bank_balance" type="object" string="Confirm End-of-Month Balance" icon="gtk-apply" |
136 | @@ -340,18 +340,6 @@ |
137 | <page string="CashBox"> |
138 | <field name="prev_reg_id" invisible="1"/> |
139 | <group col="4" colspan="4"> |
140 | - <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 | - <tree string="Starting Balance" editable="bottom"> |
142 | - <field name="pieces"/> |
143 | - <field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/> |
144 | - <field name="subtotal" sum="Total"/> |
145 | - </tree> |
146 | - <form string="Starting Balance"> |
147 | - <field name="pieces"/> |
148 | - <field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/> |
149 | - <field name="subtotal"/> |
150 | - </form> |
151 | - </field> |
152 | <field name="closing_balance_frozen" invisible="1"/> |
153 | <field name="ending_details_ids" nolabel="1" colspan="2" attrs="{'readonly':['|', ('state','!=','open'), ('closing_balance_frozen', '=', True)]}"> |
154 | <tree string = "Closing Balance" editable="bottom"> |
155 | |
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 | |
161 | _name = 'wizard.register.opening.confirmation' |
162 | |
163 | - def _get_opening_balance(self, cr, uid, ids, name, arg, context=None): |
164 | - """ |
165 | - Returns a dict with key = id of the wizard, and value = amount of the starting balance of the related register |
166 | - The Starting Balance is: |
167 | - - equal to the value of "balance_start" for Bank Registers |
168 | - - based on the Cashbox lines for Cash Registers |
169 | - - always equal to 0.00 for Cheque Registers |
170 | - """ |
171 | - res = {} |
172 | - if context is None: |
173 | - context = {} |
174 | - reg_obj = self.pool.get('account.bank.statement') |
175 | - for wiz in self.browse(cr, uid, ids, fields_to_fetch=['register_id', 'register_type'], context=context): |
176 | - res[wiz.id] = 0.0 |
177 | - if wiz.register_id: |
178 | - reg_id = wiz.register_id.id |
179 | - reg_type = wiz.register_type |
180 | - if reg_type == 'bank': |
181 | - res[wiz.id] = wiz.register_id.balance_start or 0.0 |
182 | - elif reg_type == 'cash': |
183 | - computed_balance = reg_obj._get_starting_balance(cr, uid, [reg_id], context=context) |
184 | - res[wiz.id] = computed_balance[reg_id].get('balance_start', 0.0) |
185 | - return res |
186 | - |
187 | - def _get_journal_type(self, cr, uid, context=None): |
188 | - """ |
189 | - Returns a list of tuples containing the different Journal Types |
190 | - """ |
191 | - return self.pool.get('account.journal').get_journal_type(cr, uid, context=context) |
192 | - |
193 | _columns = { |
194 | - 'confirm_opening_balance': fields.boolean(string='Do you want to open the register with the following starting balance?', |
195 | - required=False), |
196 | 'register_id': fields.many2one('account.bank.statement', 'Register', required=True, readonly=True), |
197 | - 'register_type': fields.related('register_id', 'journal_id', 'type', string='Register Type', type='selection', |
198 | - selection=_get_journal_type, readonly=True), |
199 | - 'opening_balance': fields.function(_get_opening_balance, method=True, type='float', readonly=True, |
200 | - string='Starting Balance'), |
201 | 'confirm_opening_period': fields.boolean(string='Do you want to open the register on the following period?', |
202 | required=False), |
203 | 'opening_period': fields.related('register_id', 'period_id', string='Opening Period', type='many2one', |
204 | @@ -84,16 +48,11 @@ |
205 | reg_obj = self.pool.get('account.bank.statement') |
206 | wiz = self.browse(cr, uid, ids[0], context=context) |
207 | reg_id = wiz.register_id.id |
208 | - reg_type = wiz.register_type |
209 | - balance_ok = wiz.confirm_opening_balance or reg_type == 'cheque' |
210 | period_ok = wiz.confirm_opening_period |
211 | - if not balance_ok or not period_ok: |
212 | - raise osv.except_osv(_('Warning'), _('You must tick the boxes before clicking on Yes.')) |
213 | + if not period_ok: |
214 | + raise osv.except_osv(_('Warning'), _('You must tick the box before clicking on Yes.')) |
215 | else: |
216 | - cash_opening_balance = 0.0 |
217 | - if reg_type == 'cash': |
218 | - cash_opening_balance = wiz.opening_balance |
219 | - reg_obj.open_register(cr, uid, reg_id, cash_opening_balance=cash_opening_balance, context=context) |
220 | + reg_obj.open_register(cr, uid, reg_id, cash_opening_balance=0.0, context=context) |
221 | return {'type': 'ir.actions.act_window_close'} |
222 | |
223 | |
224 | |
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 | <field name='type'>form</field> |
230 | <field name='arch' type='xml'> |
231 | <form string="Open Register Confirmation"> |
232 | - <group colspan="4" attrs="{'invisible': [('register_type', '=', 'cheque')]}"> |
233 | - <separator string="Register Starting Balance"/> |
234 | - <field name="register_type" invisible="1"/> |
235 | - <field name="confirm_opening_balance"/> |
236 | - <field name="opening_balance"/> |
237 | - </group> |
238 | <group colspan="4"> |
239 | <separator string="Register Opening Period"/> |
240 | <field name="confirm_opening_period"/> |