Merge lp:~julie-w/unifield-server/US-7221 into lp:unifield-server

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
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+381109@code.launchpad.net
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
=== modified file 'bin/addons/msf_profile/data/patches.xml'
--- bin/addons/msf_profile/data/patches.xml 2020-03-20 14:08:02 +0000
+++ bin/addons/msf_profile/data/patches.xml 2020-03-24 15:49:52 +0000
@@ -522,5 +522,10 @@
522 <field name="method">us_7025_7039_fix_nr_empty_ins</field>522 <field name="method">us_7025_7039_fix_nr_empty_ins</field>
523 </record>523 </record>
524524
525 <!-- UF17.0 -->
526 <record id="us_7221_reset_starting_balance" model="patch.scripts">
527 <field name="method">us_7221_reset_starting_balance</field>
528 </record>
529
525 </data>530 </data>
526</openerp>531</openerp>
527532
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2020-03-20 14:08:02 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2020-03-24 15:49:52 +0000
@@ -4445,11 +4445,6 @@
4445msgid "There is no income account defined for this product: \"%s\" (id:%d)"4445msgid "There is no income account defined for this product: \"%s\" (id:%d)"
4446msgstr "Il n'y a pas de compte de produit défini pour ce produit : \"%s\" (id : %d)."4446msgstr "Il n'y a pas de compte de produit défini pour ce produit : \"%s\" (id : %d)."
44474447
4448#. module: register_accounting
4449#: view:wizard.register.opening.confirmation:0
4450msgid "Register Starting Balance"
4451msgstr "Solde Initial du Registre"
4452
4453#. module: finance4448#. module: finance
4454#: code:addons/finance/cash_request.py:2764449#: code:addons/finance/cash_request.py:276
4455#, python-format4450#, python-format
@@ -60771,11 +60766,6 @@
60771msgid "In Progress..."60766msgid "In Progress..."
60772msgstr "En Cours..."60767msgstr "En Cours..."
6077360768
60774#. module: register_accounting
60775#: field:wizard.register.opening.confirmation,confirm_opening_balance:0
60776msgid "Do you want to open the register with the following starting balance?"
60777msgstr "Voulez-vous ouvrir le registre avec le solde initial suivant ?"
60778
60779#. module: msf_outgoing60769#. module: msf_outgoing
60780#: field:stock.move.memory.shipment.create,selected_weight:060770#: field:stock.move.memory.shipment.create,selected_weight:0
60781#: field:stock.move.memory.shipment.returnpacks,selected_weight:060771#: field:stock.move.memory.shipment.returnpacks,selected_weight:0
@@ -61304,7 +61294,6 @@
61304#. modules: account, register_accounting61294#. modules: account, register_accounting
61305#: view:account.bank.statement:061295#: view:account.bank.statement:0
61306#: view:account.bank.statement:061296#: view:account.bank.statement:0
61307#: field:wizard.register.opening.confirmation,opening_balance:0
61308#: field:account.bank.statement,balance_start:061297#: field:account.bank.statement,balance_start:0
61309msgid "Starting Balance"61298msgid "Starting Balance"
61310msgstr "Solde Initial"61299msgstr "Solde Initial"
@@ -68451,12 +68440,11 @@
68451msgid "External Partners"68440msgid "External Partners"
68452msgstr "External Partners"68441msgstr "External Partners"
6845368442
68454#. modules: register_accounting, finance68443#. module: finance
68455#: field:cash.request.liquidity,type:068444#: field:cash.request.liquidity,type:0
68456#: field:cash.request.liquidity.bank,type:068445#: field:cash.request.liquidity.bank,type:0
68457#: field:cash.request.liquidity.cash,type:068446#: field:cash.request.liquidity.cash,type:0
68458#: field:cash.request.liquidity.cheque,type:068447#: field:cash.request.liquidity.cheque,type:0
68459#: field:wizard.register.opening.confirmation,register_type:0
68460msgid "Register Type"68448msgid "Register Type"
68461msgstr "Type de Registre"68449msgstr "Type de Registre"
6846268450
@@ -99664,8 +99652,8 @@
99664#. module: register_accounting99652#. module: register_accounting
99665#: code:addons/register_accounting/wizard/register_opening.py:9199653#: code:addons/register_accounting/wizard/register_opening.py:91
99666#, python-format99654#, python-format
99667msgid "You must tick the boxes before clicking on Yes."99655msgid "You must tick the box before clicking on Yes."
99668msgstr "Vous devez cocher les cases avant de cliquer sur Oui."99656msgstr "Vous devez cocher la case avant de cliquer sur Oui."
9966999657
99670#. module: msf_partner99658#. module: msf_partner
99671#: view:res.partner:099659#: view:res.partner:0
9967299660
=== modified file 'bin/addons/msf_profile/msf_profile.py'
--- bin/addons/msf_profile/msf_profile.py 2020-03-20 14:08:02 +0000
+++ bin/addons/msf_profile/msf_profile.py 2020-03-24 15:49:52 +0000
@@ -53,6 +53,34 @@
53 }53 }
5454
5555
56 # UF17.0
57 def us_7221_reset_starting_balance(self, cr, uid, *a, **b):
58 """
59 Reset the Starting Balance of the first register created for each journal if it is still in Draft state
60 """
61 # Cashbox details set to zero
62 cr.execute("""
63 UPDATE account_cashbox_line
64 SET number = 0
65 WHERE starting_id IN (
66 SELECT id FROM account_bank_statement
67 WHERE state = 'draft'
68 AND prev_reg_id IS NULL
69 AND journal_id IN (SELECT id FROM account_journal WHERE type='cash')
70 );
71 """)
72 # Starting Balance set to zero
73 cr.execute("""
74 UPDATE account_bank_statement
75 SET balance_start = 0.0
76 WHERE state = 'draft'
77 AND prev_reg_id IS NULL
78 AND journal_id IN (SELECT id FROM account_journal WHERE type in ('bank', 'cash'));
79 """)
80 self._logger.warn('Starting Balance set to zero in %s registers.' % (cr.rowcount,))
81 return True
82
83 # UF16.1
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):
57 # delete remove actions85 # delete remove actions
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')")
@@ -65,7 +93,6 @@
6593
66 return True94 return True
6795
68 # UF17.0
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):
70 """97 """
71 1. Set the Not Runs to run:98 1. Set the Not Runs to run:
7299
=== modified file 'bin/addons/register_accounting/account_view.xml'
--- bin/addons/register_accounting/account_view.xml 2020-02-11 13:28:59 +0000
+++ bin/addons/register_accounting/account_view.xml 2020-03-24 15:49:52 +0000
@@ -24,7 +24,7 @@
24 <field name="bank_account_number"/>24 <field name="bank_account_number"/>
25 <newline/>25 <newline/>
26 <field name="prev_reg_id" invisible="1"/>26 <field name="prev_reg_id" invisible="1"/>
27 <field name="balance_start" attrs="{'readonly': ['|', ('prev_reg_id', '!=', False), ('closing_balance_frozen', '=', True)]}"/>27 <field name="balance_start" readonly="1"/>
28 <group col="3" colspan="4">28 <group col="3" colspan="4">
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"/>
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"
@@ -340,18 +340,6 @@
340 <page string="CashBox">340 <page string="CashBox">
341 <field name="prev_reg_id" invisible="1"/>341 <field name="prev_reg_id" invisible="1"/>
342 <group col="4" colspan="4">342 <group col="4" colspan="4">
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)]}">
344 <tree string="Starting Balance" editable="bottom">
345 <field name="pieces"/>
346 <field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
347 <field name="subtotal" sum="Total"/>
348 </tree>
349 <form string="Starting Balance">
350 <field name="pieces"/>
351 <field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
352 <field name="subtotal"/>
353 </form>
354 </field>
355 <field name="closing_balance_frozen" invisible="1"/>343 <field name="closing_balance_frozen" invisible="1"/>
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)]}">
357 <tree string = "Closing Balance" editable="bottom">345 <tree string = "Closing Balance" editable="bottom">
358346
=== modified file 'bin/addons/register_accounting/wizard/register_opening.py'
--- bin/addons/register_accounting/wizard/register_opening.py 2018-10-04 13:56:00 +0000
+++ bin/addons/register_accounting/wizard/register_opening.py 2020-03-24 15:49:52 +0000
@@ -29,44 +29,8 @@
2929
30 _name = 'wizard.register.opening.confirmation'30 _name = 'wizard.register.opening.confirmation'
3131
32 def _get_opening_balance(self, cr, uid, ids, name, arg, context=None):
33 """
34 Returns a dict with key = id of the wizard, and value = amount of the starting balance of the related register
35 The Starting Balance is:
36 - equal to the value of "balance_start" for Bank Registers
37 - based on the Cashbox lines for Cash Registers
38 - always equal to 0.00 for Cheque Registers
39 """
40 res = {}
41 if context is None:
42 context = {}
43 reg_obj = self.pool.get('account.bank.statement')
44 for wiz in self.browse(cr, uid, ids, fields_to_fetch=['register_id', 'register_type'], context=context):
45 res[wiz.id] = 0.0
46 if wiz.register_id:
47 reg_id = wiz.register_id.id
48 reg_type = wiz.register_type
49 if reg_type == 'bank':
50 res[wiz.id] = wiz.register_id.balance_start or 0.0
51 elif reg_type == 'cash':
52 computed_balance = reg_obj._get_starting_balance(cr, uid, [reg_id], context=context)
53 res[wiz.id] = computed_balance[reg_id].get('balance_start', 0.0)
54 return res
55
56 def _get_journal_type(self, cr, uid, context=None):
57 """
58 Returns a list of tuples containing the different Journal Types
59 """
60 return self.pool.get('account.journal').get_journal_type(cr, uid, context=context)
61
62 _columns = {32 _columns = {
63 'confirm_opening_balance': fields.boolean(string='Do you want to open the register with the following starting balance?',
64 required=False),
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),
66 'register_type': fields.related('register_id', 'journal_id', 'type', string='Register Type', type='selection',
67 selection=_get_journal_type, readonly=True),
68 'opening_balance': fields.function(_get_opening_balance, method=True, type='float', readonly=True,
69 string='Starting Balance'),
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?',
71 required=False),35 required=False),
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',
@@ -84,16 +48,11 @@
84 reg_obj = self.pool.get('account.bank.statement')48 reg_obj = self.pool.get('account.bank.statement')
85 wiz = self.browse(cr, uid, ids[0], context=context)49 wiz = self.browse(cr, uid, ids[0], context=context)
86 reg_id = wiz.register_id.id50 reg_id = wiz.register_id.id
87 reg_type = wiz.register_type
88 balance_ok = wiz.confirm_opening_balance or reg_type == 'cheque'
89 period_ok = wiz.confirm_opening_period51 period_ok = wiz.confirm_opening_period
90 if not balance_ok or not period_ok:52 if not period_ok:
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.'))
92 else:54 else:
93 cash_opening_balance = 0.055 reg_obj.open_register(cr, uid, reg_id, cash_opening_balance=0.0, context=context)
94 if reg_type == 'cash':
95 cash_opening_balance = wiz.opening_balance
96 reg_obj.open_register(cr, uid, reg_id, cash_opening_balance=cash_opening_balance, context=context)
97 return {'type': 'ir.actions.act_window_close'}56 return {'type': 'ir.actions.act_window_close'}
9857
9958
10059
=== modified file 'bin/addons/register_accounting/wizard/register_opening.xml'
--- bin/addons/register_accounting/wizard/register_opening.xml 2018-10-04 13:56:00 +0000
+++ bin/addons/register_accounting/wizard/register_opening.xml 2020-03-24 15:49:52 +0000
@@ -7,12 +7,6 @@
7 <field name='type'>form</field>7 <field name='type'>form</field>
8 <field name='arch' type='xml'>8 <field name='arch' type='xml'>
9 <form string="Open Register Confirmation">9 <form string="Open Register Confirmation">
10 <group colspan="4" attrs="{'invisible': [('register_type', '=', 'cheque')]}">
11 <separator string="Register Starting Balance"/>
12 <field name="register_type" invisible="1"/>
13 <field name="confirm_opening_balance"/>
14 <field name="opening_balance"/>
15 </group>
16 <group colspan="4">10 <group colspan="4">
17 <separator string="Register Opening Period"/>11 <separator string="Register Opening Period"/>
18 <field name="confirm_opening_period"/>12 <field name="confirm_opening_period"/>

Subscribers

People subscribed via source and target branches