Merge lp:~therp-nl/therp-addons/7.0-fetchmail_inbox-nits into lp:~therp-nl/therp-addons/7.0-fetchmail_inbox

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 105
Proposed branch: lp:~therp-nl/therp-addons/7.0-fetchmail_inbox-nits
Merge into: lp:~therp-nl/therp-addons/7.0-fetchmail_inbox
Diff against target: 47 lines (+10/-8)
3 files modified
fetchmail_inbox_invoice/security/ir.model.access.csv (+1/-1)
fetchmail_inbox_invoice/view/menu.xml (+3/-3)
fetchmail_inbox_invoice/wizard/fetchmail_inbox_attach_existing_wizard.py (+6/-4)
To merge this branch: bzr merge lp:~therp-nl/therp-addons/7.0-fetchmail_inbox-nits
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Review via email: mp+201670@code.launchpad.net

Description of the change

- Changing the permissions to suit the use by accountants by default.
- Move to payables menu as we expect supplier invoices
- Prevent a browse null record ending up in context when no author id
- Filter on incoming invoices when selecting an existing resource

To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'fetchmail_inbox_invoice/security/ir.model.access.csv'
2--- fetchmail_inbox_invoice/security/ir.model.access.csv 2014-01-03 15:42:23 +0000
3+++ fetchmail_inbox_invoice/security/ir.model.access.csv 2014-01-14 20:46:40 +0000
4@@ -1,2 +1,2 @@
5 "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
6-crud_fetchmail_inbox_invoice,CRUD fetchmail inbox invoice,model_fetchmail_inbox_invoice,fetchmail_inbox.group_fetchmail_inbox_manager,1,1,1,1
7+crud_fetchmail_inbox_invoice,CRUD fetchmail inbox invoice,model_fetchmail_inbox_invoice,account.group_account_user,1,1,1,1
8
9=== modified file 'fetchmail_inbox_invoice/view/menu.xml'
10--- fetchmail_inbox_invoice/view/menu.xml 2014-01-03 15:42:23 +0000
11+++ fetchmail_inbox_invoice/view/menu.xml 2014-01-14 20:46:40 +0000
12@@ -6,13 +6,13 @@
13 view_mode="tree,form"
14 domain="[('model', '=', 'fetchmail.inbox.invoice')]"
15 context="{'default_res_model': 'account.invoice'}"
16- name="Fetchmail inbox"
17+ name="Invoices per mail"
18 view_id="fetchmail_inbox.tree_mail_message_fetchmail_inbox"
19 />
20 <menuitem id="menu_inbox"
21 action="action_inbox"
22- parent="account.menu_finance_receivables"
23- groups="fetchmail_inbox.group_fetchmail_inbox_manager"
24+ parent="account.menu_finance_payables"
25+ groups="account.group_account_user"
26 />
27 </data>
28 </openerp>
29
30=== modified file 'fetchmail_inbox_invoice/wizard/fetchmail_inbox_attach_existing_wizard.py'
31--- fetchmail_inbox_invoice/wizard/fetchmail_inbox_attach_existing_wizard.py 2014-01-14 11:57:05 +0000
32+++ fetchmail_inbox_invoice/wizard/fetchmail_inbox_attach_existing_wizard.py 2014-01-14 20:46:40 +0000
33@@ -33,8 +33,10 @@
34 context.get('default_res_model') == 'account.invoice':
35 mail = self.pool.get('mail.message').browse(
36 cr, user, context.get('default_mail_id'), context=context)
37- result['fields']['res_id']['context'].update(
38- search_default_partner_id=mail.author_id and
39- (mail.author_id.commercial_partner_id.id
40- or mail.author_id.id))
41+ result['fields']['res_id']['domain'] = [
42+ ('type', 'in', ('in_invoice', 'in_refund'))]
43+ if mail.author_id:
44+ result['fields']['res_id']['context'].update(
45+ search_default_partner_id=\
46+ mail.author_id.commercial_partner_id.id)
47 return result

Subscribers

People subscribed via source and target branches

to all changes: