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

Proposed by jftempo
Status: Merged
Merged at revision: 5092
Proposed branch: lp:~julie-w/unifield-server/US-5116
Merge into: lp:unifield-server
Diff against target: 101 lines (+26/-1)
5 files modified
bin/addons/account/account_move_line.py (+15/-0)
bin/addons/account_override/account_analytic_line.py (+4/-0)
bin/addons/finance/account_analytic_line_view.xml (+2/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+4/-1)
bin/addons/res_currency_functional/account_move_line_view.xml (+1/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5116
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+355429@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
1=== modified file 'bin/addons/account/account_move_line.py'
2--- bin/addons/account/account_move_line.py 2018-04-27 09:58:55 +0000
3+++ bin/addons/account/account_move_line.py 2018-09-20 14:23:18 +0000
4@@ -445,6 +445,19 @@
5 res[line_id] = (invoice_id, invoice_names[invoice_id])
6 return res
7
8+ def _get_purchase_order_id(self, cr, uid, ids, name, arg, context=None):
9+ """
10+ Returns a dict with key = id of the JI, and value = id of the related PO,
11+ in case the JI is linked to an invoice which is linked to a PO
12+ """
13+ if context is None:
14+ context = {}
15+ res = {}
16+ for aml in self.browse(cr, uid, ids, fields_to_fetch=['invoice'], context=context):
17+ po = aml.invoice and aml.invoice.purchase_ids and aml.invoice.purchase_ids[0] # only one PO can be linked to an SI
18+ res[aml.id] = po and po.id or False
19+ return res
20+
21 def name_get(self, cr, uid, ids, context=None):
22 if not ids:
23 return []
24@@ -563,6 +576,8 @@
25 "this field will contain the basic amount(without tax)."),
26 'invoice': fields.function(_invoice, method=True, string='Invoice',
27 type='many2one', relation='account.invoice', fnct_search=_invoice_search),
28+ 'purchase_order_id': fields.function(_get_purchase_order_id, method=True, string='Purchase Order',
29+ type='many2one', relation='purchase.order', readonly=True, store=False),
30 'account_tax_id':fields.many2one('account.tax', 'Tax'),
31 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account'),
32 #TODO: remove this
33
34=== modified file 'bin/addons/account_override/account_analytic_line.py'
35--- bin/addons/account_override/account_analytic_line.py 2014-04-07 16:30:45 +0000
36+++ bin/addons/account_override/account_analytic_line.py 2018-09-20 14:23:18 +0000
37@@ -53,6 +53,10 @@
38 'journal_id': fields.many2one('account.analytic.journal', 'Journal Code', required=True, ondelete='restrict', select=True, readonly=True),
39 'journal_type': fields.related('journal_id', 'type', 'Journal type', readonly=True),
40 'move_id': fields.many2one('account.move.line', 'Entry Sequence', ondelete='restrict', select=True, readonly=True, domain="[('account_id.user_type.code', 'in', ['expense', 'income'])]"), # UF-1719: Domain added for search view
41+ 'invoice_id': fields.related('move_id', 'invoice', type='many2one', relation='account.invoice',
42+ string='Invoice', readonly=True, store=False),
43+ 'purchase_order_id': fields.related('move_id', 'purchase_order_id', type='many2one', relation='purchase.order',
44+ string='Purchase Order', readonly=True, store=False),
45 }
46
47 account_analytic_line()
48
49=== modified file 'bin/addons/finance/account_analytic_line_view.xml'
50--- bin/addons/finance/account_analytic_line_view.xml 2016-02-24 10:22:18 +0000
51+++ bin/addons/finance/account_analytic_line_view.xml 2018-09-20 14:23:18 +0000
52@@ -66,6 +66,8 @@
53 <field name="move_id"/>
54 <field name="is_reversal" readonly="True"/>
55 <field name="reversal_origin"/>
56+ <field name="invoice_id" invisible="1"/>
57+ <field name="purchase_order_id" invisible="1"/>
58 </group>
59 </group>
60 </form>
61
62=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
63--- bin/addons/msf_profile/i18n/fr_MF.po 2018-09-03 09:00:00 +0000
64+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-09-20 14:23:18 +0000
65@@ -75022,6 +75022,7 @@
66 #: field:wizard.import.cheque.lines,line_id:0
67 #: field:wizard.invoice.date,invoice_id:0
68 #: field:wizard.invoice.line,invoice_id:0
69+#: field:account.analytic.line,invoice_id:0
70 #: report:allocation.invoices.report:0
71 #: selection:res.request,ref_doc1:0
72 #: selection:res.request,ref_doc2:0
73@@ -83984,7 +83985,7 @@
74 msgid "L2"
75 msgstr "L2"
76
77-#. modules: tender_flow, purchase_allocation_report, return_claim, order_line_number, msf_doc_import, analytic_distribution, finance, sales_followup, service_purchasing, purchase_override, specific_rules, base, delete_button, res_currency_functional, msf_cross_docking, purchase, register_accounting, documents_done, sale, transport_mgmt, procurement, sourcing, msf_audittrail, sync_so, msf_tools
78+#. modules: tender_flow, purchase_allocation_report, return_claim, order_line_number, msf_doc_import, analytic_distribution, finance, sales_followup, service_purchasing, purchase_override, specific_rules, base, delete_button, res_currency_functional, msf_cross_docking, purchase, register_accounting, documents_done, sale, transport_mgmt, procurement, sourcing, msf_audittrail, sync_so, msf_tools, account_override, account
79 #: field:analytic.distribution.wizard,purchase_id:0
80 #: selection:res.request,ref_doc1:0
81 #: selection:res.request,ref_doc2:0
82@@ -84038,6 +84039,8 @@
83 #: model:process.node,name:tender_flow.process_node_tender_po
84 #: model:ir.model,name:transport_mgmt.model_purchase_order
85 #: field:automated.import.files.available,po_id:0
86+#: field:account.move.line,purchase_order_id:0
87+#: field:account.analytic.line,purchase_order_id:0
88 msgid "Purchase Order"
89 msgstr "Bon de Commande"
90
91
92=== modified file 'bin/addons/res_currency_functional/account_move_line_view.xml'
93--- bin/addons/res_currency_functional/account_move_line_view.xml 2018-08-16 12:38:52 +0000
94+++ bin/addons/res_currency_functional/account_move_line_view.xml 2018-09-20 14:23:18 +0000
95@@ -67,6 +67,7 @@
96 <field name="revaluation_reference" invisible="1"/>
97 <field name="revaluation_date" invisible="1"/>
98 <field name="invoice" invisible="1"/>
99+ <field name="purchase_order_id" invisible="1"/>
100 <field name="cheque_number" invisible="1"/>
101 </group>
102

Subscribers

People subscribed via source and target branches