Merge lp:~mukunde/unifield-server/US-11269 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 6205
Proposed branch: lp:~mukunde/unifield-server/US-11269
Merge into: lp:unifield-server
Diff against target: 344 lines (+204/-3) (has conflicts)
5 files modified
bin/addons/account/account.py (+76/-0)
bin/addons/account/account_view.xml (+47/-0)
bin/addons/account_journal/account_journal.py (+14/-0)
bin/addons/account_journal/account_journal_view.xml (+3/-2)
bin/addons/msf_profile/i18n/fr_MF.po (+64/-1)
Text conflict in bin/addons/msf_profile/i18n/fr_MF.po
To merge this branch: bzr merge lp:~mukunde/unifield-server/US-11269
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+451897@code.launchpad.net
To post a comment you must log in.
lp:~mukunde/unifield-server/US-11269 updated
6138. By jftempo

US-12011 [MERGE] PO Confirmation with MML non-conform product

6139. By jftempo

[MERGE] UF30.1

6140. By jftempo

Release UF30.1

6141. By jftempo

US-5946 [FIX] Import expact
     - allow integer as Indentifier
     - end date: issue depending on server locale (fr_MF)
     - Tools > Import : allow to import file with or without end date

6142. By jftempo

US-12041 [FIX] Import payroll: lmf if envoi.ini is ISO-8859 encoded with special char

6143. By jftempo

US-12130 [FIX] JI / JI Selector: pink screen if Display HQ Code is enabled on Company configuration

6144. By jftempo

US-12069 [IMP] OCP Webservice to update res.currency.table

6145. By jftempo

US-US-5912 [FIX] Export PO f/up: too many lines, replace Lmf by a warning message

6146. By jftempo

US-5376 [FIX] HQ entries import: allow B/S account

6147. By jftempo

US-6516 [FIX] OCG VI Finance: py3 error on itekeys

6148. By jftempo

[MERGE] UF31.0rc0

6149. By jftempo

[MERGE] UF31.0rc1

6150. By jftempo

[FIX] UF30.1 py3 migration

6151. By jftempo

[FIX] Asset py3: int, long

6152. By jftempo

US-12185 |FIX] PI import with ED date 11-2222 nothing happens
   - dateutil.parser.parse does not raise a ValueError
   - Exception.message no longer exists in py3

6153. By jftempo

Exception has no more message attribute

6154. By jftempo

[MERGE] UF31.0rc2

6155. By jftempo

US-11950 [FIX] Product asset sync down state

6156. By jftempo

[IMP] RB: create asset data

6157. By jftempo

Upgrade python lib

6158. By jftempo

Upgrade python lib

6159. By jftempo

Upgrade python lib

6160. By jftempo

upgrade from pip-audit

6161. By jftempo

Upgrade lib from safety tool

6162. By jftempo

[IMP] replace deprecated currentThread() / isDaemon() by current_thread() / daemon

6163. By jftempo

[FIX] Py3 Pillow 10: getsize replaced by getbbox

6164. By jftempo

US-12244 [FIX] Periodical forecast: fixed date check for dates in the future

6165. By jftempo

US-6144-py3 [FIX] Sourcing: fixed name filtering for python 3 during creation/modification

lp:~dorian-kemps/unifield-server/US-6144-py3

6166. By jftempo

[FIX] Generate translation file to py3

6167. By jftempo

Release UF31.0py3

6168. By jftempo

[MERGE] UF31.1

6169. By jftempo

unifield-version.txt: typo in version

6170. By Gaël Mukunde

US-11269 [IMP] Prevent changing G/L accounts linked to non-draft registers

6171. By Gaël Mukunde

US-11269 [IMP] Code fix to allow edition of default journal accounts only until first edition, after that it's only editable through action menu by super admin

6172. By Gaël Mukunde

US-11269 [IMP] Use less generic class name

6173. By Gaël Mukunde

US-11269 [IMP] Remove unused code + update the domain of the fields of the wizard + rename button

6174. By Gaël Mukunde

US-11269 [IMP] Rename action

