Merge lp:~openerp-dev/openobject-addons/7.0-fix-contact-company-handling into lp:openobject-addons/7.0
- 7.0-fix-contact-company-handling
- Merge into 7.0
Status: | Merged |
---|---|
Merged at revision: | 9043 |
Proposed branch: | lp:~openerp-dev/openobject-addons/7.0-fix-contact-company-handling |
Merge into: | lp:openobject-addons/7.0 |
Diff against target: |
1086 lines (+408/-62) 48 files modified
account/account_invoice.py (+7/-7) account/account_invoice_view.xml (+4/-3) account/partner.py (+5/-0) account/partner_view.xml (+6/-1) account/project/project_view.xml (+1/-1) account_analytic_analysis/account_analytic_analysis_view.xml (+1/-1) account_asset/account_asset_view.xml (+1/-1) account_asset/report/account_asset_report_view.xml (+1/-1) account_report_company/__init__.py (+25/-0) account_report_company/__openerp__.py (+57/-0) account_report_company/account_invoice_view.xml (+24/-0) account_report_company/account_report_company.py (+51/-0) account_report_company/report/__init__.py (+24/-0) account_report_company/report/account_invoice_report.py (+36/-0) account_report_company/report/account_invoice_report_view.xml (+24/-0) account_report_company/res_partner_view.xml (+24/-0) account_voucher/account_voucher_view.xml (+1/-1) account_voucher/voucher_payment_receipt_view.xml (+2/-2) account_voucher/voucher_sales_purchase_view.xml (+2/-2) base_vat/base_vat.py (+3/-0) crm/crm_lead_view.xml (+2/-2) crm/crm_phonecall_view.xml (+1/-1) crm/report/crm_lead_report_view.xml (+1/-1) crm/report/crm_phonecall_report_view.xml (+1/-1) crm_claim/crm_claim_view.xml (+1/-1) crm_claim/report/crm_claim_report_view.xml (+1/-1) crm_helpdesk/crm_helpdesk_view.xml (+1/-1) crm_helpdesk/report/crm_helpdesk_report_view.xml (+1/-0) l10n_be_invoice_bba/partner.py (+5/-0) l10n_ro/res_partner.py (+25/-2) mrp_repair/mrp_repair_view.xml (+1/-1) product/partner.py (+3/-0) product/partner_view.xml (+4/-1) project/project_view.xml (+1/-1) project/report/project_report_view.xml (+1/-1) project_issue/project_issue_view.xml (+2/-1) project_issue/report/project_issue_report_view.xml (+1/-1) purchase/partner.py (+3/-0) purchase/purchase_view.xml (+3/-3) sale/res_partner_view.xml (+28/-8) sale/sale.py (+0/-4) sale/sale_view.xml (+4/-4) sale_journal/sale_journal.py (+4/-0) sale_journal/sale_journal_view.xml (+1/-1) sale_stock/stock.py (+1/-1) sale_stock/test/picking_order_policy.yml (+8/-2) stock/report/report_stock_move_view.xml (+1/-1) stock/stock_view.xml (+4/-2) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/7.0-fix-contact-company-handling |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nhomar - Vauxoo (community) | Needs Fixing | ||
Joël Grand-Guillaume @ camptocamp (community) | test, no code review | Needs Fixing | |
Stefan Rijnhart (Opener) (community) | Disapprove | ||
OpenERP Core Team | Pending | ||
Review via email: mp+157576@code.launchpad.net |
Commit message
Description of the change
This branch contains the specific addons changes that are necessary to implement all parts of the solution described on bug 1160365. It depends on the changes brought by lp:~openerp-dev/openobject-server/7.0-fix-contact-company-handling in the `base` module.
More specifically it contains:
- module-specific overrides of _commercial_
- corresponding changes to inherited views of res.partner form to hide these commercial fields when they are in fact "related fields" of their parent commercial entity. This mainly concerns 2 sections of the Partner form: the whole Accounting tab, and the bottom of the Sales&Purchase tabs with the pricelists and invoicing fields. These sections are replaced by a short message and a button to open the commercial entity to view/edit the fields. [Part B of the solution]
- a few fixes to properly delegate the resolution of various contact/address types to the corrected res.partner.
- [REVERTED on 2013-04-11] a change of the domain for the `partner_id` field on invoices so that it only allows selecting commercial entities when creating invoices manually (in addition to the `supplier` or `customer` flag depending on the invoice type)
- changes to search views of the main business documents so that searching for a company name will also match its contacts [Part E of the solution]
- a fix of the _find_accountin
# UPDATE 2013-04-11:
- revert the modified domain set on the partner field of Invoices - this was inconsistent with the rest of the system: it must be possible to invoice a contact everywhere
- change inherited partner form view in sale module to hide `use_parent_
- fix issue detected by Joël Grand-Guillaume in comment #34 of bug 1160365: when invoicing after delivery, the invoicing contact/address must be used rather than the main customer. Tests updated accordingly.
- add new 7.0 module "account_
Note: a series of important changes were done on the server branch as well, see updated description on https:/
# UPDATE 2013-04-20:
- fixed unique constraints definition on some commercial fields on res.partner (l10n_ro)
- renamed fields pointing to commercial entity to `commercial_
- improve group_by issues on all models by adding a new stored function field `display_name` on res.partner that contains the name_get() result in the form "ACME, John Doe" and set it as the default _order for res.partner. This ensures that group_by entries for the same company will always be next to each other on all documents: "ACME" is directly followed by "ACME, John Doe", "ACME, John Anderson", etc. This field also replaces the `name` field in the list and kanban views of Partners, so that the display order matches the display labels.
- fixed remaining search views where Partner search should have been using the "child of" operator to match contacts (Analysis views too):
- Analytic Accounts
- Assets
- CRM Leads, Opportunities, Phone Calls
- CRM Claims
- CRM Helpdesk
- MRP Repairs
- Projects
- Project Issues
- Stock Pickings
- Vouchers (somes search views had not been fixed yet)
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : | # |
Stefan Rijnhart (Opener) (stefan-opener) wrote : | # |
We favour the approach of having a link between business documents and both company partner (partner_id) and contact partner (contact_id), and not having to copy the financial data from company partners to its contacts. See the comments by Raphaël Valyi and others on the bug discussion thread.
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : | # |
Forbid to set it as "Need fixing", refer to this post for details:
https:/
Olivier Dony (Odoo) (odo-openerp) wrote : | # |
Thanks everyone for the tests and feedback. The branch has just been updated with 3 main changes (see updated description):
- revert the modified domain set on the partner field of Invoices - this was inconsistent with the rest of the system: it must be possible to invoice a contact everywhere.
- fix issue detected by Joël Grand-Guillaume in comment #34 of bug 1160365: when invoicing after delivery, the invoicing contact/address must be used rather than the main customer. Tests updated accordingly.
- add new 7.0 module "account_
Concerning the first item, please note that Fabien's explanation in comment #50 was incorrect because we want to be able to create invoices for any contact. What happens is that you can configure the contact type on your partners so that the correct "invoice contact/department" is automatically selected regardless of the contact to which you sell. But you can still manually invoice any contact and the rest of the accounting flows will still be correct (and the reporting too)
I'll try to answer other specific questions asked by people who commented on both merge proposals in further comments.
Nhomar - Vauxoo (nhomar) wrote : | # |
Hello Oliver.
My comments about views and mixed modules like sales and purchase in this case the sale module brake what you make in accounting.
See the video for more info.
2 Main points here:
1.- The vie on create a contact is broken.
2.- One improve in term of the meaning of the is_company == True field by default and the Customer and Supplier menu.
http://
Regards.
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : | # |
Hi Olivier,
For what I've tested today, and from a functional point of view here, it remains one big issue (may be miss some still...) : all the group by features.
I don't know if you think about providing a new module (same feature than you did for invoice) for other objects ? At least on invoices (and accounting entries but that was already mostly ok), it works as expected.
So I suggest that you take care of the following objects as well here (as this was the default behavior in 6.1, and we agree this wouldn't have to change for the end user):
- PO (group by "supplier" should group on commercial entity by default here)
- SO (group by "customer" should group on commercial entity by default here)
- Analytic Account (group by "Associated partner" should group on commercial entity here)
- Project (IMO here, it may be interesting to have both contact and commercial_
- Opportunity (group by "customer" should group on commercial entity by default here)
- Repair order (group by "partner" should group on commercial entity by default here)
Special cases:
--------------
- Lead :
Make a lead on Agrolait, and one on Michel Fletcher (Agrolait). On the Michel one, you see:
Company Name : Michel Fletcher
Customer : Agrolait, Michel Fletcher
Group by "Customer" show 2 occurrence: one for Agrolait, one for Michel. No way to group them all in one occurrence which will be honestly asked by everyone. I would like to see a way to group by commercial entity here as well. IMO we can fulfill "Company Name" of the lead with the commercial entity and add a "group by" on it. In any case, as it was in 6.1, I want to be able to group on the commercial entity.
- Incomming shipment and Delivery Order : no group by here by default, but making to incoming shipment for Agrolait and one on Michel Fletcher (Agrolait), I would expect I can at least search on "Agrolait" and find all picking related to them. Not finding them is really sad...
That's all for today ;)
Regards,
Joël
Olivier Dony (Odoo) (odo-openerp) wrote : | # |
On 2013-04-16, Nhomar wrote:
> 2 Main points here:
>
> 1.- The view on create a contact is broken.
Thanks for the tests and feedback!
In your video you mention 2 issues regarding contact creation. They're not bugs but they certainly deserve an explanation:
A) The fact that 'use parent address' and 'address type' fields are hidden after installing Sales
This is the expected behavior, although I agree it needs to be improved in the future. The idea is: both the "use company address" flag and the "address type" are advanced features that are not needed by all users, and are meant to be hidden by default. The "contact/address type" only makes sense in combination with multiple partner fields on Sales Orders. The "use company address" makes the address fields readonly on contacts so it is more complicated to edit addresses, and only useful when users require strict synchronization of the addresses.
In 7.0 these features are currently enabled by checking the "Allow a different address for delivery and invoicing" option in the Sales Settings (under Quotations and Sales Orders / Customer Features), which also makes the extra partner fields visible on Sales Orders. For various reasons these features are in `base` but the option to hide/show them is in the sale (actually sale_stock) module, and it was chosen to keep them visible until `sale` is installed.
So just enable this settings and you will see what you expect when editing contacts.
B) The fact that when you create the first contact for a company, the address is copied to the company.
This is done on purpose but only when the company has *no other contact* and *no address* yet. No copy will happen later or in other cases. The goal is to be able to create a new Customer with a parent Company on-the-fly while creating a Sales Order in B2B mode. When you use the "Create and Edit..." option in the Customer field of the Sales Order you are likely to type the name of the contact's company without taking the time to fill in the whole company details, and then you'll enter the company address in the contact's details. This is OK but in most cases the address you type is also a valid address for the company, you just don't take the time to fill in all details.
So in this case (new contact with address created for a new company without address) we do 2 things:
- set "is_company" on the company record (via context defaults)
- copy the address fields from contact to company
because that's very likely to be what the user meant.
This avoids having a new company without address and will also mean that new contacts created later for this company will receive the same address via on_change, easing the task of filling in details (remember that the "use company address" feature is advanced and not enabled by default)
> 2.- One improve in term of the meaning of the is_company == True field by
> default and the Customer and Supplier menu.
Really we can't make the "is_company" field default to True because the meaning of "is_company" is meant to be strict: when checked it really means that this partner is a company, not an individual. For B2C the value must *not* be checked on customers, so we must n...
Nhomar - Vauxoo (nhomar) wrote : | # |
Oliver.
About B.
Dont you think the fact of COPY DATA brake all simple Database management rules in the world?
One of the arguments of the new model is "Avoid Data duplication and Inconsistencies".
Page 18 of the Fabiens presentation:
"We just removed redundancies in v6.1 model, e.g. on invoices:"
Do you REALLY think is different redundancy between Partner and Contacts PERFECTLY separated by a DBID than duplicate some Fields?
IMHO in any case, and I repeat, In any case data can be duplicated.
Important:
My sarcastic questions are regarding the fact you are duplicating data, no datamodel itself.
Can i offer to you a more elegant solution? and you will consider that, or you will insist at least ONE more time in duplicate fields?, I make this question my friend because i dont want waste badly my time.
About A.
I really dont understand this, in databases i shown you the hidden fields this option is already selected my friend.
But BTW....
You Install Just Accounting... Field shown.... You Installa a ore advanced module "Sales" .... Fields hidden, I think it is confusing.
Other point my friend you afirm:
=====
both the "use company address" flag and the "address type" are advanced features that are not needed by all users, and are meant to be hidden by default.
=====
At least that you use OpenERP for a .... I dont know event in a Gas Station you need say "THis is the Fiscal address for a Customer".
But the configuration is inconsistent....
Sales depends of account_voucher this of account.... then sales convert in Advanced a Basic feature of a base module :-s I am lost.
More comment comming dude.
Nhomar - Vauxoo (nhomar) wrote : | # |
About A.
I just want to confirm, if we enable, use different addresses on config it works, it is IMHO just a problem with configuration order.
Olivier Dony (Odoo) (odo-openerp) wrote : | # |
On 2013-04-18, Joël Grand-Guillaume wrote:
> For what I've tested today, and from a functional point of view here, it
> remains one big issue (may be miss some still...) : all the group by features.
>
> I don't know if you think about providing a new module (same feature than you
> did for invoice) for other objects ? At least on invoices (and accounting
> entries but that was already mostly ok), it works as expected.
Yes the group by issue is the main problem that remained, and we've now tried to find a way to improve the situation globally, via 2 changes:
- the partner display name (name_get) was changed to "Company, Contact" to make the choice of the company very clear
- this display name name is now also used as the default ordering for res.partner (when account_
This is not a perfect solution but its mitigate the problem and will ensure that results are always consistent when searching/
- in name_search results when trying to choose a partner
- in the list/kanban views of partners
- whenever any list of business documents is ordered by Customers/
- in any view using "group by" res.partner (regular lists and analysis views)
Even if all fields are not directly summed/aggregated together in all cases like for invoices, at least the data will be impossible to miss, e.g:
- Agrolait
- Agrolait, Michel Fletcher
- Agrolait, Thomas Passot
- Axelor
- Axelor, Laith Jubair
- etc.
With this change I think the merge proposals are in a correct state to be merged in the 7.0 branch, and they represent quite an improvement in correctness and usability as compared to the current 7.0, thanks to all the feedback that was provided by everyone.
Then if we notice that this is *really* insufficient for a certain case, we may add another module similar to account_
> - Incomming shipment and Delivery Order : no group by here by default, but
> making to incoming shipment for Agrolait and one on Michel Fletcher
> (Agrolait), I would expect I can at least search on "Agrolait" and find all
> picking related to them. Not finding them is really sad...
For some reason the partner_id field was simply missing from the search view on Incoming Shipments and Delivery Orders, while it was in the one for Internal Moves as well as "Incoming/Outgoing Products".
This has been corrected and the proper field (with child_of operator to match contact) was added to these search views.
A number of remaining relevant search views were also fixed ...
Nhomar - Vauxoo (nhomar) wrote : | # |
About This My friend.
>>>
With this change I think the merge proposals are in a correct state to be merged in the 7.0 branch, and they represent quite an improvement in correctness and usability as compared to the current 7.0, thanks to all the feedback that was provided by everyone.
>>>
Let me tell you something.
If one Vauxoo's programmer for an error of design "Copy" Data for "Useability" Reasons, I send again to University and study DataBase Management. Even Wikipedia Knows :-( http://
The fact that your branch has been tested is not reason enought to be merged, it is not all bad, but i think we need more feedback My friend, for first time in several years with OpenERP i think well not think I am TOTALLY sure this approach is wrong.
Preview Diff
1 | === modified file 'account/account_invoice.py' | |||
2 | --- account/account_invoice.py 2013-03-29 15:59:38 +0000 | |||
3 | +++ account/account_invoice.py 2013-04-20 02:28:27 +0000 | |||
4 | @@ -1260,9 +1260,7 @@ | |||
5 | 1260 | ref = invoice.reference | 1260 | ref = invoice.reference |
6 | 1261 | else: | 1261 | else: |
7 | 1262 | ref = self._convert_ref(cr, uid, invoice.number) | 1262 | ref = self._convert_ref(cr, uid, invoice.number) |
11 | 1263 | partner = invoice.partner_id | 1263 | partner = self.pool['res.partner']._find_accounting_partner(invoice.partner_id) |
9 | 1264 | if partner.parent_id and not partner.is_company: | ||
10 | 1265 | partner = partner.parent_id | ||
12 | 1266 | # Pay attention to the sign for both debit/credit AND amount_currency | 1264 | # Pay attention to the sign for both debit/credit AND amount_currency |
13 | 1267 | l1 = { | 1265 | l1 = { |
14 | 1268 | 'debit': direction * pay_amount>0 and direction * pay_amount, | 1266 | 'debit': direction * pay_amount>0 and direction * pay_amount, |
15 | @@ -1733,15 +1731,17 @@ | |||
16 | 1733 | 'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True), | 1731 | 'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True), |
17 | 1734 | } | 1732 | } |
18 | 1735 | 1733 | ||
20 | 1736 | def _find_accounting_partner(self, part): | 1734 | def _find_accounting_partner(self, partner): |
21 | 1737 | ''' | 1735 | ''' |
22 | 1738 | Find the partner for which the accounting entries will be created | 1736 | Find the partner for which the accounting entries will be created |
23 | 1739 | ''' | 1737 | ''' |
24 | 1738 | # FIXME: after 7.0, to replace by function field partner.commercial_partner_id | ||
25 | 1739 | |||
26 | 1740 | #if the chosen partner is not a company and has a parent company, use the parent for the journal entries | 1740 | #if the chosen partner is not a company and has a parent company, use the parent for the journal entries |
27 | 1741 | #because you want to invoice 'Agrolait, accounting department' but the journal items are for 'Agrolait' | 1741 | #because you want to invoice 'Agrolait, accounting department' but the journal items are for 'Agrolait' |
31 | 1742 | if part.parent_id and not part.is_company: | 1742 | while not partner.is_company and partner.parent_id: |
32 | 1743 | part = part.parent_id | 1743 | partner = partner.parent_id |
33 | 1744 | return part | 1744 | return partner |
34 | 1745 | 1745 | ||
35 | 1746 | def copy(self, cr, uid, id, default=None, context=None): | 1746 | def copy(self, cr, uid, id, default=None, context=None): |
36 | 1747 | default = default or {} | 1747 | default = default or {} |
37 | 1748 | 1748 | ||
38 | === modified file 'account/account_invoice_view.xml' | |||
39 | --- account/account_invoice_view.xml 2013-03-13 12:43:17 +0000 | |||
40 | +++ account/account_invoice_view.xml 2013-04-20 02:28:27 +0000 | |||
41 | @@ -320,7 +320,8 @@ | |||
42 | 320 | <field string="Customer" name="partner_id" | 320 | <field string="Customer" name="partner_id" |
43 | 321 | on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" | 321 | on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" |
44 | 322 | groups="base.group_user" context="{'search_default_customer':1, 'show_address': 1}" | 322 | groups="base.group_user" context="{'search_default_customer':1, 'show_address': 1}" |
46 | 323 | options='{"always_reload": True}'/> | 323 | options='{"always_reload": True}' |
47 | 324 | domain="[('customer', '=', True)]"/> | ||
48 | 324 | <field name="fiscal_position" widget="selection" /> | 325 | <field name="fiscal_position" widget="selection" /> |
49 | 325 | </group> | 326 | </group> |
50 | 326 | <group> | 327 | <group> |
51 | @@ -447,14 +448,14 @@ | |||
52 | 447 | <field name="model">account.invoice</field> | 448 | <field name="model">account.invoice</field> |
53 | 448 | <field name="arch" type="xml"> | 449 | <field name="arch" type="xml"> |
54 | 449 | <search string="Search Invoice"> | 450 | <search string="Search Invoice"> |
56 | 450 | <field name="number" string="Invoice" filter_domain="['|','|','|', ('number','ilike',self), ('origin','ilike',self), ('supplier_invoice_number', 'ilike', self), ('partner_id', 'ilike', self)]"/> | 451 | <field name="number" string="Invoice" filter_domain="['|','|','|', ('number','ilike',self), ('origin','ilike',self), ('supplier_invoice_number', 'ilike', self), ('partner_id', 'child_of', self)]"/> |
57 | 451 | <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/> | 452 | <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/> |
58 | 452 | <filter name="proforma" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="account.group_proforma_invoices"/> | 453 | <filter name="proforma" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="account.group_proforma_invoices"/> |
59 | 453 | <filter name="invoices" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/> | 454 | <filter name="invoices" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/> |
60 | 454 | <filter name="unpaid" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/> | 455 | <filter name="unpaid" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/> |
61 | 455 | <separator/> | 456 | <separator/> |
62 | 456 | <filter domain="[('user_id','=',uid)]" help="My Invoices" icon="terp-personal"/> | 457 | <filter domain="[('user_id','=',uid)]" help="My Invoices" icon="terp-personal"/> |
64 | 457 | <field name="partner_id"/> | 458 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> |
65 | 458 | <field name="user_id" string="Salesperson"/> | 459 | <field name="user_id" string="Salesperson"/> |
66 | 459 | <field name="period_id" string="Period"/> | 460 | <field name="period_id" string="Period"/> |
67 | 460 | <group expand="0" string="Group By..."> | 461 | <group expand="0" string="Group By..."> |
68 | 461 | 462 | ||
69 | === modified file 'account/partner.py' | |||
70 | --- account/partner.py 2013-03-20 13:50:52 +0000 | |||
71 | +++ account/partner.py 2013-04-20 02:28:27 +0000 | |||
72 | @@ -236,6 +236,11 @@ | |||
73 | 236 | 'last_reconciliation_date': fields.datetime('Latest Full Reconciliation Date', help='Date on which the partner accounting entries were fully reconciled last time. It differs from the last date where a reconciliation has been made for this partner, as here we depict the fact that nothing more was to be reconciled at this date. This can be achieved in 2 different ways: either the last unreconciled debit/credit entry of this partner was reconciled, either the user pressed the button "Nothing more to reconcile" during the manual reconciliation process.') | 236 | 'last_reconciliation_date': fields.datetime('Latest Full Reconciliation Date', help='Date on which the partner accounting entries were fully reconciled last time. It differs from the last date where a reconciliation has been made for this partner, as here we depict the fact that nothing more was to be reconciled at this date. This can be achieved in 2 different ways: either the last unreconciled debit/credit entry of this partner was reconciled, either the user pressed the button "Nothing more to reconcile" during the manual reconciliation process.') |
74 | 237 | } | 237 | } |
75 | 238 | 238 | ||
76 | 239 | def _commercial_fields(self, cr, uid, context=None): | ||
77 | 240 | return super(res_partner, self)._commercial_fields(cr, uid, context=context) + \ | ||
78 | 241 | ['debit_limit', 'property_account_payable', 'property_account_receivable', 'property_account_position', | ||
79 | 242 | 'property_payment_term', 'property_supplier_payment_term', 'last_reconciliation_date'] | ||
80 | 243 | |||
81 | 239 | res_partner() | 244 | res_partner() |
82 | 240 | 245 | ||
83 | 241 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 246 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
84 | 242 | 247 | ||
85 | === modified file 'account/partner_view.xml' | |||
86 | --- account/partner_view.xml 2013-02-25 14:10:14 +0000 | |||
87 | +++ account/partner_view.xml 2013-04-20 02:28:27 +0000 | |||
88 | @@ -73,7 +73,7 @@ | |||
89 | 73 | <field name="inherit_id" ref="base.view_partner_form"/> | 73 | <field name="inherit_id" ref="base.view_partner_form"/> |
90 | 74 | <field name="arch" type="xml"> | 74 | <field name="arch" type="xml"> |
91 | 75 | <page string="History" position="before" version="7.0"> | 75 | <page string="History" position="before" version="7.0"> |
93 | 76 | <page string="Accounting" col="4"> | 76 | <page string="Accounting" col="4" name="accounting" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}"> |
94 | 77 | <group> | 77 | <group> |
95 | 78 | <group> | 78 | <group> |
96 | 79 | <field name="property_account_position" widget="selection"/> | 79 | <field name="property_account_position" widget="selection"/> |
97 | @@ -103,6 +103,11 @@ | |||
98 | 103 | </tree> | 103 | </tree> |
99 | 104 | </field> | 104 | </field> |
100 | 105 | </page> | 105 | </page> |
101 | 106 | <page string="Accounting" name="accounting_disabled" attrs="{'invisible': ['|',('is_company','=',True),('parent_id','=',False)]}"> | ||
102 | 107 | <div> | ||
103 | 108 | <p>Accounting-related settings are managed on <button name="open_commercial_entity" type="object" string="the parent company" class="oe_link"/></p> | ||
104 | 109 | </div> | ||
105 | 110 | </page> | ||
106 | 106 | </page> | 111 | </page> |
107 | 107 | </field> | 112 | </field> |
108 | 108 | </record> | 113 | </record> |
109 | 109 | 114 | ||
110 | === modified file 'account/project/project_view.xml' | |||
111 | --- account/project/project_view.xml 2013-03-12 12:33:21 +0000 | |||
112 | +++ account/project/project_view.xml 2013-04-20 02:28:27 +0000 | |||
113 | @@ -31,7 +31,7 @@ | |||
114 | 31 | <search string="Analytic Account"> | 31 | <search string="Analytic Account"> |
115 | 32 | <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Analytic Account"/> | 32 | <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Analytic Account"/> |
116 | 33 | <field name="date"/> | 33 | <field name="date"/> |
118 | 34 | <field name="partner_id"/> | 34 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
119 | 35 | <field name="manager_id"/> | 35 | <field name="manager_id"/> |
120 | 36 | <field name="parent_id"/> | 36 | <field name="parent_id"/> |
121 | 37 | <field name="user_id"/> | 37 | <field name="user_id"/> |
122 | 38 | 38 | ||
123 | === modified file 'account_analytic_analysis/account_analytic_analysis_view.xml' | |||
124 | --- account_analytic_analysis/account_analytic_analysis_view.xml 2013-03-14 16:13:27 +0000 | |||
125 | +++ account_analytic_analysis/account_analytic_analysis_view.xml 2013-04-20 02:28:27 +0000 | |||
126 | @@ -186,7 +186,7 @@ | |||
127 | 186 | <search string="Contracts"> | 186 | <search string="Contracts"> |
128 | 187 | <field name="name" filter_domain="['|', ('name','ilike',self),('code','ilike',self)]" string="Contract"/> | 187 | <field name="name" filter_domain="['|', ('name','ilike',self),('code','ilike',self)]" string="Contract"/> |
129 | 188 | <field name="date"/> | 188 | <field name="date"/> |
131 | 189 | <field name="partner_id"/> | 189 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
132 | 190 | <field name="manager_id"/> | 190 | <field name="manager_id"/> |
133 | 191 | <field name="parent_id"/> | 191 | <field name="parent_id"/> |
134 | 192 | <filter name="open" string="In Progress" domain="[('state','in',('open','draft'))]" help="Contracts in progress (open, draft)"/> | 192 | <filter name="open" string="In Progress" domain="[('state','in',('open','draft'))]" help="Contracts in progress (open, draft)"/> |
135 | 193 | 193 | ||
136 | === modified file 'account_asset/account_asset_view.xml' | |||
137 | --- account_asset/account_asset_view.xml 2012-12-08 10:33:38 +0000 | |||
138 | +++ account_asset/account_asset_view.xml 2013-04-20 02:28:27 +0000 | |||
139 | @@ -223,7 +223,7 @@ | |||
140 | 223 | <filter icon="terp-check" string="Current" domain="[('state','in', ('draft','open'))]" help="Assets in draft and open states"/> | 223 | <filter icon="terp-check" string="Current" domain="[('state','in', ('draft','open'))]" help="Assets in draft and open states"/> |
141 | 224 | <filter icon="terp-dialog-close" string="Closed" domain="[('state','=', 'close')]" help="Assets in closed state"/> | 224 | <filter icon="terp-dialog-close" string="Closed" domain="[('state','=', 'close')]" help="Assets in closed state"/> |
142 | 225 | <field name="category_id"/> | 225 | <field name="category_id"/> |
144 | 226 | <field name="partner_id"/> | 226 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
145 | 227 | </search> | 227 | </search> |
146 | 228 | </field> | 228 | </field> |
147 | 229 | </record> | 229 | </record> |
148 | 230 | 230 | ||
149 | === modified file 'account_asset/report/account_asset_report_view.xml' | |||
150 | --- account_asset/report/account_asset_report_view.xml 2012-11-29 22:26:45 +0000 | |||
151 | +++ account_asset/report/account_asset_report_view.xml 2013-04-20 02:28:27 +0000 | |||
152 | @@ -49,7 +49,7 @@ | |||
153 | 49 | <field name="asset_id"/> | 49 | <field name="asset_id"/> |
154 | 50 | <field name="asset_category_id"/> | 50 | <field name="asset_category_id"/> |
155 | 51 | <group expand="0" string="Extended Filters..."> | 51 | <group expand="0" string="Extended Filters..."> |
157 | 52 | <field name="partner_id"/> | 52 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
158 | 53 | <field name="company_id" groups="base.group_multi_company"/> | 53 | <field name="company_id" groups="base.group_multi_company"/> |
159 | 54 | </group> | 54 | </group> |
160 | 55 | <group expand="1" string="Group By..."> | 55 | <group expand="1" string="Group By..."> |
161 | 56 | 56 | ||
162 | === added directory 'account_report_company' | |||
163 | === added file 'account_report_company/__init__.py' | |||
164 | --- account_report_company/__init__.py 1970-01-01 00:00:00 +0000 | |||
165 | +++ account_report_company/__init__.py 2013-04-20 02:28:27 +0000 | |||
166 | @@ -0,0 +1,25 @@ | |||
167 | 1 | # -*- coding: utf-8 -*- | ||
168 | 2 | ############################################################################## | ||
169 | 3 | # | ||
170 | 4 | # OpenERP, Open Source Business Applications | ||
171 | 5 | # Copyright (c) 2013 OpenERP S.A. <http://openerp.com> | ||
172 | 6 | # | ||
173 | 7 | # This program is free software: you can redistribute it and/or modify | ||
174 | 8 | # it under the terms of the GNU Affero General Public License as | ||
175 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
176 | 10 | # License, or (at your option) any later version. | ||
177 | 11 | # | ||
178 | 12 | # This program is distributed in the hope that it will be useful, | ||
179 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
180 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
181 | 15 | # GNU Affero General Public License for more details. | ||
182 | 16 | # | ||
183 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
184 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
185 | 19 | # | ||
186 | 20 | ############################################################################## | ||
187 | 21 | |||
188 | 22 | import account_report_company | ||
189 | 23 | import report | ||
190 | 24 | |||
191 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
192 | 0 | 26 | ||
193 | === added file 'account_report_company/__openerp__.py' | |||
194 | --- account_report_company/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
195 | +++ account_report_company/__openerp__.py 2013-04-20 02:28:27 +0000 | |||
196 | @@ -0,0 +1,57 @@ | |||
197 | 1 | # -*- coding: utf-8 -*- | ||
198 | 2 | ############################################################################## | ||
199 | 3 | # | ||
200 | 4 | # OpenERP, Open Source Business Applications | ||
201 | 5 | # Copyright (c) 2013 OpenERP S.A. <http://openerp.com> | ||
202 | 6 | # | ||
203 | 7 | # This program is free software: you can redistribute it and/or modify | ||
204 | 8 | # it under the terms of the GNU Affero General Public License as | ||
205 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
206 | 10 | # License, or (at your option) any later version. | ||
207 | 11 | # | ||
208 | 12 | # This program is distributed in the hope that it will be useful, | ||
209 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
210 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
211 | 15 | # GNU Affero General Public License for more details. | ||
212 | 16 | # | ||
213 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
214 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
215 | 19 | # | ||
216 | 20 | ############################################################################## | ||
217 | 21 | { | ||
218 | 22 | 'name': 'Invoice Analysis per Company', | ||
219 | 23 | 'version': '1.0', | ||
220 | 24 | 'category': 'Accounting & Finance', | ||
221 | 25 | 'description': """ | ||
222 | 26 | Add an extra Company dimension on Invoices for consolidated Invoice Analysis | ||
223 | 27 | ============================================================================ | ||
224 | 28 | |||
225 | 29 | By default Customer and Supplier invoices can be linked to a contact within | ||
226 | 30 | a company, but the company is not a direct reference in the database structure for | ||
227 | 31 | invoices. Journal Entries are however always linked to the company and not to | ||
228 | 32 | contacts, so that Accounts Payable and Receivable are always correct and consolidated | ||
229 | 33 | at company level. | ||
230 | 34 | |||
231 | 35 | When many different contacts/departments need to be invoiced within the same parent company, | ||
232 | 36 | this can make reporting by Company more difficult: reports are directly based on the | ||
233 | 37 | database structure and would not provide an aggregated company dimension. | ||
234 | 38 | |||
235 | 39 | This modules solves the problem by adding an explicit company reference on invoices, | ||
236 | 40 | automatically computed from the invoice contact, and use this new dimension | ||
237 | 41 | when grouping the list of Invoices or the Invoice Analysis report by Partner. | ||
238 | 42 | |||
239 | 43 | Note: this module will likely be removed for the next major OpenERP version and | ||
240 | 44 | directly integrated in the core accounting. | ||
241 | 45 | """, | ||
242 | 46 | 'author': 'OpenERP SA', | ||
243 | 47 | 'website': 'http://www.openerp.com', | ||
244 | 48 | 'depends': ['account'], | ||
245 | 49 | 'data': [ | ||
246 | 50 | 'account_invoice_view.xml', | ||
247 | 51 | 'res_partner_view.xml', | ||
248 | 52 | 'report/account_invoice_report_view.xml', | ||
249 | 53 | ], | ||
250 | 54 | 'auto_install': True, | ||
251 | 55 | } | ||
252 | 56 | |||
253 | 57 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
254 | 0 | 58 | ||
255 | === added file 'account_report_company/account_invoice_view.xml' | |||
256 | --- account_report_company/account_invoice_view.xml 1970-01-01 00:00:00 +0000 | |||
257 | +++ account_report_company/account_invoice_view.xml 2013-04-20 02:28:27 +0000 | |||
258 | @@ -0,0 +1,24 @@ | |||
259 | 1 | <?xml version="1.0"?> | ||
260 | 2 | <openerp> | ||
261 | 3 | <data> | ||
262 | 4 | <record model="ir.ui.view" id="account_report_company_tree_view"> | ||
263 | 5 | <field name="model">account.invoice</field> | ||
264 | 6 | <field name="inherit_id" ref="account.invoice_tree"/> | ||
265 | 7 | <field name="arch" type="xml"> | ||
266 | 8 | <field name="partner_id" position="after"> | ||
267 | 9 | <field name="commercial_partner_id" invisible="1"/> | ||
268 | 10 | </field> | ||
269 | 11 | </field> | ||
270 | 12 | </record> | ||
271 | 13 | |||
272 | 14 | <record model="ir.ui.view" id="account_report_company_search_view"> | ||
273 | 15 | <field name="model">account.invoice</field> | ||
274 | 16 | <field name="inherit_id" ref="account.view_account_invoice_filter"/> | ||
275 | 17 | <field name="arch" type="xml"> | ||
276 | 18 | <filter string="Partner" position="replace"> | ||
277 | 19 | <filter name="commercial_partner_id" string="Partner" domain="[]" context="{'group_by':'commercial_partner_id'}"/> | ||
278 | 20 | </filter> | ||
279 | 21 | </field> | ||
280 | 22 | </record> | ||
281 | 23 | </data> | ||
282 | 24 | </openerp> | ||
283 | 0 | \ No newline at end of file | 25 | \ No newline at end of file |
284 | 1 | 26 | ||
285 | === added file 'account_report_company/account_report_company.py' | |||
286 | --- account_report_company/account_report_company.py 1970-01-01 00:00:00 +0000 | |||
287 | +++ account_report_company/account_report_company.py 2013-04-20 02:28:27 +0000 | |||
288 | @@ -0,0 +1,51 @@ | |||
289 | 1 | # -*- coding: utf-8 -*- | ||
290 | 2 | ############################################################################## | ||
291 | 3 | # | ||
292 | 4 | # OpenERP, Open Source Business Applications | ||
293 | 5 | # Copyright (c) 2013 S.A. <http://openerp.com> | ||
294 | 6 | # | ||
295 | 7 | # This program is free software: you can redistribute it and/or modify | ||
296 | 8 | # it under the terms of the GNU Affero General Public License as | ||
297 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
298 | 10 | # License, or (at your option) any later version. | ||
299 | 11 | # | ||
300 | 12 | # This program is distributed in the hope that it will be useful, | ||
301 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
302 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
303 | 15 | # GNU Affero General Public License for more details. | ||
304 | 16 | # | ||
305 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
306 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
307 | 19 | # | ||
308 | 20 | ############################################################################## | ||
309 | 21 | |||
310 | 22 | from openerp.osv import osv, fields | ||
311 | 23 | |||
312 | 24 | class res_partner(osv.Model): | ||
313 | 25 | _inherit = 'res.partner' | ||
314 | 26 | _order = 'display_name' | ||
315 | 27 | |||
316 | 28 | def _display_name_compute(self, cr, uid, ids, name, args, context=None): | ||
317 | 29 | return dict(self.name_get(cr, uid, ids, context=context)) | ||
318 | 30 | |||
319 | 31 | _display_name_store_triggers = { | ||
320 | 32 | 'res.partner': (lambda self,cr,uid,ids,context=None: self.search(cr, uid, [('id','child_of',ids)]), | ||
321 | 33 | ['parent_id', 'is_company'], 10) | ||
322 | 34 | } | ||
323 | 35 | |||
324 | 36 | # indirection to avoid passing a copy of the overridable method when declaring the function field | ||
325 | 37 | _display_name = lambda self, *args, **kwargs: self._display_name_compute(*args, **kwargs) | ||
326 | 38 | |||
327 | 39 | _columns = { | ||
328 | 40 | # extra field to allow ORDER BY to match visible names | ||
329 | 41 | 'display_name': fields.function(_display_name, type='char', string='Name', store=_display_name_store_triggers), | ||
330 | 42 | } | ||
331 | 43 | |||
332 | 44 | class account_invoice(osv.Model): | ||
333 | 45 | _inherit = 'account.invoice' | ||
334 | 46 | |||
335 | 47 | _columns = { | ||
336 | 48 | 'commercial_partner_id': fields.related('partner_id', 'commercial_partner_id', string='Commercial Entity', type='many2one', | ||
337 | 49 | relation='res.partner', store=True, readonly=True, | ||
338 | 50 | help="The commercial entity that will be used on Journal Entries for this invoice") | ||
339 | 51 | } | ||
340 | 0 | 52 | ||
341 | === added directory 'account_report_company/report' | |||
342 | === added file 'account_report_company/report/__init__.py' | |||
343 | --- account_report_company/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
344 | +++ account_report_company/report/__init__.py 2013-04-20 02:28:27 +0000 | |||
345 | @@ -0,0 +1,24 @@ | |||
346 | 1 | # -*- coding: utf-8 -*- | ||
347 | 2 | ############################################################################## | ||
348 | 3 | # | ||
349 | 4 | # OpenERP, Open Source Business Applications | ||
350 | 5 | # Copyright (c) 2013 OpenERP S.A. <http://openerp.com> | ||
351 | 6 | # | ||
352 | 7 | # This program is free software: you can redistribute it and/or modify | ||
353 | 8 | # it under the terms of the GNU Affero General Public License as | ||
354 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
355 | 10 | # License, or (at your option) any later version. | ||
356 | 11 | # | ||
357 | 12 | # This program is distributed in the hope that it will be useful, | ||
358 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
359 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
360 | 15 | # GNU Affero General Public License for more details. | ||
361 | 16 | # | ||
362 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
363 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
364 | 19 | # | ||
365 | 20 | ############################################################################## | ||
366 | 21 | |||
367 | 22 | import account_invoice_report | ||
368 | 23 | |||
369 | 24 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
370 | 0 | 25 | ||
371 | === added file 'account_report_company/report/account_invoice_report.py' | |||
372 | --- account_report_company/report/account_invoice_report.py 1970-01-01 00:00:00 +0000 | |||
373 | +++ account_report_company/report/account_invoice_report.py 2013-04-20 02:28:27 +0000 | |||
374 | @@ -0,0 +1,36 @@ | |||
375 | 1 | # -*- coding: utf-8 -*- | ||
376 | 2 | ############################################################################## | ||
377 | 3 | # | ||
378 | 4 | # OpenERP, Open Source Business Applications | ||
379 | 5 | # Copyright (c) 2013 OpenERP S.A. <http://openerp.com> | ||
380 | 6 | # | ||
381 | 7 | # This program is free software: you can redistribute it and/or modify | ||
382 | 8 | # it under the terms of the GNU Affero General Public License as | ||
383 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
384 | 10 | # License, or (at your option) any later version. | ||
385 | 11 | # | ||
386 | 12 | # This program is distributed in the hope that it will be useful, | ||
387 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
388 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
389 | 15 | # GNU Affero General Public License for more details. | ||
390 | 16 | # | ||
391 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
392 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
393 | 19 | # | ||
394 | 20 | ############################################################################## | ||
395 | 21 | from openerp.osv import osv, fields | ||
396 | 22 | |||
397 | 23 | class account_invoice_report(osv.Model): | ||
398 | 24 | _inherit = 'account.invoice.report' | ||
399 | 25 | _columns = { | ||
400 | 26 | 'commercial_partner_id': fields.many2one('res.partner', 'Partner Company', help="Commercial Entity"), | ||
401 | 27 | } | ||
402 | 28 | |||
403 | 29 | def _select(self): | ||
404 | 30 | return super(account_invoice_report, self)._select() + ", sub.commercial_partner_id as commercial_partner_id" | ||
405 | 31 | |||
406 | 32 | def _sub_select(self): | ||
407 | 33 | return super(account_invoice_report, self)._sub_select() + ", ai.commercial_partner_id as commercial_partner_id" | ||
408 | 34 | |||
409 | 35 | def _group_by(self): | ||
410 | 36 | return super(account_invoice_report, self)._group_by() + ", ai.commercial_partner_id" | ||
411 | 0 | 37 | ||
412 | === added file 'account_report_company/report/account_invoice_report_view.xml' | |||
413 | --- account_report_company/report/account_invoice_report_view.xml 1970-01-01 00:00:00 +0000 | |||
414 | +++ account_report_company/report/account_invoice_report_view.xml 2013-04-20 02:28:27 +0000 | |||
415 | @@ -0,0 +1,24 @@ | |||
416 | 1 | <?xml version="1.0"?> | ||
417 | 2 | <openerp> | ||
418 | 3 | <data> | ||
419 | 4 | <record model="ir.ui.view" id="account_report_company_invoice_report_tree_view"> | ||
420 | 5 | <field name="model">account.invoice.report</field> | ||
421 | 6 | <field name="inherit_id" ref="account.view_account_invoice_report_tree"/> | ||
422 | 7 | <field name="arch" type="xml"> | ||
423 | 8 | <field name="partner_id" position="after"> | ||
424 | 9 | <field name="commercial_partner_id" invisible="1"/> | ||
425 | 10 | </field> | ||
426 | 11 | </field> | ||
427 | 12 | </record> | ||
428 | 13 | |||
429 | 14 | <record model="ir.ui.view" id="account_report_company_invoice_report_search_view"> | ||
430 | 15 | <field name="model">account.invoice.report</field> | ||
431 | 16 | <field name="inherit_id" ref="account.view_account_invoice_report_search"/> | ||
432 | 17 | <field name="arch" type="xml"> | ||
433 | 18 | <filter name="partner" position="replace"> | ||
434 | 19 | <filter string="Partner" name="commercial_partner_id" context="{'group_by':'commercial_partner_id','residual_visible':True}"/> | ||
435 | 20 | </filter> | ||
436 | 21 | </field> | ||
437 | 22 | </record> | ||
438 | 23 | </data> | ||
439 | 24 | </openerp> | ||
440 | 0 | \ No newline at end of file | 25 | \ No newline at end of file |
441 | 1 | 26 | ||
442 | === added file 'account_report_company/res_partner_view.xml' | |||
443 | --- account_report_company/res_partner_view.xml 1970-01-01 00:00:00 +0000 | |||
444 | +++ account_report_company/res_partner_view.xml 2013-04-20 02:28:27 +0000 | |||
445 | @@ -0,0 +1,24 @@ | |||
446 | 1 | <?xml version="1.0"?> | ||
447 | 2 | <openerp> | ||
448 | 3 | <data> | ||
449 | 4 | <record model="ir.ui.view" id="account_report_copmany_partner_tree_view"> | ||
450 | 5 | <field name="model">res.partner</field> | ||
451 | 6 | <field name="inherit_id" ref="base.view_partner_tree"/> | ||
452 | 7 | <field name="arch" type="xml"> | ||
453 | 8 | <field name="name" position="replace"> | ||
454 | 9 | <field name="display_name"/> | ||
455 | 10 | </field> | ||
456 | 11 | </field> | ||
457 | 12 | </record> | ||
458 | 13 | |||
459 | 14 | <record model="ir.ui.view" id="account_report_copmany_partner_kanban_view"> | ||
460 | 15 | <field name="model">res.partner</field> | ||
461 | 16 | <field name="inherit_id" ref="base.res_partner_kanban_view"/> | ||
462 | 17 | <field name="arch" type="xml"> | ||
463 | 18 | <xpath expr="//templates//field[@name='name']" position="replace"> | ||
464 | 19 | <field name="display_name"/> | ||
465 | 20 | </xpath> | ||
466 | 21 | </field> | ||
467 | 22 | </record> | ||
468 | 23 | </data> | ||
469 | 24 | </openerp> | ||
470 | 0 | \ No newline at end of file | 25 | \ No newline at end of file |
471 | 1 | 26 | ||
472 | === modified file 'account_voucher/account_voucher_view.xml' | |||
473 | --- account_voucher/account_voucher_view.xml 2013-02-25 13:38:04 +0000 | |||
474 | +++ account_voucher/account_voucher_view.xml 2013-04-20 02:28:27 +0000 | |||
475 | @@ -129,7 +129,7 @@ | |||
476 | 129 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> | 129 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> |
477 | 130 | <separator/> | 130 | <separator/> |
478 | 131 | <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted'), ('audit','=',False)]" help="To Review"/> | 131 | <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted'), ('audit','=',False)]" help="To Review"/> |
480 | 132 | <field name="partner_id"/> | 132 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> |
481 | 133 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" /> | 133 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" /> |
482 | 134 | <field name="period_id"/> | 134 | <field name="period_id"/> |
483 | 135 | <group expand="0" string="Group By..."> | 135 | <group expand="0" string="Group By..."> |
484 | 136 | 136 | ||
485 | === modified file 'account_voucher/voucher_payment_receipt_view.xml' | |||
486 | --- account_voucher/voucher_payment_receipt_view.xml 2013-02-25 13:38:04 +0000 | |||
487 | +++ account_voucher/voucher_payment_receipt_view.xml 2013-04-20 02:28:27 +0000 | |||
488 | @@ -11,7 +11,7 @@ | |||
489 | 11 | <field name="date"/> | 11 | <field name="date"/> |
490 | 12 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> | 12 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> |
491 | 13 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> | 13 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> |
493 | 14 | <field name="partner_id" string="Customer"/> | 14 | <field name="partner_id" string="Customer" filter_domain="[('partner_id','child_of',self)]"/> |
494 | 15 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/> | 15 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/> |
495 | 16 | <field name="period_id"/> | 16 | <field name="period_id"/> |
496 | 17 | <group expand="0" string="Group By..."> | 17 | <group expand="0" string="Group By..."> |
497 | @@ -34,7 +34,7 @@ | |||
498 | 34 | <field name="date"/> | 34 | <field name="date"/> |
499 | 35 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> | 35 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> |
500 | 36 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> | 36 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> |
502 | 37 | <field name="partner_id" string="Supplier"/> | 37 | <field name="partner_id" string="Supplier" filter_domain="[('partner_id','child_of',self)]"/> |
503 | 38 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/> | 38 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/> |
504 | 39 | <field name="period_id"/> | 39 | <field name="period_id"/> |
505 | 40 | <group expand="0" string="Group By..."> | 40 | <group expand="0" string="Group By..."> |
506 | 41 | 41 | ||
507 | === modified file 'account_voucher/voucher_sales_purchase_view.xml' | |||
508 | --- account_voucher/voucher_sales_purchase_view.xml 2013-02-25 14:20:35 +0000 | |||
509 | +++ account_voucher/voucher_sales_purchase_view.xml 2013-04-20 02:28:27 +0000 | |||
510 | @@ -10,7 +10,7 @@ | |||
511 | 10 | <field name="date"/> | 10 | <field name="date"/> |
512 | 11 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> | 11 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> |
513 | 12 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> | 12 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> |
515 | 13 | <field name="partner_id" string="Supplier"/> | 13 | <field name="partner_id" string="Supplier" filter_domain="[('partner_id','child_of',self)]"/> |
516 | 14 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/> | 14 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/> |
517 | 15 | <field name="period_id"/> | 15 | <field name="period_id"/> |
518 | 16 | <group expand="0" string="Group By..."> | 16 | <group expand="0" string="Group By..."> |
519 | @@ -32,7 +32,7 @@ | |||
520 | 32 | <field name="date"/> | 32 | <field name="date"/> |
521 | 33 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> | 33 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/> |
522 | 34 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> | 34 | <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/> |
524 | 35 | <field name="partner_id" string="Customer"/> | 35 | <field name="partner_id" string="Customer" filter_domain="[('partner_id','child_of',self)]"/> |
525 | 36 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/> | 36 | <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/> |
526 | 37 | <field name="period_id"/> | 37 | <field name="period_id"/> |
527 | 38 | <group expand="0" string="Group By..."> | 38 | <group expand="0" string="Group By..."> |
528 | 39 | 39 | ||
529 | === modified file 'base_vat/base_vat.py' | |||
530 | --- base_vat/base_vat.py 2012-12-18 17:55:47 +0000 | |||
531 | +++ base_vat/base_vat.py 2013-04-20 02:28:27 +0000 | |||
532 | @@ -134,6 +134,9 @@ | |||
533 | 134 | 'vat_subjected': fields.boolean('VAT Legal Statement', help="Check this box if the partner is subjected to the VAT. It will be used for the VAT legal statement.") | 134 | 'vat_subjected': fields.boolean('VAT Legal Statement', help="Check this box if the partner is subjected to the VAT. It will be used for the VAT legal statement.") |
534 | 135 | } | 135 | } |
535 | 136 | 136 | ||
536 | 137 | def _commercial_fields(self, cr, uid, context=None): | ||
537 | 138 | return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['vat_subjected'] | ||
538 | 139 | |||
539 | 137 | def _construct_constraint_msg(self, cr, uid, ids, context=None): | 140 | def _construct_constraint_msg(self, cr, uid, ids, context=None): |
540 | 138 | def default_vat_check(cn, vn): | 141 | def default_vat_check(cn, vn): |
541 | 139 | # by default, a VAT number is valid if: | 142 | # by default, a VAT number is valid if: |
542 | 140 | 143 | ||
543 | === modified file 'crm/crm_lead_view.xml' | |||
544 | --- crm/crm_lead_view.xml 2013-04-11 12:33:56 +0000 | |||
545 | +++ crm/crm_lead_view.xml 2013-04-20 02:28:27 +0000 | |||
546 | @@ -328,7 +328,7 @@ | |||
547 | 328 | <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/> | 328 | <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/> |
548 | 329 | <field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/> | 329 | <field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/> |
549 | 330 | <field name="user_id"/> | 330 | <field name="user_id"/> |
551 | 331 | <field name="partner_id"/> | 331 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
552 | 332 | <field name="create_date"/> | 332 | <field name="create_date"/> |
553 | 333 | <field name="country_id" context="{'invisible_country': False}"/> | 333 | <field name="country_id" context="{'invisible_country': False}"/> |
554 | 334 | <separator/> | 334 | <separator/> |
555 | @@ -546,7 +546,7 @@ | |||
556 | 546 | <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/> | 546 | <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/> |
557 | 547 | <field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/> | 547 | <field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/> |
558 | 548 | <field name="user_id"/> | 548 | <field name="user_id"/> |
560 | 549 | <field name="partner_id"/> | 549 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
561 | 550 | <separator/> | 550 | <separator/> |
562 | 551 | <filter string="New" name="new" domain="[('state','=','draft')]" help="New Opportunities"/> | 551 | <filter string="New" name="new" domain="[('state','=','draft')]" help="New Opportunities"/> |
563 | 552 | <filter string="In Progress" name="open" domain="[('state','=','open')]" help="Open Opportunities"/> | 552 | <filter string="In Progress" name="open" domain="[('state','=','open')]" help="Open Opportunities"/> |
564 | 553 | 553 | ||
565 | === modified file 'crm/crm_phonecall_view.xml' | |||
566 | --- crm/crm_phonecall_view.xml 2013-03-04 18:44:31 +0000 | |||
567 | +++ crm/crm_phonecall_view.xml 2013-04-20 02:28:27 +0000 | |||
568 | @@ -185,7 +185,7 @@ | |||
569 | 185 | <separator/> | 185 | <separator/> |
570 | 186 | <filter string="Phone Calls Assigned to Me or My Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('user_id', '=', uid)]" | 186 | <filter string="Phone Calls Assigned to Me or My Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('user_id', '=', uid)]" |
571 | 187 | help="Phone Calls Assigned to the current user or with a team having the current user as team leader"/> | 187 | help="Phone Calls Assigned to the current user or with a team having the current user as team leader"/> |
573 | 188 | <field name="partner_id"/> | 188 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
574 | 189 | <field name="user_id"/> | 189 | <field name="user_id"/> |
575 | 190 | <field name="section_id" string="Sales Team"/> | 190 | <field name="section_id" string="Sales Team"/> |
576 | 191 | <group expand="0" string="Group By..."> | 191 | <group expand="0" string="Group By..."> |
577 | 192 | 192 | ||
578 | === modified file 'crm/report/crm_lead_report_view.xml' | |||
579 | --- crm/report/crm_lead_report_view.xml 2012-11-29 22:26:45 +0000 | |||
580 | +++ crm/report/crm_lead_report_view.xml 2013-04-20 02:28:27 +0000 | |||
581 | @@ -80,7 +80,7 @@ | |||
582 | 80 | <field name="section_id" context="{'invisible_section': False}"/> | 80 | <field name="section_id" context="{'invisible_section': False}"/> |
583 | 81 | <field name="user_id" string="Salesperson"/> | 81 | <field name="user_id" string="Salesperson"/> |
584 | 82 | <group expand="0" string="Extended Filters..."> | 82 | <group expand="0" string="Extended Filters..."> |
586 | 83 | <field name="partner_id"/> | 83 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
587 | 84 | <field name="stage_id" domain="[('section_ids', '=', 'section_id')]" /> | 84 | <field name="stage_id" domain="[('section_ids', '=', 'section_id')]" /> |
588 | 85 | <field name="type_id"/> | 85 | <field name="type_id"/> |
589 | 86 | <field name="channel_id"/> | 86 | <field name="channel_id"/> |
590 | 87 | 87 | ||
591 | === modified file 'crm/report/crm_phonecall_report_view.xml' | |||
592 | --- crm/report/crm_phonecall_report_view.xml 2012-11-29 22:26:45 +0000 | |||
593 | +++ crm/report/crm_phonecall_report_view.xml 2013-04-20 02:28:27 +0000 | |||
594 | @@ -62,7 +62,7 @@ | |||
595 | 62 | <field name="section_id" string="Sales Team" context="{'invisible_section': False}"/> | 62 | <field name="section_id" string="Sales Team" context="{'invisible_section': False}"/> |
596 | 63 | <field name="user_id" string="Salesperson"/> | 63 | <field name="user_id" string="Salesperson"/> |
597 | 64 | <group expand="0" string="Extended Filters..."> | 64 | <group expand="0" string="Extended Filters..."> |
599 | 65 | <field name="partner_id"/> | 65 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
600 | 66 | <field name="company_id" groups="base.group_multi_company"/> | 66 | <field name="company_id" groups="base.group_multi_company"/> |
601 | 67 | <field name="creation_date"/> | 67 | <field name="creation_date"/> |
602 | 68 | <field name="opening_date"/> | 68 | <field name="opening_date"/> |
603 | 69 | 69 | ||
604 | === modified file 'crm_claim/crm_claim_view.xml' | |||
605 | --- crm_claim/crm_claim_view.xml 2013-03-04 12:55:34 +0000 | |||
606 | +++ crm_claim/crm_claim_view.xml 2013-04-20 02:28:27 +0000 | |||
607 | @@ -201,7 +201,7 @@ | |||
608 | 201 | <filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]"/> | 201 | <filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]"/> |
609 | 202 | <separator/> | 202 | <separator/> |
610 | 203 | <filter string="Unassigned Claims" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Claims" /> | 203 | <filter string="Unassigned Claims" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Claims" /> |
612 | 204 | <field name="partner_id"/> | 204 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
613 | 205 | <field name="user_id"/> | 205 | <field name="user_id"/> |
614 | 206 | <group expand="0" string="Group By..."> | 206 | <group expand="0" string="Group By..."> |
615 | 207 | <filter string="Partner" icon="terp-partner" domain="[]" help="Partner" context="{'group_by':'partner_id'}"/> | 207 | <filter string="Partner" icon="terp-partner" domain="[]" help="Partner" context="{'group_by':'partner_id'}"/> |
616 | 208 | 208 | ||
617 | === modified file 'crm_claim/report/crm_claim_report_view.xml' | |||
618 | --- crm_claim/report/crm_claim_report_view.xml 2012-11-29 22:26:45 +0000 | |||
619 | +++ crm_claim/report/crm_claim_report_view.xml 2013-04-20 02:28:27 +0000 | |||
620 | @@ -63,7 +63,7 @@ | |||
621 | 63 | <field name="user_id" string="Salesperson"/> | 63 | <field name="user_id" string="Salesperson"/> |
622 | 64 | <field name="section_id" string="Sales Team" context="{'invisible_section': False}"/> | 64 | <field name="section_id" string="Sales Team" context="{'invisible_section': False}"/> |
623 | 65 | <group expand="0" string="Extended Filters..."> | 65 | <group expand="0" string="Extended Filters..."> |
625 | 66 | <field name="partner_id"/> | 66 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
626 | 67 | <field name="stage_id" domain="[('section_ids', '=', 'section_id')]"/> | 67 | <field name="stage_id" domain="[('section_ids', '=', 'section_id')]"/> |
627 | 68 | <field name="categ_id" domain="[('object_id.model', '=', 'crm.claim')]"/> | 68 | <field name="categ_id" domain="[('object_id.model', '=', 'crm.claim')]"/> |
628 | 69 | <field name="priority"/> | 69 | <field name="priority"/> |
629 | 70 | 70 | ||
630 | === modified file 'crm_helpdesk/crm_helpdesk_view.xml' | |||
631 | --- crm_helpdesk/crm_helpdesk_view.xml 2013-03-04 18:44:31 +0000 | |||
632 | +++ crm_helpdesk/crm_helpdesk_view.xml 2013-04-20 02:28:27 +0000 | |||
633 | @@ -152,7 +152,7 @@ | |||
634 | 152 | <separator/> | 152 | <separator/> |
635 | 153 | <filter string="Assigned to Me or My Sales Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]" | 153 | <filter string="Assigned to Me or My Sales Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]" |
636 | 154 | help="Helpdesk requests that are assigned to me or to one of the sale teams I manage" /> | 154 | help="Helpdesk requests that are assigned to me or to one of the sale teams I manage" /> |
638 | 155 | <field name="partner_id" /> | 155 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
639 | 156 | <field name="user_id"/> | 156 | <field name="user_id"/> |
640 | 157 | <field name="section_id" string="Sales Team"/> | 157 | <field name="section_id" string="Sales Team"/> |
641 | 158 | <group expand="0" string="Group By..."> | 158 | <group expand="0" string="Group By..."> |
642 | 159 | 159 | ||
643 | === modified file 'crm_helpdesk/report/crm_helpdesk_report_view.xml' | |||
644 | --- crm_helpdesk/report/crm_helpdesk_report_view.xml 2012-11-29 22:26:45 +0000 | |||
645 | +++ crm_helpdesk/report/crm_helpdesk_report_view.xml 2013-04-20 02:28:27 +0000 | |||
646 | @@ -62,6 +62,7 @@ | |||
647 | 62 | <field name="user_id" string="Salesperson"/> | 62 | <field name="user_id" string="Salesperson"/> |
648 | 63 | <field name="section_id" string="Sales Team" context="{'invisible_section': False}"/> | 63 | <field name="section_id" string="Sales Team" context="{'invisible_section': False}"/> |
649 | 64 | <field name="company_id" groups="base.group_multi_company"/> | 64 | <field name="company_id" groups="base.group_multi_company"/> |
650 | 65 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> | ||
651 | 65 | <group expand="0" string="Extended Filters..." groups="base.group_no_one"> | 66 | <group expand="0" string="Extended Filters..." groups="base.group_no_one"> |
652 | 66 | <field name="priority" string="Priority"/> | 67 | <field name="priority" string="Priority"/> |
653 | 67 | <field name="categ_id"/> | 68 | <field name="categ_id"/> |
654 | 68 | 69 | ||
655 | === modified file 'l10n_be_invoice_bba/partner.py' | |||
656 | --- l10n_be_invoice_bba/partner.py 2012-12-06 14:56:32 +0000 | |||
657 | +++ l10n_be_invoice_bba/partner.py 2013-04-20 02:28:27 +0000 | |||
658 | @@ -44,6 +44,11 @@ | |||
659 | 44 | help='Select Algorithm to generate the Structured Communication on Outgoing Invoices.' ), | 44 | help='Select Algorithm to generate the Structured Communication on Outgoing Invoices.' ), |
660 | 45 | } | 45 | } |
661 | 46 | 46 | ||
662 | 47 | def _commercial_fields(self, cr, uid, context=None): | ||
663 | 48 | return super(res_partner, self)._commercial_fields(cr, uid, context=context) + \ | ||
664 | 49 | ['out_inv_comm_type', 'out_inv_comm_algorithm'] | ||
665 | 50 | |||
666 | 51 | |||
667 | 47 | _default = { | 52 | _default = { |
668 | 48 | 'out_inv_comm_type': 'none', | 53 | 'out_inv_comm_type': 'none', |
669 | 49 | } | 54 | } |
670 | 50 | 55 | ||
671 | === modified file 'l10n_ro/res_partner.py' | |||
672 | --- l10n_ro/res_partner.py 2012-12-19 14:11:55 +0000 | |||
673 | +++ l10n_ro/res_partner.py 2013-04-20 02:28:27 +0000 | |||
674 | @@ -28,10 +28,33 @@ | |||
675 | 28 | _columns = { | 28 | _columns = { |
676 | 29 | 'nrc' : fields.char('NRC', size=16, help='Registration number at the Registry of Commerce'), | 29 | 'nrc' : fields.char('NRC', size=16, help='Registration number at the Registry of Commerce'), |
677 | 30 | } | 30 | } |
678 | 31 | |||
679 | 32 | # The SQL constraints are no-ops but present only to display the right error message to the | ||
680 | 33 | # user when the partial unique indexes defined below raise errors/ | ||
681 | 34 | # The real constraints need to be implemented with PARTIAL UNIQUE INDEXES (see auto_init), | ||
682 | 35 | # due to the way accounting data is delegated by contacts to their companies in OpenERP 7.0. | ||
683 | 31 | _sql_constraints = [ | 36 | _sql_constraints = [ |
686 | 32 | ('vat_uniq', 'unique (vat)', 'The vat of the partner must be unique !'), | 37 | ('vat_uniq', 'unique (id)', 'The vat of the partner must be unique !'), |
687 | 33 | ('nrc_uniq', 'unique (nrc)', 'The code of the partner must be unique !') | 38 | ('nrc_uniq', 'unique (id)', 'The code of the partner must be unique !') |
688 | 34 | ] | 39 | ] |
689 | 40 | |||
690 | 41 | def _auto_init(self, cr, context=None): | ||
691 | 42 | result = super(res_partner, self)._auto_init(cr, context=context) | ||
692 | 43 | # Real implementation of the vat/nrc constraints: only "commercial entities" need to have | ||
693 | 44 | # unique numbers, and the condition for being a commercial entity is "is_company or parent_id IS NULL". | ||
694 | 45 | # Contacts inside a company automatically have a copy of the company's commercial fields | ||
695 | 46 | # (see _commercial_fields()), so they are automatically consistent. | ||
696 | 47 | cr.execute(""" | ||
697 | 48 | DROP INDEX IF EXISTS res_partner_vat_uniq_for_companies; | ||
698 | 49 | DROP INDEX IF EXISTS res_partner_nrc_uniq_for_companies; | ||
699 | 50 | CREATE UNIQUE INDEX res_partner_vat_uniq_for_companies ON res_partner (vat) WHERE is_company OR parent_id IS NULL; | ||
700 | 51 | CREATE UNIQUE INDEX res_partner_nrc_uniq_for_companies ON res_partner (nrc) WHERE is_company OR parent_id IS NULL; | ||
701 | 52 | """) | ||
702 | 53 | return result | ||
703 | 54 | |||
704 | 55 | def _commercial_fields(self, cr, uid, context=None): | ||
705 | 56 | return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['nrc'] | ||
706 | 57 | |||
707 | 35 | res_partner() | 58 | res_partner() |
708 | 36 | 59 | ||
709 | 37 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 60 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
710 | 38 | 61 | ||
711 | === modified file 'mrp_repair/mrp_repair_view.xml' | |||
712 | --- mrp_repair/mrp_repair_view.xml 2012-12-15 16:31:01 +0000 | |||
713 | +++ mrp_repair/mrp_repair_view.xml 2013-04-20 02:28:27 +0000 | |||
714 | @@ -210,7 +210,7 @@ | |||
715 | 210 | <separator/> | 210 | <separator/> |
716 | 211 | <filter icon="terp-dolar" string="Invoiced" domain="[('invoiced','=',True)]"/> | 211 | <filter icon="terp-dolar" string="Invoiced" domain="[('invoiced','=',True)]"/> |
717 | 212 | <field name="product_id"/> | 212 | <field name="product_id"/> |
719 | 213 | <field name="partner_id"/> | 213 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> |
720 | 214 | <group expand="0" string="Group By..."> | 214 | <group expand="0" string="Group By..."> |
721 | 215 | <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> | 215 | <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> |
722 | 216 | <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/> | 216 | <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/> |
723 | 217 | 217 | ||
724 | === modified file 'product/partner.py' | |||
725 | --- product/partner.py 2012-12-06 14:56:32 +0000 | |||
726 | +++ product/partner.py 2013-04-20 02:28:27 +0000 | |||
727 | @@ -36,6 +36,9 @@ | |||
728 | 36 | help="This pricelist will be used, instead of the default one, for sales to the current partner"), | 36 | help="This pricelist will be used, instead of the default one, for sales to the current partner"), |
729 | 37 | } | 37 | } |
730 | 38 | 38 | ||
731 | 39 | def _commercial_fields(self, cr, uid, context=None): | ||
732 | 40 | return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['property_product_pricelist'] | ||
733 | 41 | |||
734 | 39 | res_partner() | 42 | res_partner() |
735 | 40 | 43 | ||
736 | 41 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 44 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
737 | 42 | 45 | ||
738 | === modified file 'product/partner_view.xml' | |||
739 | --- product/partner_view.xml 2012-11-29 22:26:45 +0000 | |||
740 | +++ product/partner_view.xml 2013-04-20 02:28:27 +0000 | |||
741 | @@ -8,9 +8,12 @@ | |||
742 | 8 | <field name="arch" type="xml"> | 8 | <field name="arch" type="xml"> |
743 | 9 | <page string="Sales & Purchases" position="inside"> | 9 | <page string="Sales & Purchases" position="inside"> |
744 | 10 | <group> | 10 | <group> |
746 | 11 | <group name="pricelists" groups="product.group_sale_pricelist"> | 11 | <group name="pricelists" groups="product.group_sale_pricelist" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}"> |
747 | 12 | <field name="property_product_pricelist"/> | 12 | <field name="property_product_pricelist"/> |
748 | 13 | </group> | 13 | </group> |
749 | 14 | <div name="parent_pricelists" groups="product.group_sale_pricelist" attrs="{'invisible': ['|',('is_company','=',True),('parent_id','=',False)]}"> | ||
750 | 15 | <p>Pricelists are managed on <button name="open_commercial_entity" type="object" string="the parent company" class="oe_link"/></p> | ||
751 | 16 | </div> | ||
752 | 14 | </group> | 17 | </group> |
753 | 15 | </page> | 18 | </page> |
754 | 16 | </field> | 19 | </field> |
755 | 17 | 20 | ||
756 | === modified file 'project/project_view.xml' | |||
757 | --- project/project_view.xml 2013-03-04 18:44:31 +0000 | |||
758 | +++ project/project_view.xml 2013-04-20 02:28:27 +0000 | |||
759 | @@ -182,7 +182,7 @@ | |||
760 | 182 | <separator/> | 182 | <separator/> |
761 | 183 | <filter string="Project(s) Manager" domain="[('user_id','=',uid)]" help="Projects in which I am a manager" icon="terp-personal"/> | 183 | <filter string="Project(s) Manager" domain="[('user_id','=',uid)]" help="Projects in which I am a manager" icon="terp-personal"/> |
762 | 184 | <field name="user_id" string="Project Manager"/> | 184 | <field name="user_id" string="Project Manager"/> |
764 | 185 | <field name="partner_id" string="Contact"/> | 185 | <field name="partner_id" string="Contact" filter_domain="[('partner_id', 'child_of', self)]"/> |
765 | 186 | <group expand="0" string="Group By..."> | 186 | <group expand="0" string="Group By..."> |
766 | 187 | <filter string="Manager" name="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/> | 187 | <filter string="Manager" name="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/> |
767 | 188 | <filter string="Contact" name="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> | 188 | <filter string="Contact" name="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> |
768 | 189 | 189 | ||
769 | === modified file 'project/report/project_report_view.xml' | |||
770 | --- project/report/project_report_view.xml 2012-11-29 22:26:45 +0000 | |||
771 | +++ project/report/project_report_view.xml 2013-04-20 02:28:27 +0000 | |||
772 | @@ -69,7 +69,7 @@ | |||
773 | 69 | <filter icon="terp-personal-" string="Non Assigned Tasks to users" help="Non Assigned Tasks to users" domain="[('user_id','=',False)]"/> | 69 | <filter icon="terp-personal-" string="Non Assigned Tasks to users" help="Non Assigned Tasks to users" domain="[('user_id','=',False)]"/> |
774 | 70 | <field name="project_id"/> | 70 | <field name="project_id"/> |
775 | 71 | <field name="user_id"/> | 71 | <field name="user_id"/> |
777 | 72 | <field name="partner_id" /> | 72 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> |
778 | 73 | <group expand="0" string="Extended Filters..."> | 73 | <group expand="0" string="Extended Filters..."> |
779 | 74 | <field name="priority"/> | 74 | <field name="priority"/> |
780 | 75 | <field name="company_id" groups="base.group_multi_company"/> | 75 | <field name="company_id" groups="base.group_multi_company"/> |
781 | 76 | 76 | ||
782 | === modified file 'project_issue/project_issue_view.xml' | |||
783 | --- project_issue/project_issue_view.xml 2013-02-26 15:16:04 +0000 | |||
784 | +++ project_issue/project_issue_view.xml 2013-04-20 02:28:27 +0000 | |||
785 | @@ -139,7 +139,7 @@ | |||
786 | 139 | <field name="model">project.issue</field> | 139 | <field name="model">project.issue</field> |
787 | 140 | <field name="arch" type="xml"> | 140 | <field name="arch" type="xml"> |
788 | 141 | <search string="Issue Tracker Search"> | 141 | <search string="Issue Tracker Search"> |
790 | 142 | <field name="name" string="Issue" filter_domain="['|', '|',('partner_id','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/> | 142 | <field name="name" string="Issue" filter_domain="['|', '|',('partner_id','child_of',self),('email_from','ilike',self),('name','ilike',self)]"/> |
791 | 143 | <field name="id"/> | 143 | <field name="id"/> |
792 | 144 | <filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/> | 144 | <filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/> |
793 | 145 | <separator/> | 145 | <separator/> |
794 | @@ -150,6 +150,7 @@ | |||
795 | 150 | <field name="user_id"/> | 150 | <field name="user_id"/> |
796 | 151 | <field name="project_id"/> | 151 | <field name="project_id"/> |
797 | 152 | <field name="categ_ids"/> | 152 | <field name="categ_ids"/> |
798 | 153 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> | ||
799 | 153 | <group expand="0" string="Group By..." > | 154 | <group expand="0" string="Group By..." > |
800 | 154 | <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/> | 155 | <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/> |
801 | 155 | <filter string="Contact" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> | 156 | <filter string="Contact" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> |
802 | 156 | 157 | ||
803 | === modified file 'project_issue/report/project_issue_report_view.xml' | |||
804 | --- project_issue/report/project_issue_report_view.xml 2012-11-29 22:26:45 +0000 | |||
805 | +++ project_issue/report/project_issue_report_view.xml 2013-04-20 02:28:27 +0000 | |||
806 | @@ -55,7 +55,7 @@ | |||
807 | 55 | <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]"/> | 55 | <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]"/> |
808 | 56 | <field name="project_id"/> | 56 | <field name="project_id"/> |
809 | 57 | <field name="user_id"/> | 57 | <field name="user_id"/> |
811 | 58 | <field name="partner_id"/> | 58 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> |
812 | 59 | <field name="version_id"/> | 59 | <field name="version_id"/> |
813 | 60 | <group expand="1" string="Group By..."> | 60 | <group expand="1" string="Group By..."> |
814 | 61 | <filter string="Assigned to" name="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" /> | 61 | <filter string="Assigned to" name="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" /> |
815 | 62 | 62 | ||
816 | === modified file 'purchase/partner.py' | |||
817 | --- purchase/partner.py 2012-12-06 14:56:32 +0000 | |||
818 | +++ purchase/partner.py 2013-04-20 02:28:27 +0000 | |||
819 | @@ -43,6 +43,9 @@ | |||
820 | 43 | 43 | ||
821 | 44 | super(res_partner, self).copy(cr, uid, id, default=default, context=context) | 44 | super(res_partner, self).copy(cr, uid, id, default=default, context=context) |
822 | 45 | 45 | ||
823 | 46 | def _commercial_fields(self, cr, uid, context=None): | ||
824 | 47 | return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['property_product_pricelist_purchase'] | ||
825 | 48 | |||
826 | 46 | _columns = { | 49 | _columns = { |
827 | 47 | 'property_product_pricelist_purchase': fields.property( | 50 | 'property_product_pricelist_purchase': fields.property( |
828 | 48 | 'product.pricelist', | 51 | 'product.pricelist', |
829 | 49 | 52 | ||
830 | === modified file 'purchase/purchase_view.xml' | |||
831 | --- purchase/purchase_view.xml 2013-04-17 10:00:49 +0000 | |||
832 | +++ purchase/purchase_view.xml 2013-04-20 02:28:27 +0000 | |||
833 | @@ -270,7 +270,7 @@ | |||
834 | 270 | <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase order which are in the exception state"/> | 270 | <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase order which are in the exception state"/> |
835 | 271 | <separator/> | 271 | <separator/> |
836 | 272 | <filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/> | 272 | <filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/> |
838 | 273 | <field name="partner_id"/> | 273 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> |
839 | 274 | <field name="product_id"/> | 274 | <field name="product_id"/> |
840 | 275 | <field name="create_uid"/> | 275 | <field name="create_uid"/> |
841 | 276 | <group expand="0" string="Group By..."> | 276 | <group expand="0" string="Group By..."> |
842 | @@ -297,7 +297,7 @@ | |||
843 | 297 | <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/> | 297 | <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/> |
844 | 298 | <separator/> | 298 | <separator/> |
845 | 299 | <filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/> | 299 | <filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/> |
847 | 300 | <field name="partner_id"/> | 300 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> |
848 | 301 | <field name="product_id"/> | 301 | <field name="product_id"/> |
849 | 302 | <field name="create_uid"/> | 302 | <field name="create_uid"/> |
850 | 303 | <group expand="0" string="Group By..."> | 303 | <group expand="0" string="Group By..."> |
851 | @@ -481,7 +481,7 @@ | |||
852 | 481 | <search string="Search Purchase Order"> | 481 | <search string="Search Purchase Order"> |
853 | 482 | <field name="order_id"/> | 482 | <field name="order_id"/> |
854 | 483 | <field name="product_id"/> | 483 | <field name="product_id"/> |
856 | 484 | <field name="partner_id" string="Supplier"/> | 484 | <field name="partner_id" string="Supplier" filter_domain="[('partner_id', 'child_of', self)]"/> |
857 | 485 | <group expand="0" string="Group By..."> | 485 | <group expand="0" string="Group By..."> |
858 | 486 | <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" /> | 486 | <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" /> |
859 | 487 | <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" /> | 487 | <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" /> |
860 | 488 | 488 | ||
861 | === modified file 'sale/res_partner_view.xml' | |||
862 | --- sale/res_partner_view.xml 2012-12-20 11:43:56 +0000 | |||
863 | +++ sale/res_partner_view.xml 2013-04-20 02:28:27 +0000 | |||
864 | @@ -63,14 +63,34 @@ | |||
865 | 63 | <field name="arch" type="xml"> | 63 | <field name="arch" type="xml"> |
866 | 64 | <xpath expr="//label[@for='type']" position="attributes"> | 64 | <xpath expr="//label[@for='type']" position="attributes"> |
867 | 65 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> | 65 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> |
876 | 66 | </xpath> | 66 | <attribute name="invisible">False</attribute> |
877 | 67 | <xpath expr="//label[@for='type']" position="attributes"> | 67 | </xpath> |
878 | 68 | <attribute name="invisible">False</attribute> | 68 | <xpath expr="//div[@name='div_type']" position="attributes"> |
879 | 69 | </xpath> | 69 | <attribute name="invisible">False</attribute> |
880 | 70 | <xpath expr="//div[@name='div_type']" position="attributes"> | 70 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> |
881 | 71 | <attribute name="invisible">False</attribute> | 71 | </xpath> |
882 | 72 | </xpath> | 72 | <xpath expr="//field[@name='use_parent_address']" position="attributes"> |
883 | 73 | <xpath expr="//div[@name='div_type']" position="attributes"> | 73 | <attribute name="invisible">False</attribute> |
884 | 74 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> | ||
885 | 75 | </xpath> | ||
886 | 76 | <xpath expr="//label[@for='use_parent_address']" position="attributes"> | ||
887 | 77 | <attribute name="invisible">False</attribute> | ||
888 | 78 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> | ||
889 | 79 | </xpath> | ||
890 | 80 | <xpath expr="//field[@name='child_ids']//field[@name='use_parent_address']" position="attributes"> | ||
891 | 81 | <attribute name="invisible">False</attribute> | ||
892 | 82 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> | ||
893 | 83 | </xpath> | ||
894 | 84 | <xpath expr="//field[@name='child_ids']//label[@for='use_parent_address']" position="attributes"> | ||
895 | 85 | <attribute name="invisible">False</attribute> | ||
896 | 86 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> | ||
897 | 87 | </xpath> | ||
898 | 88 | <xpath expr="//field[@name='child_ids']//div[@name='div_type']" position="attributes"> | ||
899 | 89 | <attribute name="invisible">False</attribute> | ||
900 | 90 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> | ||
901 | 91 | </xpath> | ||
902 | 92 | <xpath expr="//field[@name='child_ids']//label[@for='type']" position="attributes"> | ||
903 | 93 | <attribute name="invisible">False</attribute> | ||
904 | 74 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> | 94 | <attribute name="groups">sale.group_delivery_invoice_address</attribute> |
905 | 75 | </xpath> | 95 | </xpath> |
906 | 76 | </field> | 96 | </field> |
907 | 77 | 97 | ||
908 | === modified file 'sale/sale.py' | |||
909 | --- sale/sale.py 2013-04-18 16:36:16 +0000 | |||
910 | +++ sale/sale.py 2013-04-20 02:28:27 +0000 | |||
911 | @@ -314,10 +314,6 @@ | |||
912 | 314 | return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}} | 314 | return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}} |
913 | 315 | 315 | ||
914 | 316 | part = self.pool.get('res.partner').browse(cr, uid, part, context=context) | 316 | part = self.pool.get('res.partner').browse(cr, uid, part, context=context) |
915 | 317 | #if the chosen partner is not a company and has a parent company, use the parent to choose the delivery, the | ||
916 | 318 | #invoicing addresses and all the fields related to the partner. | ||
917 | 319 | if part.parent_id and not part.is_company: | ||
918 | 320 | part = part.parent_id | ||
919 | 321 | addr = self.pool.get('res.partner').address_get(cr, uid, [part.id], ['delivery', 'invoice', 'contact']) | 317 | addr = self.pool.get('res.partner').address_get(cr, uid, [part.id], ['delivery', 'invoice', 'contact']) |
920 | 322 | pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False | 318 | pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False |
921 | 323 | payment_term = part.property_payment_term and part.property_payment_term.id or False | 319 | payment_term = part.property_payment_term and part.property_payment_term.id or False |
922 | 324 | 320 | ||
923 | === modified file 'sale/sale_view.xml' | |||
924 | --- sale/sale_view.xml 2013-04-18 17:20:22 +0000 | |||
925 | +++ sale/sale_view.xml 2013-04-20 02:28:27 +0000 | |||
926 | @@ -156,7 +156,7 @@ | |||
927 | 156 | <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/> | 156 | <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/> |
928 | 157 | <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}"/> | 157 | <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}"/> |
929 | 158 | <field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/> | 158 | <field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/> |
931 | 159 | <field name="project_id" context="{'partner_id':partner_id, 'default_pricelist_id':pricelist_id, 'default_name':name, 'default_type': 'contract'}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/> | 159 | <field name="project_id" context="{'partner_id':partner_invoice_id, 'default_pricelist_id':pricelist_id, 'default_name':name, 'default_type': 'contract'}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/> |
932 | 160 | </group> | 160 | </group> |
933 | 161 | <group> | 161 | <group> |
934 | 162 | <field name="date_order"/> | 162 | <field name="date_order"/> |
935 | @@ -308,7 +308,7 @@ | |||
936 | 308 | <filter icon="terp-dolar_ok!" string="Done" domain="[('state','=','done')]" help="Sales Order done"/> | 308 | <filter icon="terp-dolar_ok!" string="Done" domain="[('state','=','done')]" help="Sales Order done"/> |
937 | 309 | <separator/> | 309 | <separator/> |
938 | 310 | <filter string="My Sales Orders" domain="[('user_id','=',uid)]" help="My Sales Orders" icon="terp-personal" name="my_sale_orders_filter"/> | 310 | <filter string="My Sales Orders" domain="[('user_id','=',uid)]" help="My Sales Orders" icon="terp-personal" name="my_sale_orders_filter"/> |
940 | 311 | <field name="partner_id"/> | 311 | <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/> |
941 | 312 | <field name="user_id"/> | 312 | <field name="user_id"/> |
942 | 313 | <field name="project_id"/> | 313 | <field name="project_id"/> |
943 | 314 | <group expand="0" string="Group By..."> | 314 | <group expand="0" string="Group By..."> |
944 | @@ -472,7 +472,7 @@ | |||
945 | 472 | <separator/> | 472 | <separator/> |
946 | 473 | <filter string="My Sales Order Lines" icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/> | 473 | <filter string="My Sales Order Lines" icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/> |
947 | 474 | <field name="order_id"/> | 474 | <field name="order_id"/> |
949 | 475 | <field name="order_partner_id"/> | 475 | <field name="order_partner_id" filter_domain="[('order_partner_id', 'child_of', self)]"/> |
950 | 476 | <field name="product_id"/> | 476 | <field name="product_id"/> |
951 | 477 | <field name="salesman_id"/> | 477 | <field name="salesman_id"/> |
952 | 478 | <group expand="0" string="Group By..."> | 478 | <group expand="0" string="Group By..."> |
953 | @@ -498,7 +498,7 @@ | |||
954 | 498 | <separator/> | 498 | <separator/> |
955 | 499 | <filter string="My Sales Order Lines" icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sales Order Lines"/> | 499 | <filter string="My Sales Order Lines" icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sales Order Lines"/> |
956 | 500 | <field name="order_id"/> | 500 | <field name="order_id"/> |
958 | 501 | <field name="order_partner_id"/> | 501 | <field name="order_partner_id" filter_domain="[('order_partner_id', 'child_of', self)]"/> |
959 | 502 | <field name="product_id"/> | 502 | <field name="product_id"/> |
960 | 503 | <field name="salesman_id"/> | 503 | <field name="salesman_id"/> |
961 | 504 | <group expand="0" string="Group By..."> | 504 | <group expand="0" string="Group By..."> |
962 | 505 | 505 | ||
963 | === modified file 'sale_journal/sale_journal.py' | |||
964 | --- sale_journal/sale_journal.py 2012-12-06 14:56:32 +0000 | |||
965 | +++ sale_journal/sale_journal.py 2013-04-20 02:28:27 +0000 | |||
966 | @@ -52,6 +52,10 @@ | |||
967 | 52 | group_name = "Accounting Properties", | 52 | group_name = "Accounting Properties", |
968 | 53 | help = "This invoicing type will be used, by default, to invoice the current partner."), | 53 | help = "This invoicing type will be used, by default, to invoice the current partner."), |
969 | 54 | } | 54 | } |
970 | 55 | |||
971 | 56 | def _commercial_fields(self, cr, uid, context=None): | ||
972 | 57 | return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['property_invoice_type'] | ||
973 | 58 | |||
974 | 55 | res_partner() | 59 | res_partner() |
975 | 56 | 60 | ||
976 | 57 | class picking(osv.osv): | 61 | class picking(osv.osv): |
977 | 58 | 62 | ||
978 | === modified file 'sale_journal/sale_journal_view.xml' | |||
979 | --- sale_journal/sale_journal_view.xml 2012-12-16 15:58:43 +0000 | |||
980 | +++ sale_journal/sale_journal_view.xml 2013-04-20 02:28:27 +0000 | |||
981 | @@ -146,7 +146,7 @@ | |||
982 | 146 | <field name="inherit_id" ref="base.view_partner_form"/> | 146 | <field name="inherit_id" ref="base.view_partner_form"/> |
983 | 147 | <field name="arch" type="xml"> | 147 | <field name="arch" type="xml"> |
984 | 148 | <page string="Sales & Purchases" position="inside"> | 148 | <page string="Sales & Purchases" position="inside"> |
986 | 149 | <group colspan="2" col="2"> | 149 | <group colspan="2" col="2" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}"> |
987 | 150 | <separator string="Invoicing" colspan="2"/> | 150 | <separator string="Invoicing" colspan="2"/> |
988 | 151 | <field name="property_invoice_type"/> | 151 | <field name="property_invoice_type"/> |
989 | 152 | </group> | 152 | </group> |
990 | 153 | 153 | ||
991 | === modified file 'sale_stock/stock.py' | |||
992 | --- sale_stock/stock.py 2012-12-21 16:48:08 +0000 | |||
993 | +++ sale_stock/stock.py 2013-04-20 02:28:27 +0000 | |||
994 | @@ -53,7 +53,7 @@ | |||
995 | 53 | We select the partner of the sales order as the partner of the customer invoice | 53 | We select the partner of the sales order as the partner of the customer invoice |
996 | 54 | """ | 54 | """ |
997 | 55 | if picking.sale_id: | 55 | if picking.sale_id: |
999 | 56 | return picking.sale_id.partner_id | 56 | return picking.sale_id.partner_invoice_id |
1000 | 57 | return super(stock_picking, self)._get_partner_to_invoice(cr, uid, picking, context=context) | 57 | return super(stock_picking, self)._get_partner_to_invoice(cr, uid, picking, context=context) |
1001 | 58 | 58 | ||
1002 | 59 | def _get_comment_invoice(self, cursor, user, picking): | 59 | def _get_comment_invoice(self, cursor, user, picking): |
1003 | 60 | 60 | ||
1004 | === modified file 'sale_stock/test/picking_order_policy.yml' | |||
1005 | --- sale_stock/test/picking_order_policy.yml 2013-04-04 12:31:54 +0000 | |||
1006 | +++ sale_stock/test/picking_order_policy.yml 2013-04-20 02:28:27 +0000 | |||
1007 | @@ -5,6 +5,12 @@ | |||
1008 | 5 | - | 5 | - |
1009 | 6 | !assert {model: sale.order, id: sale.sale_order_6, string: The amount of the Quotation is not correctly computed}: | 6 | !assert {model: sale.order, id: sale.sale_order_6, string: The amount of the Quotation is not correctly computed}: |
1010 | 7 | - sum([l.price_subtotal for l in order_line]) == amount_untaxed | 7 | - sum([l.price_subtotal for l in order_line]) == amount_untaxed |
1011 | 8 | - | ||
1012 | 9 | I set an explicit invoicing partner that is different from the main SO Customer | ||
1013 | 10 | - | ||
1014 | 11 | !python {model: sale.order, id: sale.sale_order_6}: | | ||
1015 | 12 | order = self.browse(cr, uid, ref("sale.sale_order_6")) | ||
1016 | 13 | order.write({'partner_invoice_id': ref('base.res_partner_address_29')}) | ||
1017 | 8 | - | 14 | - |
1018 | 9 | I confirm the quotation with Invoice based on deliveries policy. | 15 | I confirm the quotation with Invoice based on deliveries policy. |
1019 | 10 | - | 16 | - |
1020 | @@ -110,13 +116,13 @@ | |||
1021 | 110 | !python {model: sale.order}: | | 116 | !python {model: sale.order}: | |
1022 | 111 | order = self.browse(cr, uid, ref("sale.sale_order_6")) | 117 | order = self.browse(cr, uid, ref("sale.sale_order_6")) |
1023 | 112 | assert order.invoice_ids, "Invoice is not created." | 118 | assert order.invoice_ids, "Invoice is not created." |
1025 | 113 | ac = order.partner_id.property_account_receivable.id | 119 | ac = order.partner_invoice_id.property_account_receivable.id |
1026 | 114 | journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)]) | 120 | journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)]) |
1027 | 115 | for invoice in order.invoice_ids: | 121 | for invoice in order.invoice_ids: |
1028 | 116 | assert invoice.type == 'out_invoice',"Invoice should be Customer Invoice." | 122 | assert invoice.type == 'out_invoice',"Invoice should be Customer Invoice." |
1029 | 117 | assert invoice.account_id.id == ac,"Invoice account is not correspond." | 123 | assert invoice.account_id.id == ac,"Invoice account is not correspond." |
1030 | 118 | assert invoice.reference == order.client_order_ref or order.name,"Reference is not correspond." | 124 | assert invoice.reference == order.client_order_ref or order.name,"Reference is not correspond." |
1032 | 119 | assert invoice.partner_id.id == order.partner_id.id,"Customer is not correspond." | 125 | assert invoice.partner_id.id == order.partner_invoice_id.id,"Customer does not correspond." |
1033 | 120 | assert invoice.currency_id.id == order.pricelist_id.currency_id.id, "Currency is not correspond." | 126 | assert invoice.currency_id.id == order.pricelist_id.currency_id.id, "Currency is not correspond." |
1034 | 121 | assert invoice.comment == (order.note or ''),"Note is not correspond." | 127 | assert invoice.comment == (order.note or ''),"Note is not correspond." |
1035 | 122 | assert invoice.journal_id.id in journal_ids,"Sales Journal is not link on Invoice." | 128 | assert invoice.journal_id.id in journal_ids,"Sales Journal is not link on Invoice." |
1036 | 123 | 129 | ||
1037 | === modified file 'stock/report/report_stock_move_view.xml' | |||
1038 | --- stock/report/report_stock_move_view.xml 2012-11-29 22:26:45 +0000 | |||
1039 | +++ stock/report/report_stock_move_view.xml 2013-04-20 02:28:27 +0000 | |||
1040 | @@ -149,7 +149,7 @@ | |||
1041 | 149 | <field name="location_id" filter_domain="[('location_id', 'child_of', self)]"/> | 149 | <field name="location_id" filter_domain="[('location_id', 'child_of', self)]"/> |
1042 | 150 | <field name="company_id" groups="base.group_multi_company"/> | 150 | <field name="company_id" groups="base.group_multi_company"/> |
1043 | 151 | <group expand="0" string="Extended Filters..."> | 151 | <group expand="0" string="Extended Filters..."> |
1045 | 152 | <field name="partner_id" context="{'contact_display':'partner'}"/> | 152 | <field name="partner_id" context="{'contact_display':'partner'}" filter_domain="[('partner_id', 'child_of', self)]"/> |
1046 | 153 | <field name="product_categ_id" /> | 153 | <field name="product_categ_id" /> |
1047 | 154 | <field name="prodlot_id"/> | 154 | <field name="prodlot_id"/> |
1048 | 155 | <field name="state"/> | 155 | <field name="state"/> |
1049 | 156 | 156 | ||
1050 | === modified file 'stock/stock_view.xml' | |||
1051 | --- stock/stock_view.xml 2013-03-18 13:43:43 +0000 | |||
1052 | +++ stock/stock_view.xml 2013-04-20 02:28:27 +0000 | |||
1053 | @@ -807,7 +807,7 @@ | |||
1054 | 807 | <filter icon="terp-check" name="available" string="Ready" domain="[('state','=','assigned')]" help="Assigned Internal Moves"/> | 807 | <filter icon="terp-check" name="available" string="Ready" domain="[('state','=','assigned')]" help="Assigned Internal Moves"/> |
1055 | 808 | <filter icon="terp-camera_test" name="confirmed" string="Waiting" domain="[('state','=','confirmed')]" help="Confirmed Internal Moves"/> | 808 | <filter icon="terp-camera_test" name="confirmed" string="Waiting" domain="[('state','=','confirmed')]" help="Confirmed Internal Moves"/> |
1056 | 809 | <filter icon="terp-dialog-close" name="done" string="Done" domain="[('state','=','done')]" help="Pickings already processed"/> | 809 | <filter icon="terp-dialog-close" name="done" string="Done" domain="[('state','=','done')]" help="Pickings already processed"/> |
1058 | 810 | <field name="partner_id"/> | 810 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
1059 | 811 | <field name="product_id"/> | 811 | <field name="product_id"/> |
1060 | 812 | <field name="stock_journal_id"/> | 812 | <field name="stock_journal_id"/> |
1061 | 813 | <group expand="0" string="Group By..."> | 813 | <group expand="0" string="Group By..."> |
1062 | @@ -934,6 +934,7 @@ | |||
1063 | 934 | <filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id', '!=', False)]" help="Is a Back Order"/> | 934 | <filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id', '!=', False)]" help="Is a Back Order"/> |
1064 | 935 | <separator/> | 935 | <separator/> |
1065 | 936 | <filter icon="terp-dolar" name="to_invoice" string="To Invoice" domain="[('invoice_state','=','2binvoiced')]" help="Delivery orders to invoice"/> | 936 | <filter icon="terp-dolar" name="to_invoice" string="To Invoice" domain="[('invoice_state','=','2binvoiced')]" help="Delivery orders to invoice"/> |
1066 | 937 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> | ||
1067 | 937 | <field name="stock_journal_id"/> | 938 | <field name="stock_journal_id"/> |
1068 | 938 | <field name="company_id" groups="base.group_multi_company"/> | 939 | <field name="company_id" groups="base.group_multi_company"/> |
1069 | 939 | <group expand="0" string="Group By..."> | 940 | <group expand="0" string="Group By..."> |
1070 | @@ -1059,6 +1060,7 @@ | |||
1071 | 1059 | <filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id', '!=', False)]" help="Is a Back Order"/> | 1060 | <filter icon="terp-accessories-archiver-minus" string="Back Orders" domain="[('backorder_id', '!=', False)]" help="Is a Back Order"/> |
1072 | 1060 | <separator/> | 1061 | <separator/> |
1073 | 1061 | <filter string="To Invoice" name="to_invoice" icon="terp-dolar" domain="[('invoice_state', '=', '2binvoiced')]"/> | 1062 | <filter string="To Invoice" name="to_invoice" icon="terp-dolar" domain="[('invoice_state', '=', '2binvoiced')]"/> |
1074 | 1063 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> | ||
1075 | 1062 | <field name="stock_journal_id"/> | 1064 | <field name="stock_journal_id"/> |
1076 | 1063 | <field name="product_id"/> | 1065 | <field name="product_id"/> |
1077 | 1064 | <group expand="0" string="Group By..."> | 1066 | <group expand="0" string="Group By..."> |
1078 | @@ -1370,7 +1372,7 @@ | |||
1079 | 1370 | <filter icon="terp-go-today" string="Today" domain="[('date','<=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','>=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders processed Today or planned for Today"/> | 1372 | <filter icon="terp-go-today" string="Today" domain="[('date','<=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','>=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders processed Today or planned for Today"/> |
1080 | 1371 | <field name="product_id"/> | 1373 | <field name="product_id"/> |
1081 | 1372 | <field name="name" string="Location" filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/> | 1374 | <field name="name" string="Location" filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/> |
1083 | 1373 | <field name="partner_id" string="Partner" filter_domain="[('picking_id.partner_id','ilike',self)]"/> | 1375 | <field name="partner_id" string="Partner" filter_domain="[('picking_id.partner_id','child_of',self)]"/> |
1084 | 1374 | <field name="prodlot_id"/> | 1376 | <field name="prodlot_id"/> |
1085 | 1375 | <group expand="0" string="Group By..."> | 1377 | <group expand="0" string="Group By..."> |
1086 | 1376 | <filter string="Product" name="by_product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/> | 1378 | <filter string="Product" name="by_product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/> |
Hi,
First thanks for that work Olivier! My comments are here : https:/ /bugs.launchpad .net/openobject -addons/ +bug/1160365/ comments/ 34
Regards,
Joël