6175. By Gaël Mukunde

US-11269 [IMP] Restrict domain of proposed account in wizard to only liquidity accounts

6176. By Gaël Mukunde

US-11269 [IMP] Code to adapt dynamically the domain of default accounts to display in the wizard search

6177. By Gaël Mukunde

US-11269 [IMP] Remove unused code

6178. By Gaël Mukunde

US-11269 [IMP] French translation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/account/account.py'
--- bin/addons/account/account.py 2023-11-03 15:04:29 +0000
+++ bin/addons/account/account.py 2024-02-05 12:55:03 +0000
@@ -2939,4 +2939,80 @@
29392939
2940account_bank_accounts_wizard()2940account_bank_accounts_wizard()
29412941
2942class journal_change_account(osv.osv_memory):
2943 _name = 'journal.change.account'
2944
2945 def _get_journal(self, cr, uid, context=None):
2946 if context is None:
2947 context = {}
2948 return context.get('active_id', False)
2949
2950 def _get_journal_type(self, cr, uid, context=None):
2951 if context is None:
2952 context = {}
2953 if context.get('active_id', False):
2954 return self.pool.get('account.journal').read(cr, uid, context['active_id'], ['type'], context=context)['type']
2955 return False
2956
2957 def _get_instance(self, cr, uid, context=None):
2958 if context is None:
2959 context = {}
2960 ids = context.get('active_ids', False)
2961 if ids and len(ids) == 1:
2962 return self.pool.get('account.journal').read(cr, uid, ids[0], ['is_current_instance'], context=context)['is_current_instance']
2963 return False
2964
2965 def _get_credit_account(self, cr, uid, context=None):
2966 if context is None:
2967 context = {}
2968 ids = context.get('active_ids', False)
2969 if ids and len(ids) == 1:
2970 return self.pool.get('account.journal').read(cr, uid, ids[0], ['default_credit_account_id'], context=context)['default_credit_account_id']
2971 return []
2972
2973 def _get_debit_account(self, cr, uid, context=None):
2974 if context is None:
2975 context = {}
2976 ids = context.get('active_ids', False)
2977 if ids and len(ids) == 1:
2978 return self.pool.get('account.journal').read(cr, uid, ids[0], ['default_debit_account_id'], context=context)['default_debit_account_id']
2979 return []
2980
2981
2982 _columns = {
2983 'journal_id': fields.many2one('account.journal', string="Current journal"),
2984 'journal_type': fields.char("Current Journal Type", size=32),
2985 'debit_account_id': fields.many2one('account.account', 'Debit account'),
2986 'credit_account_id': fields.many2one('account.account', 'Credit account'),
2987 'is_current_instance': fields.boolean('Is current instance?'),
2988
2989 }
2990 _defaults = {
2991 'journal_id': _get_journal,
2992 'journal_type': _get_journal_type,
2993 'debit_account_id': _get_debit_account,
2994 'credit_account_id': _get_credit_account,
2995 'is_current_instance': _get_instance,
2996 }
2997
2998 def journal_change_account(self, cr, uid, ids, context=None):
2999 '''
3000 US-11269: Modify the default debit or credit account of the journal
3001 '''
3002 if context is None:
3003 context = {}
3004 journ_obj = self.pool.get('account.journal')
3005 active_ids = context.get('active_ids', False)
3006 if active_ids:
3007 debit_id = self.read(cr, uid, ids, ['debit_account_id'])[0]['debit_account_id']
3008 credit_id = self.read(cr, uid, ids, ['credit_account_id'])[0]['credit_account_id']
3009 if debit_id:
3010 journ_obj.write(cr, uid, active_ids, {'default_debit_account_id': debit_id}, context=context)
3011 if credit_id:
3012 journ_obj.write(cr, uid, active_ids, {'default_credit_account_id': credit_id}, context=context)
3013 return {'type': 'ir.actions.act_window_close'}
3014
3015
3016journal_change_account()
3017
2942# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:3018# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
29433019
=== modified file 'bin/addons/account/account_view.xml'
--- bin/addons/account/account_view.xml 2023-12-15 14:14:31 +0000
+++ bin/addons/account/account_view.xml 2024-02-05 12:55:03 +0000
@@ -2248,6 +2248,53 @@
2248 res_model="account.move.line"2248 res_model="account.move.line"
2249 src_model="account.journal"/>2249 src_model="account.journal"/>
22502250
2251 <record model="ir.ui.view" id="wizard_change_account_code">
2252 <field name="name">wizard.change.account.code.form</field>
2253 <field name="model">journal.change.account</field>
2254 <field name="type">form</field>
2255 <field name="arch" type="xml">
2256 <form string="Change Account - Wizard">
2257 <separator string="Wizard to modify the debit/credit accounts of current journal"/>
2258 <separator string="Current journal" colspan="2" />
2259 <newline />
2260 <field name="journal_id" nolabel="1" readonly="1" colspan="2"/>
2261 <field name="journal_type" invisible="1"/>
2262 <newline />
2263 <separator string="Change Default Debit Account" colspan="2" />
2264 <separator string="Change Default Credit Account" colspan="2" />
2265 <newline />
2266 <field name="is_current_instance" invisible="1"/>
2267 <field name="debit_account_id" domain="[('type','!=','view'), ('cash_domain', '=', journal_type)]"
2268 attrs="{'readonly': [('is_current_instance', '!=', True)]}" colspan="2">
2269 <tree>
2270 <field name="name"/>
2271 </tree>
2272 </field>
2273 <field name="credit_account_id" domain="[('type','!=','view'), ('cash_domain', '=', journal_type)]"
2274 attrs="{'readonly': [('is_current_instance', '!=', True)]}" colspan="2">
2275 <tree>
2276 <field name="name"/>
2277 </tree>
2278 </field>
2279 <newline />
2280 <group colspan="4">
2281 <button string="Cancel" special="cancel" icon="gtk-cancel" />
2282 <button string="Confirm" icon="terp-check" name="journal_change_account" attrs="{'readonly': [('is_current_instance', '!=', True)]}" type="object"/>
2283 </group>
2284 </form>
2285 </field>
2286 </record>
2287
2288 <act_window
2289 id="act_change_account_code"
2290 name="Change default journal accounts"
2291 res_model="journal.change.account"
2292 src_model="account.journal"
2293 key2="client_action_multi"
2294 view_mode="form"
2295 view_type="form"
2296 target="new" />
2297
2251 <act_window context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id]}" domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner" groups="base.group_extended"/>2298 <act_window context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id]}" domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner" groups="base.group_extended"/>
22522299
2253 <act_window context="{'search_default_partner_id':[active_id]}" id="act_account_partner_account_move" name="Journal Items" res_model="account.move.line" src_model="res.partner" groups="account.group_account_user"/>2300 <act_window context="{'search_default_partner_id':[active_id]}" id="act_account_partner_account_move" name="Journal Items" res_model="account.move.line" src_model="res.partner" groups="account.group_account_user"/>
22542301
=== modified file 'bin/addons/account_journal/account_journal.py'
--- bin/addons/account_journal/account_journal.py 2023-11-03 15:04:29 +0000
+++ bin/addons/account_journal/account_journal.py 2024-02-05 12:55:03 +0000
@@ -72,6 +72,19 @@
72 res[id] = bool(count_entries(id))72 res[id] = bool(count_entries(id))
73 return res73 return res
7474
75 def _get_has_non_draft_register(self, cr, uid, ids, field_name, arg, context=None):
76 def has_non_draft_reg(journal_id):
77 return abs_obj.search(cr, uid, [('journal_id', '=', journal_id), ('state', '!=', 'draft')], limit=1, context=context)
78 res = {}
79 if not ids:
80 return res
81 abs_obj = self.pool.get('account.bank.statement')
82 if isinstance(ids, int):
83 ids = [ids]
84 for id in ids:
85 res[id] = bool(has_non_draft_reg(id))
86 return res
87
75 _columns = {88 _columns = {
76 'type': fields.selection(get_journal_type, 'Type', size=32, required=True, select=1),89 'type': fields.selection(get_journal_type, 'Type', size=32, required=True, select=1),
77 'code': fields.char('Code', size=10, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),90 'code': fields.char('Code', size=10, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),
@@ -79,6 +92,7 @@
79 domain="[('type', '=', 'bank'), ('currency', '=', currency), ('is_active', '=', True)]"),92 domain="[('type', '=', 'bank'), ('currency', '=', currency), ('is_active', '=', True)]"),
80 'cheque_journal_id': fields.one2many('account.journal', 'bank_journal_id', 'Linked cheque'),93 'cheque_journal_id': fields.one2many('account.journal', 'bank_journal_id', 'Linked cheque'),
81 'has_entries': fields.function(_get_has_entries, type='boolean', method=True, string='Has journal entries'),94 'has_entries': fields.function(_get_has_entries, type='boolean', method=True, string='Has journal entries'),
95 'has_non_draft_register': fields.function(_get_has_non_draft_register, type='boolean', method=True, string='Has non-draft register'),
82 }96 }
8397
84 _defaults = {98 _defaults = {
8599
=== modified file 'bin/addons/account_journal/account_journal_view.xml'
--- bin/addons/account_journal/account_journal_view.xml 2022-10-05 14:08:57 +0000
+++ bin/addons/account_journal/account_journal_view.xml 2024-02-05 12:55:03 +0000
@@ -15,6 +15,7 @@
15 <field name="is_current_instance" invisible="1"/>15 <field name="is_current_instance" invisible="1"/>
16 <field name="is_coordo_editable" invisible="1"/>16 <field name="is_coordo_editable" invisible="1"/>
17 <field name="has_entries" invisible="1"/>17 <field name="has_entries" invisible="1"/>
18 <field name="has_non_draft_register" invisible="1"/>
18 <field name="name" select="1"/>19 <field name="name" select="1"/>
19 <field name="code" select="1"20 <field name="code" select="1"
20 attrs="{'readonly': [('has_entries', '=', True)]}"/>21 attrs="{'readonly': [('has_entries', '=', True)]}"/>
@@ -26,9 +27,9 @@
26 <group col="2" colspan="2">27 <group col="2" colspan="2">
27 <separator string="Accounts" colspan="4"/>28 <separator string="Accounts" colspan="4"/>
28 <field name="default_debit_account_id" domain="[('type','&lt;&gt;','view'), ('cash_domain', '=', type)]"29 <field name="default_debit_account_id" domain="[('type','&lt;&gt;','view'), ('cash_domain', '=', type)]"
29 attrs="{'required': [('type', 'in', ('cash', 'bank', 'cheque', 'cur_adj'))]}"/>30 attrs="{'required': [('type', 'in', ('cash', 'bank', 'cheque', 'cur_adj'))], 'readonly': [('type', 'in', ('cash', 'bank', 'cheque', 'cur_adj')), ('has_non_draft_register', '=', True)]}"/>
30 <field name="default_credit_account_id" domain="[('type','&lt;&gt;','view'), ('cash_domain', '=', type)]"31 <field name="default_credit_account_id" domain="[('type','&lt;&gt;','view'), ('cash_domain', '=', type)]"
31 attrs="{'required': [('type', 'in', ('cash', 'bank', 'cheque', 'cur_adj'))]}"/>32 attrs="{'required': [('type', 'in', ('cash', 'bank', 'cheque', 'cur_adj'))], 'readonly': [('type', 'in', ('cash', 'bank', 'cheque', 'cur_adj')), ('has_non_draft_register', '=', True)]}"/>
32 </group>33 </group>
33 <group colspan="2" col="2">34 <group colspan="2" col="2">
34 <separator string="Company" colspan="4"/>35 <separator string="Company" colspan="4"/>
3536
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2024-01-17 13:57:19 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2024-02-05 12:55:03 +0000
@@ -3377,10 +3377,11 @@
3377msgid "Transport cost :"3377msgid "Transport cost :"
3378msgstr "Coût du Transport :"3378msgstr "Coût du Transport :"
33793379
3380#. module: product_asset, account_period_closing_level3380#. module: product_asset, account_period_closing_level, account
3381#: model:ir.ui.menu,name:product_asset.menu_asset_sales3381#: model:ir.ui.menu,name:product_asset.menu_asset_sales
3382#: model:ir.ui.menu,name:product_asset.asset_configuration3382#: model:ir.ui.menu,name:product_asset.asset_configuration
3383#: view:account.period:03383#: view:account.period:0
3384#: view:account.account:0
3384msgid "Assets"3385msgid "Assets"
3385msgstr "Immobilisations"3386msgstr "Immobilisations"
33863387
@@ -36469,6 +36470,7 @@
36469#: view:modify.responsible:036470#: view:modify.responsible:0
36470#: view:signature.add_user.wizard:036471#: view:signature.add_user.wizard:0
36471#: view:signature.change_date:036472#: view:signature.change_date:0
36473#: view:journal.change.account:0
36472msgid "Confirm"36474msgid "Confirm"
36473msgstr "Confirmer"36475msgstr "Confirmer"
3647436476
@@ -48880,6 +48882,7 @@
48880#: report:addons/account/report/invoice_excel_export.mako:7048882#: report:addons/account/report/invoice_excel_export.mako:70
48881#: model:product.uom.categ,name:msf_profile.uom_category_percentage48883#: model:product.uom.categ,name:msf_profile.uom_category_percentage
48882#: code:addons/msf_doc_import/report/export_po_ad_line_xlsx.py:4348884#: code:addons/msf_doc_import/report/export_po_ad_line_xlsx.py:43
48885#: report:addons/account/report/export_invoice.mako:146
48883msgid "Percentage"48886msgid "Percentage"
48884msgstr "Pourcentage"48887msgstr "Pourcentage"
4888548888
@@ -96635,6 +96638,7 @@
96635#: view:product.asset.disposal:096638#: view:product.asset.disposal:0
96636#: selection:product.asset.event,asset_state:096639#: selection:product.asset.event,asset_state:0
96637#: view:product.asset.generate.entries:096640#: view:product.asset.generate.entries:0
96641#: view:journal.change.account:0
96638#, python-format96642#, python-format
96639msgid "Cancel"96643msgid "Cancel"
96640msgstr "Annuler"96644msgstr "Annuler"
@@ -119691,6 +119695,7 @@
119691119695
119692#. module: register_accounting, account119696#. module: register_accounting, account
119693#: field:account.move.line,counterpart_transfer_st_line_id:0119697#: field:account.move.line,counterpart_transfer_st_line_id:0
119698#: selection:account.journal.column,field:0
119694msgid "Conterpart transfert register line"119699msgid "Conterpart transfert register line"
119695msgstr "Line de registre de la contrepartie de transfert"119700msgstr "Line de registre de la contrepartie de transfert"
119696119701
@@ -119749,6 +119754,7 @@
119749#. module: register_accounting, account119754#. module: register_accounting, account
119750#: field:account.bank.statement.line,has_a_counterpart_transfer:0119755#: field:account.bank.statement.line,has_a_counterpart_transfer:0
119751#: field:account.move.line,has_a_counterpart_transfer:0119756#: field:account.move.line,has_a_counterpart_transfer:0
119757#: selection:account.journal.column,field:0
119752msgid "Has a counterpart_transfer"119758msgid "Has a counterpart_transfer"
119753msgstr "A une contrepartie de transfert"119759msgstr "A une contrepartie de transfert"
119754119760
@@ -119807,6 +119813,7 @@
119807#: report:addons/account_mcdb/report/report_account_analytic_line_xls.mako:72119813#: report:addons/account_mcdb/report/report_account_analytic_line_xls.mako:72
119808#: report:addons/account_mcdb/report/report_account_move_line_xls.mako:61119814#: report:addons/account_mcdb/report/report_account_move_line_xls.mako:61
119809#: report:combined.journals.report.pdf:0119815#: report:combined.journals.report.pdf:0
119816#: selection:account.journal.column,field:0
119810msgid "HQ System Account"119817msgid "HQ System Account"
119811msgstr "Compte Système HQ"119818msgstr "Compte Système HQ"
119812119819
@@ -119936,6 +119943,7 @@
119936#. module: register_accounting, account119943#. module: register_accounting, account
119937#: field:account.bank.statement.line,counterpart_transfer_st_line_sdref:0119944#: field:account.bank.statement.line,counterpart_transfer_st_line_sdref:0
119938#: field:account.move.line,counterpart_transfer_st_line_sdref:0119945#: field:account.move.line,counterpart_transfer_st_line_sdref:0
119946#: selection:account.journal.column,field:0
119939msgid "St couterpert line sdref"119947msgid "St couterpert line sdref"
119940msgstr "Sdref de le ligne de reg. de cp"119948msgstr "Sdref de le ligne de reg. de cp"
119941119949
@@ -121276,6 +121284,7 @@
121276121284
121277#. module: account121285#. module: account
121278#: field:account.move.line,asset_line_id:0121286#: field:account.move.line,asset_line_id:0
121287#: selection:account.journal.column,field:0
121279msgid "Asset Line"121288msgid "Asset Line"
121280msgstr "Ligne d'amortissement"121289msgstr "Ligne d'amortissement"
121281121290
@@ -121489,6 +121498,7 @@
121489#, python-format121498#, python-format
121490msgid "to open and compute"121499msgid "to open and compute"
121491msgstr "à ouvrir et générer"121500msgstr "à ouvrir et générer"
121501<<<<<<< TREE
121492121502
121493#. module: account_override121503#. module: account_override
121494#: model:ir.actions.act_window,name:account_override.action_inkind_donation121504#: model:ir.actions.act_window,name:account_override.action_inkind_donation
@@ -121631,3 +121641,56 @@
121631#, python-format121641#, python-format
121632msgid "This record is not linked to any Picking."121642msgid "This record is not linked to any Picking."
121633msgstr "Cet enregistrement n'est lié à aucun Picking. "121643msgstr "Cet enregistrement n'est lié à aucun Picking. "
121644=======
121645
121646#. module: account
121647#: view:journal.change.account:0
121648msgid "Change Account - Wizard"
121649msgstr "Assistant de changement de comptes par défaut"
121650
121651#. module: account
121652#: view:journal.change.account:0
121653msgid "Change Default Credit Account"
121654msgstr "Changer le compte de crédit par défaut"
121655
121656#. module: account
121657#: view:journal.change.account:0
121658msgid "Change Default Debit Account"
121659msgstr "Changer le compte de débit par défaut"
121660
121661#. module: account
121662#: model:ir.actions.act_window,name:account.act_change_account_code
121663msgid "Change default journal accounts"
121664msgstr "Changer les comptes par défaut du journal"
121665
121666#. module: account
121667#: field:journal.change.account,credit_account_id:0
121668msgid "Credit account"
121669msgstr "Compte de crédit"
121670
121671#. module: account
121672#: field:journal.change.account,journal_type:0
121673msgid "Current Journal Type"
121674msgstr "Type du journal actuel"
121675
121676#. module: account
121677#: view:journal.change.account:0
121678#: field:journal.change.account,journal_id:0
121679msgid "Current journal"
121680msgstr "Journal actuel"
121681
121682#. module: account
121683#: field:journal.change.account,debit_account_id:0
121684msgid "Debit account"
121685msgstr "Compte de débit"
121686
121687#. module: account
121688#: field:journal.change.account,is_current_instance:0
121689msgid "Is current instance?"
121690msgstr "A été créé dans l'instance actuelle?"
121691
121692#. module: account
121693#: view:journal.change.account:0
121694msgid "Wizard to modify the debit/credit accounts of current journal"
121695msgstr "Assistant pour modifier les comptes de débit/crédit par défaut du journal actuel"
121696>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches