Merge lp:~openerp-dev/openobject-addons/trunk-asset-amortization into lp:openobject-addons

Proposed by Chirag Dodiya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-asset-amortization
Merge into: lp:openobject-addons
Diff against target: 1798 lines (+878/-200)
16 files modified
account/res_config.py (+5/-3)
account_asset/__openerp__.py (+11/-5)
account_asset/account_asset.py (+176/-62)
account_asset/account_asset_demo.xml (+58/-17)
account_asset/account_asset_invoice.py (+4/-3)
account_asset/account_asset_invoice_view.xml (+15/-2)
account_asset/account_asset_view.xml (+385/-84)
account_asset/report/account_asset_report.py (+12/-8)
account_asset/report/account_asset_report_view.xml (+88/-5)
account_asset/static/src/js/account_asset.js (+22/-0)
account_asset/test/account_asset_demo.yml (+1/-1)
account_asset/test/account_revenue_recognition.yml (+54/-0)
account_asset/test/account_revenue_recognition_demo.yml (+9/-0)
account_asset/wizard/account_asset_change_duration.py (+6/-3)
account_asset/wizard/wizard_asset_compute.py (+5/-2)
account_asset/wizard/wizard_asset_compute_view.xml (+27/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-asset-amortization
Reviewer Review Type Date Requested Status
Turkesh Patel (openERP) Pending
Review via email: mp+194827@code.launchpad.net

Description of the change

Hello,

      I have improved view of Asset,Asset Categories and Revenue Recognition and added demo data for sales type and added yml test for revenue and recognition.

Thanks,
Chirag Dodiya(cod).

To post a comment you must log in.
8971. By van der Essen Frédéric (OpenERP)

[IMP] point_of_sale: fixes and performances optimisations

8972. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8973. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8974. By Quentin (OpenERP) <email address hidden>

[FIX] account_payment: amount_residual doesn't have a fct_search so it should be replaced by something else

8975. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8976. By Olivier Dony (Odoo)

[REM] base_crypt translation deactivated - module renamed to auth_crypt

8977. By Xavier (Open ERP)

[REM] undead web_shortcuts

8978. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8979. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8980. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8981. By van der Essen Frédéric (OpenERP)

[IMP] point_of_sale: allow up to 8 simultaneous payment methods to be displayed at once

8982. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8983. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8984. By Martin Trigaux (OpenERP)

[REF] project_issue: remove unused method convert issue to task (button was removed from view at rev 6898)

8985. By Martin Trigaux (OpenERP)

[ADD] procurement: add skip_exception parameter on scheduler allowing to have more frequent scheduler only testing confirmed picking

8986. By Martin Trigaux (OpenERP)

[REF] procurement: remove legacy code in scheduler from 6.1

8987. By Martin Trigaux (OpenERP)

[FIX] project_issue: remove test checking the convert_issue_task feature

8988. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8989. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] Addons: updated some field labels to avoid duplicates to ease
the import / export process

Aso includes
- project: deprecated priority field: use sequence instead
- base_calendar: calendar.event: deprecated organizer field: use organize_id instead

8990. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] mail: invite wizard: the option of sending an email when inviting someone
is now checked by default.

8991. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] chatter: improved 'Log a note'
- the button is now only displayed for employee users. This is done
by overriding the fields_view_get in mail.thread and adding options
to the widget according to the groups the user belongs to. Indeed
it is currently not possible to set widget options specific to
some groups. Therefore an override of fields view get was
necessary.
- small layout improvements: Log a note -> Log an internal note,
background color of notes updated.

8992. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-2 up to revid 9010 <email address hidden>

8993. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8994. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-2 up to revid 9017 <email address hidden>

8995. By Quentin (OpenERP) <email address hidden>

[MERGE] improvements of 'post entry' wizard in order to allow the selection of several journals and several periods. Courtesy of Alexis de Lattre (Akretion)

8996. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8997. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] [REV] crm, addons: still stage/state tweaking
- crm: Mark Won / Lost buttons are back
- crm: now using the new 'fold_field' option to fold some stages on the fold
field of stages. Back to saas-1 bebavhior.
- project, project_issue: task and issue also use the fold_field option.
- project: fixed 'X Tasks' display on the project vignette: now always displaying
'X Tasks at plural form to simplify the view

8998. By Christophe Simonis (OpenERP)

[FIX] base_calendar: do not use deprecated field `organizer`

8999. By Christophe Simonis (OpenERP)

[FIX] auth_signup: no alias for signuped users

9000. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9001. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-2 up to revid 9024 <email address hidden>

It’s over NINE THOUSAAAAAAAND!

9002. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9003. By Antony Lesuisse (OpenERP)

[MERGE] bootstrap3

9004. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9005. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-2 up to revid 9029 <email address hidden>

9006. By Thibault Delavallée (OpenERP)

[IMP] [FIX] mail: mail_thread: routing: check for exact message_id.

When processing an incoming email, we try to find a parent for the email based on references. Before this merge, it was done using openerp-<model-<res_id> pattern. However it is buggy. Indeed having two OpenERP sending emails to each other leads to messages being inserted in a wrong thread (model and res_id of the first OpenERP for both instances).

Now we search for an exact match between the references and the stored message_ids. As each message_id can be considered as unique the number of collisions is lessened. This won't cause any issues with OpenERP >= 7.0.

A compatibility mode is implemented for <= 6.1: as in those versions the message_id is not stored, we fall back on the previous behavior for records having messages without message_id. This indicates that the record was created before 7.0.

Tests have been updated accordingly, and a test added for the compatibility mode.

9007. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] crm, sale_crm: improved sales team kanban view

Including:
- sales team members are displayed
- fixed sparklines whose numbers were incorrect
- sparklines now redirect to a correct report view, filtered for the sales team, grouped by month, in order to have matching results between the vignette links and the displayed reports
- custom css in crm put in a sass file
- sale_crm extend the crm reports, to add the section_id field in the reports, allowing to filter / group by salesteam. The analysis view has been put into several methods to allow extension.

9008. By Martin Trigaux (OpenERP)

[MERGE] [FIX] account_anglo_saxon: at invoice validation, the price for the analytic lines should be computed using the price_unit of the related stock.move instead of the product standard price (useful if different valuation method, could have price difference between delivery and invoice time)

9009. By Thibault Delavallée (OpenERP)

[MERGE] [FORWARD] Forward port of saas-2 branch until revision 9036 (revid <email address hidden>)

9010. By Thibault Delavallée (OpenERP)

[TESTS] mail: mute logger back in mail tests

9011. By Martin Trigaux (OpenERP)

[MERGE] [FIX] res_font: requires server commit 5011
Mainly fix reports
Adapt API to new res_font methods
See server commit message for more information

9012. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9013. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9014. By Thibault Delavallée (OpenERP)

[IMP] hr: minor usability improvements
- hr_holidays: renamed My Leaves filter by My Requests, more accurate
- hr_recruitment: string of name field is not Subject / Application Name, more accurate; this string is used in the search view also.

9015. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9016. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9017. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9018. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9019. By Martin Trigaux (OpenERP)

[MERGE] forward port of latest saas-2 until rev 9051 <email address hidden>

9020. By Denis Ledoux (OpenERP)

[FIX] hr: merge of views Leave Request & Allocation request, as they are allmost similar.

Moreover, before this fix, when you clicked on an allocation request from a mail.message (for instance, from the messaging inbox page), you were not redirected to the right view: You were redirected to the view of Leave request instead of Allocation request.

9021. By Thibault Delavallée (OpenERP)

[MERGE] [FIX] mail: fixed group button position that was too much dependent of the group description length
[IMP] project: removed unnecessary code in project to try to be able to move kanban records in a folded column (was not working + generic solution coming)

9022. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9023. By Thibault Delavallée (OpenERP)

[FORWARD] Forward port of saas-2 fixes until revision 9058 (revid <email address hidden>)

9024. By Thibault Delavallée (OpenERP)

[MERGE] [ADD] hr_applicant_document module: link between hr_recruitment and document modules. It allows to search through the indexed content of documents attached to applicants, such as resumes, CVs, ...

[IMP] hr.recrutment.stage: added template_id field. If the stage is linked to a template, a message is posted on the applicant when the applicant is moved into this stage. This allows to automatically send an email when approving or refusing an applicant. We usually define server action to achieve that behavior, it is now standard.

[IMP] hr.applicant: added a field to have the number of indexed documents + links in the applicant kanban view to jump to the applicant's documents.

9025. By Martin Trigaux (OpenERP)

[MERGE] [ADD] gamification

New modules gamification, hr_gamification, gamification_sale_crm, portal_gamification.

Merry Christmas OpenERP

9026. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9027. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9028. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9029. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9030. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9031. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9032. By Thibault Delavallée (OpenERP)

[MERGE] account: cash register view improvements
- now looking like cash control methods from the point of sale module.

point of sale: improved some tooltips + cash control form view improvements

9033. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] hr: changed some pictures of employees in demo data to avoid copyright issues

9034. By Thibault Delavallée (OpenERP)

[FORWARD] Forward port of latest saas-2 fixes, until revision 9062 (revid <email address hidden>)

9035. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9036. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9037. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9038. By Martin Trigaux (OpenERP)

[ADD] project: add change_default parameter on project_id field of project.task. This allows to set default values depending on project through ir.values.

9039. By Stephane Wirtel (OpenERP)

[MERGE] Extract the base64 encoded images from the xml files lp:~openerp-dev/openobject-addons/trunk-extracted_img-stw

9040. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: big point of sale upgrade for posbox campaign

9041. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9042. By Martin Trigaux (OpenERP)

[IMP] project: remove duplicated field complete_name (already present in account.analytic.account)

9043. By van der Essen Frédéric (OpenERP)

[MERGE] better management for python dependencies of the hardware driver modules

9044. By Martin Trigaux (OpenERP)

[MERGE] [FIX] account: accounting periods in demo data are no longer opening periods, create a new period_0 as opening period

9045. By Stephane Wirtel (OpenERP)

[FIX] hr_holidays: Use osv.except_osv instead exceptions.Warning, because
Warning does not inherit from osv.except_osv and this exception is not catched
by the system.

9046. By Stephane Wirtel (OpenERP)

[FIX] project_timesheet: supply_method is implemented in the module
'procurement' but this one is not in the dependencies of project_timesheet.

9047. By Stephane Wirtel (OpenERP)

[FIX] hr_holidays: Reverse previous patch with the warning

9048. By Xavier (Open ERP)

[FIX] pillow-compatible Image import

9049. By jke-openerp

[MERGE] Merge with trunk-cal-jke

New calendar :
   Component changed : dHtml into Jquery FullCalendar
   Manage recurrency
   Manage alarm with notif/mail
   oAuth google 'web app'
   Manage coworker / Favorite
   Use avatar for attendee and filter
   Manager calendar by partner and not user
   Your events are now event where you are attendees and not events that you have created
   Manage quick_create, Quick_view, ...

Rename module google_base_account into google_account
Rename module base_calendar into calendar
New module Google Calendar

9050. By Christophe Simonis (OpenERP)

[FIX] point_of_sale: let the session generate a session_id itself

9051. By jke-openerp

[MERGE] Merge with trunk-ren-crmmeeting

This commit replace all occurences of "crm.meeting" into "calendar.event" and "crm_meeting" into "calendar_event".
It remove 2 fields unused from calendar.event model and from the tests.
Add oe_update_date in exclude field, to allow the update of recurrence if field(s) updated are only in this exclu list

9052. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-2 up to revid 9092 <email address hidden>

9053. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9054. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9055. By Raphael Collet (OpenERP)

[FIX] calendar: type of related field should be 'integer', not 'int'

9056. By Raphael Collet (OpenERP)

[FIX] calendar: function field of type 'selection' must be given a selection parameter

9057. By Christophe Simonis (OpenERP)

[FIX] edi: /edi/import_edi_url route is a json route

9058. By Christophe Simonis (OpenERP)

[IMP] calendar: tell orm to rename old select1 column

9059. By Thibault Delavallée (OpenERP)

[MERGE] [REF] [IMP] base_action_rule: allow using a resource.calendar to compute
day-based timing conditions.

[REF] resource: cleaned, refactored and improved code for resource.calendar
module. Old API is kept for backward compatibility.
[TESTS] resource: added tests for the new implementation of the various
methods.

[IMP] base_action_rule: using the resource module, added the possibility
to specify a resource.calendar to compute day-based timing conditions.

[IMP] hr_contract: added an override of base action rule to add the possibility
of using an employees's resource.calendar to compute day-based timing
conditions.

9060. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: further point of sale and hardware integration improvements

9061. By Thibault Delavallée (OpenERP)

[MERGE] [ADD] product_email_template new module. It allows ot send template-based emails when validating invoices. This allows to send description, user guides, technical datasheets, ... when selling products.

product_template inheritance: added email_template_id field, link to an optional email.template

invoice inheritance: when validating the invoice, send an email for each product that has a linked email.template.

email_template inheritance: defined a new simplified form view with only attachment_ids and body, to ease the quick edition of email templates. This simplified form view is used for the email_template_id field on the product.template form view.

email_template: when having default_model in default_get, use it to prefetch model_id. Indeed model is a related file, we have to redirect its default to the right model_id field.

9062. By Denis Ledoux (OpenERP)

[MERGE][ADD] crm: apply deduplication for mass converting leads to opps

9063. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: hardware proxy reliability improvements

9064. By Géry Debongnie

[IMP] merge all the modifications concerning the new graph view. It mainly changes the reporting views to use the pivot table as default.

9065. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9066. By Antony Lesuisse (OpenERP)

[IMP] hr.department cleanup
- Consolidate multiple hr.departement definition into hr.py file
- Remove ulgy department_users_get() domain hack on act_window
- Add the jobs_ids inverse relationship from departement to jobs

9067. By van der Essen Frédéric (OpenERP)

[MERGE] hw_scanner fixes

9068. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: regression fix

9069. By Fabien Meghazi (OpenERP)

[REM] POS: Replaced auth="admin" by auth="none"

9070. By van der Essen Frédéric (OpenERP)

[MERGE] hw_escpos: moving list of supported printers to a separate file

9071. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-2 up to revid 9109 <email address hidden>

9072. By Christophe Simonis (OpenERP)

[FIX] calendar: use correct xmlid

9073. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: receipt printing reliability improvements

9074. By Fabien Meghazi (OpenERP)

[IMP] Use CORS in pos (only two routes)

9075. By Fabien Meghazi (OpenERP)

[ADD] POS: added cors argument to all routes

9076. By Géry Debongnie

[MERGE] merge trunk-new-graphview-ged into trunk (mainly work on the reporting views to use the new pivot table view)

9077. By Fabien Meghazi (OpenERP)

[IMP] Use cors in pos devices.js

9078. By van der Essen Frédéric (OpenERP)

[FIX] point_of_sale: add port and protocol to forced proxy ip if necessary

9079. By van der Essen Frédéric (OpenERP)

[IMP] point_of_sale, hw_escpos: hopefully much faster printing on the posbox by caching logo conversion

9080. By Antony Lesuisse (OpenERP)

[MERGE] trunk-website-al

9081. By Antony Lesuisse (OpenERP)

[REV] website qweb dont change exception types

9082. By Olivier Dony (Odoo)

[IMP] website themes: simpler wording

9083. By Fabien (Open ERP)

[IMP] missing picture

9084. By Olivier Dony (Odoo)

[IMP] website apps flagged as such: website, website_event (replaces event), website_blog, website_sale

9085. By Olivier Dony (Odoo)

[FIX] website*: no border for customer/reseller/member entries + extra bottom margin on left column

9086. By van der Essen Frédéric (OpenERP)

[IMP] point_of_sale: increased size of logo on receipt

9087. By Niko (OpenERP)

[IMP] Add some video to manisfest ( website, website_blog, website_event, website_ecommerce)

9088. By Fabien Meghazi (OpenERP)

[REV] Bring back QWebExceptions

9089. By van der Essen Frédéric (OpenERP)

[FIX] point_of_sale: update redirection system with the website-al changes

9090. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9091. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9092. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9093. By Martin Trigaux (OpenERP)

[MERGE] Forward port of saas-3 branch up to revid 9093 <email address hidden>

9094. By van der Essen Frédéric (OpenERP)

[MERGE] hw_escpos: fixes for the cashbox opening

9095. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: open the cashbox on payment validation

9096. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9097. By Fabien (Open ERP)

[IMP] better layout for 'no blog post'

9098. By Fabien (Open ERP)

[IMP] event empty message

9099. By Fabien (Open ERP)

[IMP] typo

9100. By Fabien Meghazi (OpenERP)

[FIX] website.menu#url shall not be required=True

A parent node's url is not clickable in the website front-end

9101. By Thibault Delavallée (OpenERP)

[MERGE] sales/crm: minor improvements in account_analytic_analysis, crm, event_sale, hr_timesheet_invoice, sale views

9102. By Olivier Dony (Odoo)

[REM] remove empty modules after renaming the templates in Launchpad Translations

9103. By Fabien (Open ERP)

[IMP] Empty product page

9104. By Fabien (Open ERP)

[IMP] Simplify snippet so that they are useabile out-of-the-box

9105. By Fabien (Open ERP)

[IMP] Reduce images, all images at same size for 3col snippets

9106. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9107. By Thibault Delavallée (OpenERP)

[MERGE] [ADD] website: added support for calling a server action through a new controller, allowing to build website pages through server action.

website: added website/action/<id_or_xml_id> route, that runs the server action designed by its id or xml_id. Only published code server action are run. If the server action returns a response (for example the result of a template rendering), it is returned as result of the controller. This allows to have server action returning a rendered template, to display custom website pages based on some computation.

website: added an override of ir_actions_server:
- added website_published field: only published server action can be run + view update
- evaluation context gets request for evaluation, to enable request.render(template) or request.params.get(key) in order to retrieve the result of a form
- code server action returns 'response' the same way 'action' can be returned for classic code server action

9108. By Fabien (Open ERP)

[FIX] layout bug, right alignment of blocks incorrect

9109. By Christophe Matthieu (OpenERP)

[MERGE] Microformats (microdata) support for improved SEO.

Supported formats:
 - Organization
   https://support.google.com/webmasters/answer/146861?hl=en&ref_topic=1088474
   http://schema.org/Organization
 - Event
   https://support.google.com/webmasters/answer/164506?hl=en&ref_topic=1088474
   http://schema.org/Event
 - Product+Offer
   https://support.google.com/webmasters/answer/146750#offer_properties
   http://schema.org/Product
   http://schema.org/Offer

Tested with http://www.google.com/webmasters/tools/richsnippets

9110. By Fabien (Open ERP)

[IMP] logo by default (easier to configure)

9111. By Fabien (Open ERP)

[IMP] insert a banner --> build a page

9112. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] account: payment term configuration: do not fool people by
telling them to enter a percentage when openerp actually waits for a decimal.
Therefore removed the percentage symbol.

9113. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] product: added data for american units of measure + 1 yml test

9114. By Fabien (Open ERP)

[IMP] reduced image size

9115. By Fabien (Open ERP)

[IMP] tutorial banner

9116. By Fabien (Open ERP)

[IMP] small useability trick to avoid people writing several keywords in the same input

9117. By Fabien (Open ERP)

[IMP] Buttons snippet

9118. By Fabien (Open ERP)

[IMP] less black snippet border

9119. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9120. By Antony Lesuisse (OpenERP)

[MERGE] saas-3

9121. By Antony Lesuisse (OpenERP)

[FIX] disable http test before conversion

9122. By Antony Lesuisse (OpenERP)

[IMP] test_ui conversion, needs validation from chm

9123. By Antony Lesuisse (OpenERP)

[IMP] website test shorter code

9124. By Antony Lesuisse (OpenERP)

[IMP] website test_ui simplification

9125. By Antony Lesuisse (OpenERP)

[FIX] website_event tests

9126. By van der Essen Frédéric (OpenERP)

[MERGE] forward porting fixes from saas-3

9127. By van der Essen Frédéric (OpenERP)

[FIX] hw_escpos: status receipt would not print on the posbox

9128. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9129. By Fabien (Open ERP)

[IMP] Pantone colors of the year

9130. By Fabien (Open ERP)

[IMP] reduce image size, faster preview

9131. By Christophe Matthieu (OpenERP)

[FIX] website: crappy layout when use click on edit in the shop. Microforma error. Don't use meta tag in page content: ckeditor bug report 8117.

9132. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] hr, hr_recruitment: job position update and usability improvements

hr: hr.job
- no_of_recruitment now indicates the number of employees you want to hire in a given recruitment phase
- added no_of_hired_employee that is the number of employees already recruited in the current recruitment phase
- updated form view
- removed simplified form view
- the job in the employee form view is now clickable and redirects to the job form view

hr_recruitment
- new dependency: web_kanban_gauge
- installing this module adds the 'Job Positions' menu, and adds a new kanban view for hr.job
- adds fields on hr.job to track applicants and their documents, used in the kanban view
- added configuration for default jobs alias, available in the Human Resources settings
- updated applicant / job subtypes: following some subtypes on the job now makes automatically follow some subtypes on applicants, like salesteam/opportunities or project/tasks and issues

mail: mail_alias
- when migrating to alias, use mail_notrack to avoid performing the tracking; indeed we are in a transient state, and trying to browse and track value change is risky.
mail: mail_thread: empty list help: small tweak to try to find a default alias

misc
- sale_crm: update for the new gauge widget parameters

9133. By Thibault Delavallée (OpenERP)

[MERGE] mrp: small usability fixes
- updated groups on some fields of bom
- removed some icons in form view, to be coherent with other form views
- BOM form view: updated onchange_product_id that now takes product_qty into account to compute
uos and uos quantity.

9134. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: allow negative product quantities and totals in the POS

9135. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9136. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] misc usability improvements
- account: add a name when invoking some journal items views
- calendar: removed an editable in event.type tree view
- phonecalls: removed default searchs in logged / scheduled calls actions, using domain instead; small fix in meeting creation from a phonecall, use partner_ids instead of partner_id
- report_webkit: some menu reordering

9137. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] website: server actions: usability improvements
- added website_path, used to compute the full URL allowing to access the server action. This allows more custom and short URLs, like website/action/partners instead of website/action/website.action_partners;
- added website_url, computed file with the full URL of the server action that is displayed on the form view, to ease usability.
- added a filter for server action, to easily find code and published server actions
- updated server action controller: now takes xml_id, id, or website_path

9138. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] account, analytic, project: misc usability improvements.
Small improvements and fixes in label of views, added some strings, cleaned
some tooltips, updated a project data.

9139. By van der Essen Frédéric (OpenERP)

[IMP] hw_scanner: remove useless controller

9140. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9141. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] crm: added default alias configurable directly in sales configuration menu. This default alias is an alias creating leads, not linked to a specific thread or parent.

Like what has been done in HR recently, it is now possible to directly configure a default alias for leads in the sales configuration menu. This allows an easier alias configuration compared to directly editing the aliases.

[FIX] hr: fixed default alias computation.

9142. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] website_mail: email template visual editor:
- reordered email snippets: 2 categories with clearer name, holding basic and advanced email structures
- email_template: better display of the front-end link
- email designer: added a link to the backend
- added forgotten dependency towards email_template

9143. By Martin Trigaux (OpenERP)

[ADD] gamification: i18n translation files

9144. By Christophe Simonis (OpenERP)

ಠ_ಠ

9145. By Xavier (Open ERP)

[REM] spurious print in test

9146. By Christophe Matthieu (OpenERP)

[IMP] website: remove bootstrap in addons/website and use bootstrap from web

9147. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9148. By Antony Lesuisse (OpenERP)

[FIX] website tests

9149. By Antony Lesuisse (OpenERP)

[FIX] website_sale enable some tests

9150. By Antony Lesuisse (OpenERP)

[FIX] website_sale disable some tests

9151. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9152. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] accounting: usability
- bank statement form view: partner is usually a supplier, add default suplier
is context of partner_id
- bank account form view: bank bic not required anymore

9153. By Fabien Meghazi (OpenERP)

[FIX] website's slug() should check if slugified string is empty

9154. By Thibault Delavallée (OpenERP)

[FIX] fleet: vehicle cost name field unhacked.
- remove name composition based on vehicle name, date and cost_subtype_id;
instead those fields have been added to the tree view. name field is now just
a related to the vehicle name, but the name field itself does not seem necessary
anymore. Should be checked further.

9155. By Xavier (Open ERP)

[FIX] re-enable crawler tests

Move URLCase back out of the test module, otherwise loadTestFromModule
attempts to load it in the usual manner (~URLCase('runTest')). Which does not
work at all, because that's not what URLCase is for.

URLCase extends TestCase to benefit from the TestCase.run infrastructure
(running tests, filling result object, etc...)

9156. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] point of sale: usability: label typos + help in menus

9157. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] website: server action: add a widget url in the form view on the website_url field.
Seems quite logical.

9158. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] hr: broadcast the welcome message only for new employee coming
from the recruitment, not all created employees.
Before this merge, every created employee was broadcasted to all existing users
of the same company. However when creating a batch of employees, for example
when configuring an new openerp instance, this was creating a lot of noise
in the inboxes.
Now, only recruited employee have a welcome message.

9159. By van der Essen Frédéric (OpenERP)

[MERGE] hw_proxy: posbox documentation

9160. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9161. By Xavier (Open ERP)

[IMP] remove pointless semicolons, use @expectedFailure instead of commenting broken test

9162. By Xavier (Open ERP)

[FIX] imports, use @expectedFailure, simplify some inject specs

9163. By Thibault Delavallée (OpenERP)

[IMP] note: user_id owner field added in model, allowing to tune a bit
the access rules, notably about reading and creation. This allows by the way
to remove the hack about the operation in context when subscribing
users on a document.
The new rules on create and read now include user_id, aka the owner of a note
can always create (default value) and read its notes.
Also removed an unnecessary field (current_partner_id), as it was buggy and
unnecessary; view udpated accordingly.

[IMP] mail: removed a hack introduced in saas-3 with the current orm operation
in context to by-pass some access rules when subscribing someone on a document.

9164. By Xavier (Open ERP)

[FIX] typo method name

9165. By Xavier (Open ERP)

[REM] broken and PITA test_02_public_login_logout

* / fails to load, it turns out Tour is undefined because unlogged home does
  not load bootstrap-tour

* after injecting bootstrap-tour, redirects to /login (to log in), tries to
  inject tour again except this time ``openerp.website`` is completely empty
  (although it is present on the page), no idea why.

removed test because whatever, if enable-test-fix-tour is ever rewritten and
fixed it may reappear.

9166. By Xavier (Open ERP)

[FIX] re-enable website_sale tests because they pass so whatever

9167. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9168. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-2 up to revid 9195 <email address hidden>

9169. By Christophe Simonis (OpenERP)

[FIX] mail: fix IndentationError introduced in last commit

9170. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9171. By Christophe Simonis (OpenERP)

[FIX] website: bootstrap is now in web module

9172. By Thibault Delavallée (OpenERP)

[FIX] mail: fixed regression caused by forward-porting saas-3: re-removed
the hack in mail_thread about subscription in create mode.

9173. By Thibault Delavallée (OpenERP)

[CLEAN] gamification: removed .moved folder, added when forward porting
saas-3 into trunk.

9174. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] mail: subtype: order by application + allow to hide technical subtypes + updated addons subtypes

- mail.message.subtype:
-- added sequence field, used to order subtypes when displaying them
-- added hidden field, used to hide some subtypes. Subtypes like 'Task Created' or 'Issue Created' are not necessary on a task or issue, but useful on the project form view. Indeed by following the task created subtype on the project, the user is notified of new tasks. However on the task itself it makes no sense to be able to follow task created. This subtype has to exist due to the technical implementation, but should be hidden in the followers widget of the task.
- mail: updated followers widget accordingly, and display subtypes by application with a visual border to separate them

- project, crm, sale_crm: updated hidden and sequence of subtypes

9175. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9176. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9177. By Fabien (Open ERP)

[IMP] Allow to press select where you want the new line

9178. By Fabien (Open ERP)

[IMP] 3 cols to respect icon and make it easier for new users to start with

9179. By van der Essen Frédéric (OpenERP)

[FIXME] deactivated failed tests to make the runbot green again

9180. By van der Essen Frédéric (OpenERP)

[MERGE] hw_proxy: improvements to the posbox documentation

9181. By Fabien Meghazi (OpenERP)

[IMP] Rename request.httprequest.session -> request.session

9182. By Fabien Meghazi (OpenERP)

[IMP] Improvement/changes to the http request/response API.

- Get rid of LazyResponses
- Made website.render() an alias to request.render() [just kept in case this is merged in saas-3 but should be removed completely in favor of request.render()]

Need server/trunk's rev#5102

9183. By Fabien (Open ERP)

[IMP] Event Security Fix + Publish Track

9184. By Fabien Meghazi (OpenERP)

[IMP] seperation of auth_signup's reset password and signup routes

9185. By Fabien Meghazi (OpenERP)

[FIX] ensure_db() on inherited /web/login controllers

9186. By sle-openerp

[MERGE] Report module: reporting using the QWeb rendering engine. Sale, purchase, mrp and mrp_repair reports are converted.

9187. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9188. By Xavier (Open ERP)

[ADD] deduplication of website images being uploaded

There is a deduplication in ir.attachment, but it's only for FS-stored content
*and* it only deduplicates storage not models (as there are access rights
issues involved).

The goal here is to always return the same attachment when a user uploads the
exact same image multiple times (because it's simpler or whatever).

Initially tried to use a binary field & digest(), but search() blows up
because it tries to utf-8 encode raw binary data. So use char & hexdigest
instead.

_compute_checksum returns None if the provided attachment data does not look
like a website image attachment.

Unhandled: multiple existing matches, maybe a UNIQUE constraint on the
checksum field would be a good idea just in case.

cherrypicked from saas-3's <email address hidden>
which had to be backed out (as the patch adds a new stored field)

9189. By Thibault Delavallée (OpenERP)

[MERGE] [ADD] crm_project_issue module: create issues from leads.
This bridge and optional module add a button on the lead form view to
allow users to create issues from leads. The lead is distroyed during
the operation. All communication history is kept and transferred to the
new issue.

9190. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] mail: added message_last_update field. This field is a datetime field, updated everytime message_post in called. This allows to build filters, search or actions based on the last message date, for reporting for example.

Weekly groupbys have been added in project_issue and crm, for leads and opportunities.

9191. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9192. By Antony Lesuisse (OpenERP)

[IMP] report form view move inherited view, restore and refactor test case (kept commented atm) from non merged branch qweb-report

9193. By Antony Lesuisse (OpenERP)

[IMP] report, form view hide paperformat when not needed

9194. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9195. By Xavier (Open ERP)

[FIX] don't fail installation entirely if pyPdf isn't available

should print an error message though

9196. By Fabien Meghazi (OpenERP)

[FIX] Properly redirect in case of invalid url slugs

Use werkzeug's api instead of doing hackish url replacement

9197. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-3 up to revid 9298 <email address hidden>

9198. By sle-openerp

[MERGE][FIX] Download of a report was broken because of a slash at the end of the route used by 'get_file'

9199. By jke-openerp

[FIX] Uncomment tests which fail

9200. By Christophe Matthieu (OpenERP)

[IMP] website_crm: contact form improvement
get argument are processed and set into input fields + hidden fields
save some datas from http headers
controller should save all the submitted vars

9201. By Xavier (Open ERP)

[FIX] sprurious widgetification and editability of icon elements

* tighten widget match: don't match elements with .fa which are also "view
  section" roots (~ editing hosts) as the classes themselves out not be
  editable and the result will thus be odd
* correspondingly, only associate the icon "change" button to instances of the
  ``icons`` widget, other elements bearing ``.fa`` are not editable and should
  be excluded.

9202. By Fabien Meghazi (OpenERP)

[FIX] website#ir.http: do not postprocess arguments on non `website_enabled` endpoints

9203. By Antony Lesuisse (OpenERP)

[MERGE] db dump/restore new zip based file format

9204. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9205. By Xavier (Open ERP)

[IMP] don't allow HTML formatting in non-HTML fields

9206. By Xavier (Open ERP)

[IMP] context-sensitivity of toolbar commands (kinda, attempted)

9207. By Xavier (Open ERP)

[FIX] CSS of link style pane

9208. By jke-openerp

[IMP] Calendar - Add redirect to calendar module after the install of it

9209. By Christophe Matthieu (OpenERP)

[IMP] website snippet: remove data-snippet-id and use only jquery selectors. Snippets became only dom item and options is transversal. Create dynamic snippet

9210. By Christophe Matthieu (OpenERP)

[FIX] website_sale,website_event: can't create product and event. Why: controller and route are strict mode, remove / at the end of the route

9211. By jke-openerp

[FIX] Revert commit 9208 - Calendar is a module auto install. So we dont need to redirect

9212. By Fabien (Open ERP)

[IMP] Subscribe data

9213. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9214. By Christophe Matthieu (OpenERP)

[MERGE] website: add optional 'action' in managment edit button to laod one specific backend view

9215. By Christophe Matthieu (OpenERP)

[FIX] website: can't see edit button because css with overflow hidden for all tag. Aplly css only on carousel, paralax and blockquote

9216. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9217. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9218. By Fabien (Open ERP)

[MERGE] Mailing List Archives for Website

9219. By Antony Lesuisse (OpenERP)

[FIX] website tests crawler, admin password != super admin password

9220. By Antony Lesuisse (OpenERP)

[FIX] website test, remove useless test, waitfor banner fix

9221. By Antony Lesuisse (OpenERP)

[FIX] website tour, prepare for manual injection
- reorder website.js in a choerent way
- remove injectable website.tour.test.js

We will do injection manually using website.inject_tour, in the mean time only
non injection test are supported, fully disable test needing inject, until fme
merge its fix.

9222. By Antony Lesuisse (OpenERP)

[FIX] website_mail_group remove demo from manifest

9223. By Antony Lesuisse (OpenERP)

[FIX] website_sale disabling tests while i rewrite Tour

9224. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9225. By Christophe Matthieu (OpenERP)

[FIX] website tour: create a stub for bootstrap tour in automatic/test mode (need for full test and hide real bug for tour test)

9226. By Xavier (Open ERP)

[ADD] support for presized fields in website/image

also add presized field to attachments (automatically computed from datas)

9227. By Christophe Matthieu (OpenERP)

[FIX] website: typo: message let the user think that he can change the mobile view while he cannot

9228. By Christophe Matthieu (OpenERP)

[FIX] website: readability block with container css

9229. By Xavier (Open ERP)

[FIX] inject WORD JOINER inside p so they don't seemingly disappear after saving

9230. By Christophe Matthieu (OpenERP)

[FIX] website tour: typo for banner (from usertest feedback)

9231. By Xavier (Open ERP)

[FIX] reduce span of paragraph spacer thing to not break layout

9232. By Christophe Matthieu (OpenERP)

[FIX] website: The user does not see the content menu because of the tutorial is hover

9233. By Christophe Matthieu (OpenERP)

[FIX] website_sale: display empty message for public user and allow admin to edit 'no product found' message

9234. By Christophe Matthieu (OpenERP)

[IMP] website snippet: add onblur, onfocus, onremove, onclone method on snippet options. Change data-class into data-value for designer comprehention; fix slider unique id

9235. By Xavier (Open ERP)

[FIX] website: set inherit_branding in test contexts to trigger generation of relevant edition attributes

9236. By Christophe Matthieu (OpenERP)

[IMP] website: snippet editor: change size automatic button into a cross between resize handler

9237. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-3 up to revid 9328 <email address hidden>

9238. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9239. By Thibault Delavallée (OpenERP)

[FIX] [IMP] website_mail: improved and fixed the 'subscribe button'.
This button is used to perform a 'message_subscribe' or 'message_unsubscribe' on some
documents. It is notably used to add a 'Subscribe' button in some pages that subscribe
the user to a mailing list (aka mail.group).
This branch fixes some subscribe/unsubscribe issues, better manages the public user,
use the session to remember whether a public user has subscribe to a mailing list,
and uses already-existing code to manage partners.

9240. By Thibault Delavallée (OpenERP)

[MERGE] [FIX] Merged branch holding some fixes for the newly
(badly ?) introduced module website_mail_group: subscribe / unsubscribe now working,
pager now working. Some redesign will probably land in trunk if we have time
as the current layout is not very efficient.

9241. By Antony Lesuisse (OpenERP)

[FIX] account invoice analysis exclude proforma from invoiced

9242. By Denis Ledoux (OpenERP)

[ADD] crm: mass convert lead to opp, add force assignation checkbox, to force the salesman/salesteam on converted/merged lead/opps or leave the existing salesman/salesteam

9243. By Denis Ledoux (OpenERP)

[FIX] crm: round robin tests on salesman assignation set force assignation true

9244. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-3 up to revid 9345 <email address hidden>

9245. By Christophe Matthieu (OpenERP)

[IMP] website: Building block / Snippet Editor
Add documentation and clean framework
The building blocks appear in the edit bar website. These prebuilt html block allowing the designer to easily generate content on a page (drag and drop).
Options allow snippets to add customizations party html code according to their selector (jQuery) and javascript object.

9246. By Denis Ledoux (OpenERP)

[REF] *: share field is now a computed field, if the user is in the employee group or not

9247. By Christophe Matthieu (OpenERP)

[FIX] website: snippet editor: forward port of branch saas-3

9248. By Denis Ledoux (OpenERP)

[MERGE] Forward-port of latest saas-3 bugfixes, up to rev. 9347 revid:<email address hidden>

9249. By sle-openerp

[MERGE][REF] Report module: Moved methods generating pdf/html from Controller to Model in order to be able to print without request (report controllers still exist but are now just interfaces to these methods) ; adapted account_vat report this way

9250. By Fabien Meghazi (OpenERP)

[FIX] Fix url slug check bug in multilang=True

9251. By Christophe Matthieu (OpenERP)

[FIX] website: fix and activate frontend test

9252. By Thibault Delavallée (OpenERP)

[MERGE] [CLEAN] website_mail: clean merging of trunk-archive (revid <email address hidden>) introducing Mailing List Archives. Featuring :
- uses already-existing template for subscription instead of copy-and-pasting the subscription button code;
- fixes several issues in the layout to ease the reading;
- fixes the broken pager;
- adds the Archives nav that was planned but not really usable

9253. By Antony Lesuisse (OpenERP)

[REM] move document_webdav to openerp-extra

9254. By Antony Lesuisse (OpenERP)

[REM] move document_ftp to openerp-extra

9255. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale & posbox: new posbox homepage, posbox software upgrade system, printing xml based receipt

9256. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9257. By Christophe Matthieu (OpenERP)

[IMP] website_event: widget to promote Events with country flag

9258. By Christophe Matthieu (OpenERP)

[FIX] website_event: import GeoIP if GeoIP is not installed

9259. By Christophe Matthieu (OpenERP)

[FIX] website_event: return empty string in Local Events snippet if GeoIP is not installed

9260. By Fabien Meghazi (OpenERP)

[MERGE] remote module import

9261. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9262. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale, hw_escpos: fixes from the pos-restaurant branch

9263. By van der Essen Frédéric (OpenERP)

[FIX] hw_posbox_upgrade: posbox restart was not working

9264. By Fabien (Open ERP)

[IMP] flat design, even for darken

9265. By Fabien (Open ERP)

[IMP] better button snippet

9266. By Fabien (Open ERP)

[IMP] bootstrap less sources

9267. By Fabien (Open ERP)

[IMP] removing glyphicons from bootstrap less

9268. By Fabien (Open ERP)

[REM] remove duplicate snippet: portfolio - image gallery

9269. By Fabien (Open ERP)

[REM] removed bootstrap sources

9270. By Christophe Matthieu (OpenERP)

[FIX] website: create new page redirect to error 404

9271. By Christophe Matthieu (OpenERP)

[FIX] website_blog: order of blog_post must be by create_date

9272. By Christophe Matthieu (OpenERP)

[FIX] website_blog: remove create_date from demo data

9273. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9274. By Quentin (OpenERP) <email address hidden>

[MERGE] website_gengo branch merged, offering the possiblity to translate the website using Gengo

9275. By Fabien Meghazi (OpenERP)

[ADD] website: template reset confirmation

9276. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] website_blog: use a helper to generate the various URLs of blogs (using date, tags, blog, post, ...) + updated templates accordingly. This branch also fixes numerous bugs with URLs, notably Archives URLs that were completely buggy.

Also fixed strangely coded domain generation in blog route.

9277. By Denis Ledoux (OpenERP)

[FIX] account_analytic_analysis, analytic, hr_timesheet: do not override existing data of analytic account on template on_change

9278. By Denis Ledoux (OpenERP)

[FIX] project, project_issue: overwritten method on_change template, wrong signature, following commit 9277 revid:<email address hidden>

9279. By Fabien (Open ERP)

[IMP] kanban view for ir.attachments

9280. By Fabien (Open ERP)

[IMP] kanban of documents for recruitement attachments

9281. By Fabien (Open ERP)

[IMP] Tracks: alphabetic order

9282. By Martin Trigaux (OpenERP)

[MERGE] [IMP] event: store number of seat used to avoid unnecessary computations (performance improvement)

9283. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] payment modules: added provider selection field that is different from the name. This allows to distinguish name and provider. Provider is a more technical field, used to call some specific methods (<provider>_method_name). The name field is used for display on the website.

Added name on payment.transaction views.

Added sale_order_id field on transaction form view; the field is already present and used but was not displayed.

Transfer is now called Wire Transfer.

Code and views udpated accordingly.

9284. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9285. By Fabien (Open ERP)

[IMP] button snippet

9286. By Quentin (OpenERP) <email address hidden>

[FIX] base_gengo: don't wait another cron job execution to ask translation for the next n words

9287. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-3 up to revid 9380 <email address hidden>

9288. By Quentin (OpenERP) <email address hidden>

[FIX] base_gengo: don't skipp terms in gengo communication because of their state may have changed in the meanwhile (so using offset+limit in a serach at each loop is not a good idea)

9289. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9290. By Géry Debongnie

[FIX] fixes an incorrect call to read_group (addon gamification)

9291. By sle-openerp

[MERGE][IMP] Account* reports converted to qweb; Added sale_layout module allowing to customize sale order and invoice; some refactoring on report module

9292. By Martin Trigaux (OpenERP)

[IMP] event: add trigger field for stored seats_* fields and remove print

9293. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] mail: followers widget: Follow button + subtypes are now displayed
like a button + a dropdown selection for subtypes, reducing the place this widget
takes in the form view.

9294. By Thibault Delavallée (OpenERP)

[IMP] mail: jump to the Messaging menu after installation

9295. By Fabien (Open ERP)

[IMP] track translatable

9296. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] website_blog: layout and usability improvements. This task proposes a better layout that eases the reading + smooth transitions between blogs based on suggestions dynamically chosen based on a ranking.

Featuring :
- blog: blog now have a subtitle field
- blog_post: blog post now have a subtitle field, removed shortened content + website_published_datetime (create_date and write_date are sufficient). Added tracking of visits + ranking computation, to select the next post the user will see. Added background-image, that is used to display a cover behind the post title and subtitle. Overall display improvement.
- added new feature that allows a user to tweet selected text on twitter from post.
- added new feature that allows a user to discuss on every paragraph (anonymous user have to give their name and email)
- better blog demo data

Misc:
- website: removed dead code about website_published_datetime that could have been generic but has never been used
- [FIX] website: fixed image controller, do not attempt to read website_published on models that do not have that field

9297. By Christophe Matthieu (OpenERP)

[TYPO] website: tour for banner

9298. By Christophe Matthieu (OpenERP)

[FIX] website: Default Url not correct for the button 'contact us' in the block features>Button

9299. By Christophe Matthieu (OpenERP)

[FIX] website: The separator block is not working (no drop zone)

9300. By Raphael Collet (OpenERP)

[MERGE] test_cursor: adapt code to small api changes in registry for handling http tests

9301. By Martin Trigaux (OpenERP)

[IMP] lunch: add security rules, it's rude to look at other people's food

9302. By Christophe Matthieu (OpenERP)

[IMP] website: create a media snippet editor who merge image dialog, font awesome, video youtube...

9303. By Fabien (Open ERP)

[IMP] Event Agenda: merge with cleaning

9304. By Fabien (Open ERP)

[IMP] track duration in hours

9305. By Fabien (Open ERP)

[IMP] Gengo translation cron every 6 hours

9306. By Fabien (Open ERP)

[IMP] Gengo Fixes

9307. By Fabien (Open ERP)

[IMP] grouping jobs together

9308. By Fabien (Open ERP)

[IMP] gengo fix in callback

9309. By Géry Debongnie

[MERGE] readgroup signature has changed, so addons inheriting and modifying read_group need to be changed to make sure they call their parent's read_group with the correct signature

9310. By Fabien (Open ERP)

[IMP] evnet

9311. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-3 up to revid 9394 <email address hidden>

9312. By Raphael Collet (OpenERP)

[FIX] event_sale: fix non-closing tags in xml file

9313. By Olivier Dony (Odoo)

[FIX] website: avoid discarding snippet animator after edit + properly restart animation while disabling clicks

9314. By Mahendra Barad(OpenERP)

[MERGE] [ADD] website_twitter: add twitter scroller snippet

9315. By Olivier Dony (Odoo)

[MERGE] sale_order_dates: several improvements to usability and planned date computing, courtesy of Lionel Sausin (Numerigraphe)

9316. By van der Essen Frédéric (OpenERP)

[MERGE] posbox : regression fix, made it easier to add support for new printers

9317. By Fabien (Open ERP)

[IMP] Larger texts

9318. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] Large refactoring of "survey" module
- surveys are now displayed through website
- new reporting tool
- model refactoring
- usability improvements
(affects also hr_evaluation and hr_recruitment, that use surveys)

9319. By Cedric Snauwaert (OpenERP)

[MERGE]change modal windows to only use bootstrap3

9320. By Thibault Delavallée (OpenERP)

[FIX] gamification: allow having False or 0 values as result of a computation.

9321. By Thibault Delavallée (OpenERP)

[FIX] mail: avoid crashing message_post if the subtype does not exists anymore.
Using xmlid_to_res_id, subtype_id will be False if not found.

9322. By Thibault Delavallée (OpenERP)

[FIX] mail: res_users post: fixed partner_ids computation, could receive
a list of ids, or a list of commands. Both cases should be taken into account.

9323. By Martin Trigaux (OpenERP)

[MERGE] gamification: add batch mode, improve some views, remove inprogess_update state and "realtime" (using cron) badge to recieve badges without needing to close the challenge

9324. By Thibault Delavallée (OpenERP)

[ADD] New module: website_forum, a clone of askbot / stackoverflow.

This module models a forum: questions, answers, voting and comment system, karma
management. There is a link with gamification, allowing to use badges and reward
users for their participation to the forum.

Badges are temporarily commented out to ease the module beta-testing without having
to wait for some gamification improvements.

This merge also contains some fixes in access rights for gamification.

9325. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9326. By Christophe Matthieu (OpenERP)

[FIX] website: media editor: when the user save the picture, the dialog box re-open automatically. Do not re-active snippet when we save a field image

9327. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] crm/sale_crm: Terminology
Replacement of the term "category" by "tag", for the sake of consistency

9328. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] invoice/sale: Terminology uniformisation

9329. By Fabien (Open ERP)

[IMP] Ticket types translateable

9330. By Fabien (Open ERP)

[IMP] translateable event description

9331. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] hr_timesheet: add a menu to configure Timesheet Accounts under HR/Configuration

9332. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] hr_timesheet: Quick create of contract (on timesheet) does not open contract edit window anymore

9333. By Richard Mathot (Odoo, formerly OpenERP)

[REF] hr_timesheet: unused piece of code

9334. By Fabien (Open ERP)

[REM] removing unused and non clean modules

9335. By jke-openerp

[FIX] wesbite: banner - remove css and use bootstrap for positionning. Now hidden-xs works, we don't lost 50% of width

9336. By jke-openerp

[FIX] Website_mail - Add selectors to allow drag and drop of snippet in email template

9337. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][FIX] Mobile preview of blogs

9338. By Raphael Collet (OpenERP)

[FIX] calendar: fix string quoting mess in email template

9339. By jke-openerp

[FIX] Website tour - Click inside the zone before to insert sampleText

9340. By jke-openerp

[FIX] Website banner tour - Fix test according to new banner structure

9341. By jke-openerp

[FIX] mail template view - Set body_html field as simple text area without cke by default. Else, the mako code are considered as mal formatted and moved.

9342. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-3 up to revid 9409 <email address hidden>

9343. By Martin Trigaux (OpenERP)

[IMP] gamification and website_forum improvements

gamification:
- fix batch mode when grouping by id
- fix subquery in batch mode when a ending date is set
- serialisation method can exclude categories of challenge
- view improvements

website_forum:
- enabling bages in batch mode
- fix karma computation when creating a new post
- changing previous vote affects the user karma
- do not display forum challenges on user home page

9344. By jke-openerp

[MERGE] Allow to use many2one for qweb template (work also with view_id)

9345. By Thibault Delavallée (OpenERP)

[MERGE] [REF] mass_mailing refactoring. Mass mailing is refactored to be easier to use, introducing an easy-to-use way of handling recipients, mailing lists and statistics. This branch comes with a web branch that introduce the char_domain widget, that is a widget on a char field holding a domain. It allows to select and count records without having to deal with the complexity of domains.

This branch comes with a cleaning of marketing modules :
- marketing now holds only the basic stuff for marketing related modules: mainly marketing settings + menu definition
- marketing_crm new module is a bridge between crm and marketing and holds the crm-related stuff previously present in marketing module.

This branch also holds some mail and template improvement in order to speedup the mass mailing process. The template edition in website_mail has also be improved. It is now a page that allows to edit email-like content (content with a subject, an email_from and a body), like templates, emails or mass mailing.

Misc :
- mail_compose_message: removed unnecessary fields coming from the template (partner_to, ...) because they are confusing -> composer should be easier to understand and use; also cleaned method generating the email values in the composer that was splitted in two methods
- fixed removed double body computation when using templates (one for template, then the wizard -> not necessary)
- mail_message: record_name is not a function field anymore, but a char field + a method in create, allowing to speedup mass mailing by avoiding browsing all records to get their name

9346. By Thibault Delavallée (OpenERP)

[IMP] payment: renamed env field to environment, to avoid conflicts
with the incoming new API.

9347. By Christophe Matthieu (OpenERP)

[IMP] website_crm: designer can add input type file in form view. All files create an ir.attachment linked with the created lead

9348. By sle-openerp

[MERGE] hr* reports converted to QWeb

9349. By sle-openerp

[FIX] website_report: added transfo.js

9350. By Denis Ledoux (OpenERP)

[ADD] *: replace overriden methods get_formview_action by get_formview_id

Methods to override to specify the view/action to launch for many2one links
get_formview_action use get_formview_id to find the view to open. Therefore, it is simplier to override get_formview_id to tell which view should be opened

9351. By Cedric Snauwaert (OpenERP)

[FIX]modal: missing new object instanciation in dashboard

9352. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] survey: basic usability for quiz mode

Users with Technical Featurs are now able to enable a "quiz mode" on surveys:
- questions with simple and multiple choice can be autocorrected
- an answer with positive mark is considered as correct
- users that finish a survey can see a detailed correction with correct answers and their scores
- other questions types can be manually rated by a human corrector

9353. By Christophe Simonis (OpenERP)

[MERGE] {gamification,gamification_sale_crm,website_forum}: Removing the field autojoin_group_id to replace the subscription by a domain

9354. By Christophe Simonis (OpenERP)

[FIX] hr*: must depend on "report" module

9355. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] Hide the group 'Manage resources planning on gantt view' from project settings

9356. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][FIX] sale: disallow line creation on confirmed sales orders

[patch by Divyesh Makwana (OpenERP)]

9357. By Amit Vora(OpenERP)

[MERGE] [IMP] mail: Inbox usability improvements :
- notficiation_email_send field, renamed into notify_email, has now 2 values: always or never, in
order to ease the choice and simplify options.
- inbox: removed 'compose a new messages or write to my followers', because those 2 options are
already available. The first one is accessible using the top-right email icon, the second one
is accessible with the 'write to my followers' text box alread present in the inbox.

9358. By Darshan Kalola(OpenERP)

[MERGE] [IMP] project, hr_recruitment: fixed access rights on stages.
Projec/Recruitment Users can now just read columns; managers can edit and unlink them.
With the server and web branch, this allows to restrict the actions the user can perform
on columns according to its access rights.

9359. By Cedric Snauwaert (OpenERP)

[MERGE]tooltip: replace tipsy by bootstrap tooltip

9360. By Amit Vora(OpenERP)

[MERGE] [IMP] crm: improved call / meeting buttons and behavior on lead and partner form view.
- improved behavior of schedule a meeting, for both opportunities and partner, with correct
attendees and options;
- removed wizard to schedule a cal, jumping to the list view with correct default values
is sufficient;
- scheduled calls is now accessible using a group, accessible through sales configuration;

9361. By Kunal Chavda

[MERGE] [IMP] website: tour: nice smooth cool and sexy effect when closing
or ending the tour.

9362. By Fabien (Open ERP)

[MERGE] new module: website_forum_doc + small fixes (close) in forum

9363. By Fabien (Open ERP)

[IMP] improved form view for posts

9364. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9365. By Pooja Zankhariya (OpenERP)

[MERGE][IMP] mrp: correct colors for components of manufacturing orders (reflecting their states)

9366. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] Form views usability (account, delivery, hr_expense, hr_payroll, l10n_fr_rib, lunch, product, purchase_requisition, resource, stock)

9367. By Mansi Kariya(OpenERP)

[MERGE][IMP] account_followup: direct link to followups on the Accounting config page

9368. By Bharat Devnani (Open ERP)

[MERGE][IMP] More explicit error messages (in delivery, hr_timesheet_sheet, purchase, purchase_requisition, sale_stock, stock)

9369. By DJ Patel (OpenERP)

[MERGE] [IMP] Search views: consistency of some filters labels

9370. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-4 up to revid 9365 <email address hidden>

9371. By Christophe Simonis (OpenERP)

[FIX] website_forum: correct view xml (introduce by previous commit)

9372. By Christophe Matthieu (OpenERP)

[FIX] website: snippet editor: speed up save view (construct only option with clean_for_save method); fix carousel arrow

9373. By Géry Debongnie

[MERGE] remove double groupbys in columns in two reporting graph views (addons crm/hr_recruitment)

9374. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] mail: slightly improved doc links in notification emails (shorter, clearer)

9375. By Christophe Matthieu (OpenERP)

[IMP] website_project: remove preprocess_request content; user can the add link with the menu editor

9376. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9377. By Jaydeep Barot(OpenERP)

[MERGE][IMP] account: allow sorting of journal items

9378. By Antony Lesuisse (OpenERP)

[REM] project_gtd deprecated by notes

9379. By Antony Lesuisse (OpenERP)

[REM] move auditrail to extra
It's deprecated by _track_fields, mail.message and base_action_rules

9380. By Antony Lesuisse (OpenERP)

[REM] move project_long_term to extra

9381. By Antony Lesuisse (OpenERP)

[REM] remove portal_project_long_term

9382. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9383. By Jaydeep Barot(OpenERP)

[MERGE][IMP] account (partner view): hide accounting settings to users that have no accounting access rights

9384. By van der Essen Frédéric (OpenERP)

[MERGE] hw_scale: a mettler toledo scale driver for the point of sale

9385. By Jaydeep Barot(OpenERP)

[MERGE][IMP]
stock: more explicit error message for product scraping
account/mail: typos

9386. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] account/account_voucher: new filters and usability minor fixes

9387. By Randhir Mayatra (OpenERP)

[MERGE][REM] List views removed in reporting menu (from membership and project_timesheet) as new graph view is now self-sufficient

9388. By Christophe Matthieu (OpenERP)

Tour Re-factoring.
Only one tour running; remove bootstrap tour; Simplify creation of tour; can choose test or tutorial mode with run method; can work without qweb and without EditorBar

9389. By Antony Lesuisse (OpenERP)

[FIX] base_import remove useless test

9390. By Randhir Mayatra (OpenERP)

[MERGE] [REM] Removal of every pre-made dashboard. Only "My Dashboard" has been kept.
Modules descriptions have been updated accordingly and some screenshots have been removed.
(affects: account, crm, event, fleet, hr, hr_evaluation, hr_expense, hr_holidays, hr_recruitment, hr_timesheet_sheet, mrp, procurement, project, purchase, sale, stock)

9391. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: make the kg unit precise up to grams, and use the unit's rounding factor on the scale screen

9392. By sle-openerp

[MERGE][IMP] hr_timesheet: remove unattainable reports; hr_attendance: replace reports by a graphview

9393. By Darshan Kalola(OpenERP)

[MERGE][REM] Removal of "process" module and its avatars in others modules

9394. By Richard Mathot (Odoo, formerly OpenERP)

[FIX][REM] hr_timesheet: removed reports mistakenly reintroduced

9395. By sle-openerp

[MERGE][IMP] Point of Sales: reports converted to QWeb (but removed useless ones); removed dead code in wizard folder; folder; Adapted /report/download route to serialize and return osv_exception in order to be handled in core.js get_file

9396. By sle-openerp

[MERGE][IMP] l10n_* reports converted to QWeb

9397. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9398. By Olivier Dony (Odoo)

[I18N] remove i18n files for deleted modules after disabled translation templates

9399. By Olivier Dony (Odoo)

[IMP] purchase: invoice creation more modular/extensible through the introduction of a _prepare_invoice method()

This is similar to what was previously done for Sales Orders.

9400. By Fabien Meghazi (OpenERP)

[MERGE] Web assets moved from manifests to ir.ui.view bundles

9401. By Fabien (Open ERP)

[IMP] website images: allow no max_width (default), faster loading if no resize

9402. By Antony Lesuisse (OpenERP)

[MERGE] saas-4 up to 9398 <email address hidden>

9403. By Antony Lesuisse (OpenERP)

[MERGE] saas-4 report_webkit missing dependency on report

9404. By Fabien (Open ERP)

[IMP] Lossless PNG compression. Reduced size by 3 with pngquant

9405. By Antony Lesuisse (OpenERP)

[FIX] website controller, correctly resolve last merge about images
fix fp commit to use debian compatible werkzeug api data instead of set_data

9406. By Antony Lesuisse (OpenERP)

[FIX] website_event missing javascript asset

9407. By Fabien Meghazi (OpenERP)

[FIX] edi, calendar webclient bootstrap

9408. By Géry Debongnie

[MERGE] converts buttons in form views into 'stat buttons'

This branch converts pretty much every buttons in 'stat buttons',
which means buttons that can display any kind of information. Right
now, it is mostly used to display a numerical information (such as a
number, for example 9 Calls). Also, look at the invoices button in
Customers form view for an example of a functional field, displaying
the total amount invoiced.

The stat buttons also supports sub widgets, for example a mini pie chart
or a mini bar chart. Examples of such sub widgets can be found in
marketing/mass mailings form views (not ready yet)

9409. By Fabien (Open ERP)

[IMP] Certification Template

9410. By Raphael Collet (OpenERP)

[FIX] event: move definition of fields track_ids and count_tracks to the right module

9411. By Fabien Meghazi (OpenERP)

[IMP] website: load website.xml templates only in editable mode

9412. By Fabien Meghazi (OpenERP)

[ADD] base_import_module test module, static asset in backend bundle

9413. By jke-openerp

[MERGE] Merge with trunk-cal-V8-jke. - Change field datetime into date or datetime according to that event type is in all day or not...

9414. By Fabien Meghazi (OpenERP)

[REM] preprocess_request from website

The method is still there with only a pass statement
Will completetly remove once chm merges his branch

9415. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9416. By Fabien Meghazi (OpenERP)

[FIX] jQuery.ui - boostrap conflict

9417. By Fabien Meghazi (OpenERP)

[REM] Removed addons.web#html_template usage

9418. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9419. By Xavier (Open ERP)

[IMP] mail: type fixes

* _get_tracked_fields should return a dict even when there's no tracked field
  (return an empty dict)

* in write, only call _get_tracked_fields once, initialize to None instead of
  a list (especially since it should be a dict in the first place)

9420. By Géry Debongnie

Large cleanups in addons

The code I merged in my branch stat buttons was sadly not up to our
standing... This branch improves the situation by removing harmful
try/excpet/pass statements, by using search_count when appropriate, by
removing unused one2many fields and by correcting some bugs

9421. By Antony Lesuisse (OpenERP)

[MERGE] trunk-websit-al-refactor by chm
- allow fiscal position change on sale orders
- public user on website
- simplify website_sale sale.order and shopping cart code
- remove preprocess_request

9422. By Fabien Meghazi (OpenERP)

[REM] QWeb does not self close empty divs anymore

See web Rev#4011

9423. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-4 up to revid 9410 <email address hidden>

9424. By Fabien Meghazi (OpenERP)

[REM] completetly removed website#preprocess_request()

9425. By Quentin (OpenERP) <email address hidden>

[REV] partial revert of revision 9408 <email address hidden> where we wrongly beleive than stock depends on crm_claim... :( That code will probably be back _in the right module_

9426. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9427. By Géry Debongnie

[MERGE] merge trunk-claimcount-fix-ged

Add the claim_count_out field to its correct place (in addon claim_from_delivery). The field was removed because it was incorrectly added to stock.py instead of the addon claim_from_delivery. (note: it was renamed from claim_count to claim_count_out)

9428. By Quentin (OpenERP) <email address hidden>

[MERGE] trunk-wms branch which include a lot of freaking features. Check the diff by yourself :-)

9429. By Mahendra Barad(OpenERP)

[MERGE] [IMP] crm, hr_recruitment, project, project_issue: use the newly-introduced widgets for the kanban state and the priority management.

This branch comes with a web branch holding those new widgets for form and kanban views.

9430. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9431. By Martin Trigaux (OpenERP)

[FIX] product: get_history_price recieves ids instead of a browse record for product template

9432. By Cedric Snauwaert (OpenERP)

[FIX]purchase_requisition: put js file in a bundle

9433. By Quentin (OpenERP) <email address hidden>

[FIX] claim_from_delivery: fixed error in delivery view

9434. By Jitendra Prajapati(OpenERP)

[MERGE] [IMP] mail, report_webkit: view improvements + better name_get for mail and aliases.

9435. By Fabien Meghazi (OpenERP)

[FIX] is_multilang_url by checking against werkzeug's routing map using query string too

9436. By Fabien Meghazi (OpenERP)

[ADD] alternate hreflang links in head for search engines

cf: https://support.google.com/webmasters/answer/189077?hl=en

9437. By Fabien (Open ERP)

[IMP] removing static style

9438. By Fabien (Open ERP)

[IMP] clean sitemap, enumerate pages + fixes

9439. By Fabien (Open ERP)

[IMP] Sitemap

9440. By Fabien (Open ERP)

[IMP] sitemap cleaning: events

9441. By Fabien (Open ERP)

[FIX] better handling of '/'. / is the first menu and not the first menu is /. Allows to move the first menu in another position

9442. By Fabien (Open ERP)

[FIX] css edit menu alignment and fix of / handling

9443. By Martin Trigaux (OpenERP)

Forward-port of latest saas-4, up to revision 9416 (rev-id <email address hidden>)

9444. By Xavier (Open ERP)

[IMP] mail docs

* fill-paragraph
* remove sections referring to removed methods with no obvious replacement

9445. By Martin Trigaux (OpenERP)

[IMP] gamification: improve the name of some m2m relations

9446. By Xavier (Open ERP)

[IMP] mail, base_import: context key disabling history tracking

* added a ``tracking_disable`` context key used by mail to completely disable
  subscriptions setup and events generation during create and write operations
* added import option to optionally set up that context key and speed up
  imports at the cost of not setting up subscriptions and not sending
  create/update events

9447. By Olivier Dony (Odoo)

[FIX] mass_mailing,website*,survey: leftover calls to website.get_public_user()

This method was (partially) removed at rev.9421
rev-id <email address hidden>

9448. By Fabien Meghazi (OpenERP)

[ADD] website.menu editable list in website config

9449. By Cedric Snauwaert (OpenERP)

[FIX]sale_report: change type of field date from date to datetime to match field date on sale_order

9450. By Fabien Meghazi (OpenERP)

[FIX] Do not display language choice if multilang=False

9451. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9452. By Fabien Meghazi (OpenERP)

[IMP] openerpframework moved in common asset bundle

9453. By Thibault Delavallée (OpenERP)

[FIX] Re-added code removed by al at rev 9421: website quotation email was not sent anymore.

9454. By Thibault Delavallée (OpenERP)

[FIX] document, mail, project: re-add tree view for attachments removed at revision 9279 and 9280
when adding a kanban view for documents.

9455. By Fabien Meghazi (OpenERP)

[FIX] broken domain in route

9456. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9457. By jke-openerp

[IMP] Improve Calendar synchronization

    - Use the new fields from calendar (renamed in 9398.1.7 trunk-cal-v8-jke)
    - Manage some google excpetions about token expiration
    - Manage some google excpetions about token revokation
    - Manage some google excpetions about 410 - Gone from google
    - Detect / Allow user to change the calendar and remove all old reference.
    - Use by default the since_modified for synchronization and not always a full (updatedTime in google)
    - Add some key for ir_parameters :
             'calendar.week_synchro' : number of week to synchornize when we are in full mode
             'calendar.block_synchro_attendee' : need to synchronize the attendees between google and openerp (creation of partner)
             'calendar.block_since_synchro' : Always use the full synchro. (Can be forced in "one time" removing the last synchro from res_users form)
             'calendar.debug_print' : _logger is more verbose
    - Pep 8
    - Change behaviour of do_request to return a tuple with status raquest and response
    - Add field from token and synchro date in res_users view form

9458. By Thibault Delavallée (OpenERP)

[MERGE] [MOV] [ADD] sales_team module holding sales team related stuff. The sales team implementation has been taken out of crm, allowing to use the sales team concept without having to depend on the crm module. crm and sale now both depend on sales_team module and add their specific fields to the model. sale_crm module has been simplified by removing sales-team related stuff. The default section id on users is now located in sales_team, not in sale_crm anymore, allowing its use in both crm and sale modules.

9459. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9460. By Thibault Delavallée (OpenERP)

[MERGE] [IMP] Added a website salesteam, used to handle ecommerce quotations and
contact leads. Also added use_opportunities and use_quotations boolean fields on
sales team, like use_leads to ease the salesteam customization.

Also removed some dead code in website_sale_crm and website_sale_delivery.

9461. By sle-openerp

[MERGE][FIX] l10n_fr_hr_payroll: removed useless rml declaration, improvement on report view

9462. By Fabien Meghazi (OpenERP)

[IMP] route@multilang default value inverted

The default value is now True for route@website=True controllers
Can be voided using multilang=False

9463. By Amit Dodiya (OpenERP)

[IMP] improved code & demo data

9464. By Amit Dodiya (OpenERP)

[IMP] improved warning message

9465. By Amit Dodiya (OpenERP)

[Fix] Fixed the issue in creation of assets with non-fiscal year

9466. By Chirag Dodiya(OpenERP)

[IMP]Improved typo.

9467. By Chirag Dodiya(OpenERP)

[IMP]Improved code to set view id in action of report.

9468. By Chirag Dodiya(OpenERP)

[IMP]Refactered all code of asset py file.

9469. By Chirag Dodiya(OpenERP)

[IMP]Improved code to fix error.

9470. By Chirag Dodiya(OpenERP)

[IMP]used currency round method,improved code as par coding convantion.

9471. By Chirag Dodiya(OpenERP)

[IMP]Removed date field from crate move,moved sequence object,improved typo.

Unmerged revisions

9471. By Chirag Dodiya(OpenERP)

[IMP]Removed date field from crate move,moved sequence object,improved typo.

9470. By Chirag Dodiya(OpenERP)

[IMP]used currency round method,improved code as par coding convantion.

9469. By Chirag Dodiya(OpenERP)

[IMP]Improved code to fix error.

9468. By Chirag Dodiya(OpenERP)

[IMP]Refactered all code of asset py file.

9467. By Chirag Dodiya(OpenERP)

[IMP]Improved code to set view id in action of report.

9466. By Chirag Dodiya(OpenERP)

[IMP]Improved typo.

9465. By Amit Dodiya (OpenERP)

[Fix] Fixed the issue in creation of assets with non-fiscal year

9464. By Amit Dodiya (OpenERP)

[IMP] improved warning message

9463. By Amit Dodiya (OpenERP)

[IMP] improved code & demo data

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/res_config.py'
--- account/res_config.py 2014-04-23 11:40:53 +0000
+++ account/res_config.py 2014-05-28 05:47:51 +0000
@@ -84,9 +84,11 @@
84 '-This installs the module account_check_writing.'),84 '-This installs the module account_check_writing.'),
85 'module_account_accountant': fields.boolean('Full accounting features: journals, legal statements, chart of accounts, etc.',85 'module_account_accountant': fields.boolean('Full accounting features: journals, legal statements, chart of accounts, etc.',
86 help="""If you do not check this box, you will be able to do invoicing & payments, but not accounting (Journal Items, Chart of Accounts, ...)"""),86 help="""If you do not check this box, you will be able to do invoicing & payments, but not accounting (Journal Items, Chart of Accounts, ...)"""),
87 'module_account_asset': fields.boolean('Assets management',87 'module_account_asset': fields.boolean('Assets management & Revenue recognition',
88 help='This allows you to manage the assets owned by a company or a person.\n'88 help='Asset management: This allows you to manage the assets owned by a company or a person.'
89 'It keeps track of the depreciation occurred on those assets, and creates account move for those depreciation lines.\n'89 'It keeps track of the depreciation occurred on those assets, and creates account move for those depreciation lines.\n\n'
90 'Revenue recognition: This allows you to manage the Revenue recognition on selling product.'
91 'It keeps track of the installment occurred on those revenue recognition, and creates account move for those installment lines.\n'
90 '-This installs the module account_asset. If you do not check this box, you will be able to do invoicing & payments, '92 '-This installs the module account_asset. If you do not check this box, you will be able to do invoicing & payments, '
91 'but not accounting (Journal Items, Chart of Accounts, ...)'),93 'but not accounting (Journal Items, Chart of Accounts, ...)'),
92 'module_account_budget': fields.boolean('Budget management',94 'module_account_budget': fields.boolean('Budget management',
9395
=== modified file 'account_asset/__openerp__.py'
--- account_asset/__openerp__.py 2012-12-06 15:38:56 +0000
+++ account_asset/__openerp__.py 2014-05-28 05:47:51 +0000
@@ -20,17 +20,21 @@
20##############################################################################20##############################################################################
2121
22{22{
23 'name': 'Assets Management',23 'name': 'Assets & Revenue Recognitions Management',
24 'version': '1.0',24 'version': '1.0',
25 'depends': ['account'],25 'depends': ['account'],
26 'author': 'OpenERP S.A.',26 'author': 'OpenERP S.A.',
27 'description': """27 'description': """
28Financial and accounting asset management.28Assets management.
29==========================================29==========================================
3030
31This Module manages the assets owned by a company or an individual. It will keep 31It allows you to manage the assets owned by a company or a person.
32track of depreciation's occurred on those assets. And it allows to create Move's 32It keeps track of the depreciation occurred on those assets, and creates account moves for those depreciation lines.
33of the depreciation lines.33
34Revenue recognitions.
35===========================================
36It allows you to manage the revenue recognition on product's sale.
37It keeps track of the installments occurred on those revenue recognition, and creates account moves for those installment lines.
3438
35 """,39 """,
36 'website': 'http://www.openerp.com',40 'website': 'http://www.openerp.com',
@@ -41,6 +45,8 @@
41 'test/account_asset_demo.yml',45 'test/account_asset_demo.yml',
42 'test/account_asset.yml',46 'test/account_asset.yml',
43 'test/account_asset_wizard.yml',47 'test/account_asset_wizard.yml',
48 'test/account_revenue_recognition_demo.yml',
49 'test/account_revenue_recognition.yml',
44 ],50 ],
45 'data': [51 'data': [
46 'security/account_asset_security.xml',52 'security/account_asset_security.xml',
4753
=== modified file 'account_asset/account_asset.py'
--- account_asset/account_asset.py 2014-05-07 13:45:44 +0000
+++ account_asset/account_asset.py 2014-05-28 05:47:51 +0000
@@ -26,6 +26,7 @@
26from openerp.osv import fields, osv26from openerp.osv import fields, osv
27import openerp.addons.decimal_precision as dp27import openerp.addons.decimal_precision as dp
28from openerp.tools.translate import _28from openerp.tools.translate import _
29import openerp
2930
30class account_asset_category(osv.osv):31class account_asset_category(osv.osv):
31 _name = 'account.asset.category'32 _name = 'account.asset.category'
@@ -34,10 +35,11 @@
34 _columns = {35 _columns = {
35 'name': fields.char('Name', size=64, required=True, select=1),36 'name': fields.char('Name', size=64, required=True, select=1),
36 'note': fields.text('Note'),37 'note': fields.text('Note'),
37 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic account'),38 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
38 'account_asset_id': fields.many2one('account.account', 'Asset Account', required=True, domain=[('type','=','other')]),39 'account_asset_id': fields.many2one('account.account', 'Asset Account', required=True, domain=[('type','=','other')]),
40 'account_income_recognition_id': fields.many2one('account.account', 'Recognition Income Account', domain=[('type','=','other')]),
39 'account_depreciation_id': fields.many2one('account.account', 'Depreciation Account', required=True, domain=[('type','=','other')]),41 'account_depreciation_id': fields.many2one('account.account', 'Depreciation Account', required=True, domain=[('type','=','other')]),
40 'account_expense_depreciation_id': fields.many2one('account.account', 'Depr. Expense Account', required=True, domain=[('type','=','other')]),42 'account_expense_depreciation_id': fields.many2one('account.account', 'Depr. Expense Account', domain=[('type','=','other')]),
41 'journal_id': fields.many2one('account.journal', 'Journal', required=True),43 'journal_id': fields.many2one('account.journal', 'Journal', required=True),
42 'company_id': fields.many2one('res.company', 'Company', required=True),44 'company_id': fields.many2one('res.company', 'Company', required=True),
43 'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, help="Choose the method to use to compute the amount of depreciation lines.\n"\45 'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, help="Choose the method to use to compute the amount of depreciation lines.\n"\
@@ -53,6 +55,7 @@
53 'method_end': fields.date('Ending date'),55 'method_end': fields.date('Ending date'),
54 'prorata':fields.boolean('Prorata Temporis', help='Indicates that the first depreciation entry for this asset have to be done from the purchase date instead of the first January'),56 'prorata':fields.boolean('Prorata Temporis', help='Indicates that the first depreciation entry for this asset have to be done from the purchase date instead of the first January'),
55 'open_asset': fields.boolean('Skip Draft State', help="Check this if you want to automatically confirm the assets of this category when created by invoices."),57 'open_asset': fields.boolean('Skip Draft State', help="Check this if you want to automatically confirm the assets of this category when created by invoices."),
58 'type': fields.selection([('sales','Sale: Revenue Recognition'),('purchase','Purchase: Asset')], 'Type', required=True, select=True),
56 }59 }
5760
58 _defaults = {61 _defaults = {
@@ -60,8 +63,9 @@
60 'method': 'linear',63 'method': 'linear',
61 'method_number': 5,64 'method_number': 5,
62 'method_time': 'number',65 'method_time': 'number',
63 'method_period': 12,
64 'method_progress_factor': 0.3,66 'method_progress_factor': 0.3,
67 'type': 'sales',
68 'method_period': 1,
65 }69 }
6670
67 def onchange_account_asset(self, cr, uid, ids, account_asset_id, context=None):71 def onchange_account_asset(self, cr, uid, ids, account_asset_id, context=None):
@@ -69,16 +73,40 @@
69 if account_asset_id:73 if account_asset_id:
70 res['value'] = {'account_depreciation_id': account_asset_id}74 res['value'] = {'account_depreciation_id': account_asset_id}
71 return res75 return res
76
77 def onchange_journal_id(self, cr, uid, ids, journal_id, type, context=None):
78 res = {}
79 if not journal_id:
80 return {'value':{}}
81 journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
82 if type == 'sales':
83 res['value'] = {'account_income_recognition_id': journal.default_credit_account_id.id}
84 else:
85 res['value'] = {'account_expense_depreciation_id': journal.default_debit_account_id.id}
86 return res
7287
88 def onchange_type(self, cr, uid, ids, type, context=None):
89 res = {}
90 res['value'] = {'prorata': True,'method_period': 1} if type == 'sales' else {'method_period': 12}
91 return res
7392
74class account_asset_asset(osv.osv):93class account_asset_asset(osv.osv):
75 _name = 'account.asset.asset'94 _name = 'account.asset.asset'
76 _description = 'Asset'95 _description = 'Asset/Recognition'
96 _inherit = ['mail.thread', 'ir.needaction_mixin']
97
98 def _get_category_type(self, cr, uid, ids, context=None):
99 type = self.browse(cr, uid, ids, context=context)[0].category_id.type
100 res = {'name': 'Installment', 'type': 'Recongnition'} if type == 'sales' else {'name': 'Depreciation', 'type': 'Asset'}
101 return res
77102
78 def unlink(self, cr, uid, ids, context=None):103 def unlink(self, cr, uid, ids, context=None):
79 for asset in self.browse(cr, uid, ids, context=context):104 record = self.browse(cr, uid, ids, context=context)[0]
80 if asset.account_move_line_ids: 105 res = self._get_category_type(cr, uid, ids, context=context)
81 raise osv.except_osv(_('Error!'), _('You cannot delete an asset that contains posted depreciation lines.'))106 if record.state in ['open', 'close']:
107 raise osv.except_osv(_('Error!'), _('You cannot delete an %s which is in %s state.') % (res.get('type'), record.state))
108 if record.account_move_line_ids:
109 raise osv.except_osv(_('Error!'), _('You cannot delete an %s that contains posted %s lines.') % (res.get('type'), res.get('name')))
82 return super(account_asset_asset, self).unlink(cr, uid, ids, context=context)110 return super(account_asset_asset, self).unlink(cr, uid, ids, context=context)
83111
84 def _get_period(self, cr, uid, context=None):112 def _get_period(self, cr, uid, context=None):
@@ -94,11 +122,11 @@
94 @return: Returns a dictionary of the effective dates of the last depreciation entry made for given asset ids. If there isn't any, return the purchase date of this asset122 @return: Returns a dictionary of the effective dates of the last depreciation entry made for given asset ids. If there isn't any, return the purchase date of this asset
95 """123 """
96 cr.execute("""124 cr.execute("""
97 SELECT a.id as id, COALESCE(MAX(l.date),a.purchase_date) AS date125 SELECT a.id as id, COALESCE(MAX(l.date),a.date) AS date
98 FROM account_asset_asset a126 FROM account_asset_asset a
99 LEFT JOIN account_move_line l ON (l.asset_id = a.id)127 LEFT JOIN account_move_line l ON (l.asset_id = a.id)
100 WHERE a.id IN %s128 WHERE a.id IN %s
101 GROUP BY a.id, a.purchase_date """, (tuple(ids),))129 GROUP BY a.id, a.date """, (tuple(ids),))
102 return dict(cr.fetchall())130 return dict(cr.fetchall())
103131
104 def _compute_board_amount(self, cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=None):132 def _compute_board_amount(self, cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=None):
@@ -109,7 +137,7 @@
109 else:137 else:
110 if asset.method == 'linear':138 if asset.method == 'linear':
111 amount = amount_to_depr / (undone_dotation_number - len(posted_depreciation_line_ids))139 amount = amount_to_depr / (undone_dotation_number - len(posted_depreciation_line_ids))
112 if asset.prorata:140 if asset.prorata and asset.category_id.type == 'purchase':
113 amount = amount_to_depr / asset.method_number141 amount = amount_to_depr / asset.method_number
114 days = total_days - float(depreciation_date.strftime('%j'))142 days = total_days - float(depreciation_date.strftime('%j'))
115 if i == 1:143 if i == 1:
@@ -134,13 +162,14 @@
134 while depreciation_date <= end_date:162 while depreciation_date <= end_date:
135 depreciation_date = (datetime(depreciation_date.year, depreciation_date.month, depreciation_date.day) + relativedelta(months=+asset.method_period))163 depreciation_date = (datetime(depreciation_date.year, depreciation_date.month, depreciation_date.day) + relativedelta(months=+asset.method_period))
136 undone_dotation_number += 1164 undone_dotation_number += 1
137 if asset.prorata:165 if asset.prorata and asset.category_id.type == 'purchase':
138 undone_dotation_number += 1166 undone_dotation_number += 1
139 return undone_dotation_number167 return undone_dotation_number
140168
141 def compute_depreciation_board(self, cr, uid, ids, context=None):169 def compute_depreciation_board(self, cr, uid, ids, context=None):
142 depreciation_lin_obj = self.pool.get('account.asset.depreciation.line')170 depreciation_lin_obj = self.pool.get('account.asset.depreciation.line')
143 currency_obj = self.pool.get('res.currency')171 currency_obj = self.pool.get('res.currency')
172 fiscal_year_obj = self.pool.get('account.fiscalyear')
144 for asset in self.browse(cr, uid, ids, context=context):173 for asset in self.browse(cr, uid, ids, context=context):
145 if asset.value_residual == 0.0:174 if asset.value_residual == 0.0:
146 continue175 continue
@@ -153,35 +182,51 @@
153 if asset.prorata:182 if asset.prorata:
154 depreciation_date = datetime.strptime(self._get_last_depreciation_date(cr, uid, [asset.id], context)[asset.id], '%Y-%m-%d')183 depreciation_date = datetime.strptime(self._get_last_depreciation_date(cr, uid, [asset.id], context)[asset.id], '%Y-%m-%d')
155 else:184 else:
156 # depreciation_date = 1st January of purchase year185 # Asset Purchase date & year
157 purchase_date = datetime.strptime(asset.purchase_date, '%Y-%m-%d')186 date = datetime.strptime(asset.date, '%Y-%m-%d')
158 #if we already have some previous validated entries, starting date isn't 1st January but last entry + method period187 #if we already have some previous validated entries, starting date isn't 1st January but last entry + method period
159 if (len(posted_depreciation_line_ids)>0):188 if (len(posted_depreciation_line_ids)>0):
160 last_depreciation_date = datetime.strptime(depreciation_lin_obj.browse(cr,uid,posted_depreciation_line_ids[0],context=context).depreciation_date, '%Y-%m-%d')189 last_depreciation_date = datetime.strptime(depreciation_lin_obj.browse(cr,uid,posted_depreciation_line_ids[0],context=context).depreciation_date, '%Y-%m-%d')
161 depreciation_date = (last_depreciation_date+relativedelta(months=+asset.method_period))190 depreciation_date = (last_depreciation_date+relativedelta(months=+asset.method_period))
162 else:191 else:
163 depreciation_date = datetime(purchase_date.year, 1, 1)192 # Fiscal year based on depreciation date of Asset
193 fiscal_year = fiscal_year_obj.search_read(cr, uid,
194 [('date_start', '<=', time.strftime('%Y-%m-%d')),
195 ('date_stop', '>=', time.strftime('%Y-%m-%d'))],
196 ['date_start'], context=context)
197 # Fiscal year should be there related to purchase date otherwise the journal items have wrong periods and date
198 if not fiscal_year:
199 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_fiscalyear')
200 msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods and configure a fiscal year.') % asset.date
201 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
202 fis_date = datetime.strptime(fiscal_year[0]['date_start'], '%Y-%m-%d')
203 depreciation_date = datetime(date.year, fis_date.month, fis_date.day)
164 day = depreciation_date.day204 day = depreciation_date.day
165 month = depreciation_date.month205 month = depreciation_date.month
166 year = depreciation_date.year206 year = depreciation_date.year
167 total_days = (year % 4) and 365 or 366207 total_days = (year % 4) and 365 or 366
168208
169 undone_dotation_number = self._compute_board_undone_dotation_nb(cr, uid, asset, depreciation_date, total_days, context=context)209 undone_dotation_number = self._compute_board_undone_dotation_nb(cr, uid, asset, depreciation_date, total_days, context=context)
210 dep_sequence = 0
211 for dep_lines in depreciation_lin_obj.browse(cr, uid, sorted(posted_depreciation_line_ids, key=int), context=context):
212 dep_sequence += 1
213 depreciation_lin_obj.write(cr, uid, dep_lines.id, {'sequence': dep_sequence}, context=context)
214 i = 1
215 if posted_depreciation_line_ids:
216 i+= len(posted_depreciation_line_ids)
170 for x in range(len(posted_depreciation_line_ids), undone_dotation_number):217 for x in range(len(posted_depreciation_line_ids), undone_dotation_number):
171 i = x + 1
172 amount = self._compute_board_amount(cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=context)218 amount = self._compute_board_amount(cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=context)
173 company_currency = asset.company_id.currency_id.id219 company_currency = asset.company_id.currency_id.id
174 current_currency = asset.currency_id.id220 current_currency = asset.currency_id.id
175 # compute amount into company currency221 amount = currency_obj.round(cr, uid, asset.currency_id, amount)
176 amount = currency_obj.compute(cr, uid, current_currency, company_currency, amount, context=context)
177 residual_amount -= amount222 residual_amount -= amount
178 vals = {223 vals = {
179 'amount': amount,224 'amount': amount,
180 'asset_id': asset.id,225 'asset_id': asset.id,
181 'sequence': i,226 'sequence': i,
182 'name': str(asset.id) +'/' + str(i),227 'name': (asset.code or str(asset.id)) +'/' + str(i),
183 'remaining_value': residual_amount,228 'remaining_value': residual_amount,
184 'depreciated_value': (asset.purchase_value - asset.salvage_value) - (residual_amount + amount),229 'depreciated_value': (asset.value - asset.salvage_value) - (residual_amount + amount),
185 'depreciation_date': depreciation_date.strftime('%Y-%m-%d'),230 'depreciation_date': depreciation_date.strftime('%Y-%m-%d'),
186 }231 }
187 depreciation_lin_obj.create(cr, uid, vals, context=context)232 depreciation_lin_obj.create(cr, uid, vals, context=context)
@@ -190,31 +235,44 @@
190 day = depreciation_date.day235 day = depreciation_date.day
191 month = depreciation_date.month236 month = depreciation_date.month
192 year = depreciation_date.year237 year = depreciation_date.year
238 i += 1
193 return True239 return True
194240
195 def validate(self, cr, uid, ids, context=None):241 def validate(self, cr, uid, ids, context=None):
196 if context is None:242 if context is None:
197 context = {}243 context = {}
198 return self.write(cr, uid, ids, {244 type = self._get_category_type(cr, uid, ids, context=context).get('type')
199 'state':'open'245 self.message_post(cr, uid, ids, body=_("%s confirmed.") % type, context=context)
200 }, context)246 return self.write(cr, uid, ids, {'state':'open'}, context=context)
201247
202 def set_to_close(self, cr, uid, ids, context=None):248 def set_to_close(self, cr, uid, ids, context=None):
249 if context is None:
250 context = {}
251 dep_line_obj = self.pool.get('account.asset.depreciation.line')
252 res = self._get_category_type(cr, uid, ids, context=context)
253 unposted_dep_line_ids = dep_line_obj.search(cr, uid,
254 [('asset_id', 'in', ids),
255 ('move_check', '=', False)],
256 order='depreciation_date desc',
257 context=context)
258 if len(unposted_dep_line_ids) > 0:
259 raise osv.except_osv(_('Error !'),
260 _('You cannot close an %s which has unposted %s lines.')
261 % (res.get('type'), res.get('name')))
262 self.message_post(cr, uid, ids, body=_("%s closed.") % res.get('type'), context=context)
203 return self.write(cr, uid, ids, {'state': 'close'}, context=context)263 return self.write(cr, uid, ids, {'state': 'close'}, context=context)
204264
205 def set_to_draft(self, cr, uid, ids, context=None):265 def set_to_draft(self, cr, uid, ids, context=None):
206 return self.write(cr, uid, ids, {'state': 'draft'}, context=context)266 return self.write(cr, uid, ids, {'state': 'draft'}, context=context)
207267
208 def _amount_residual(self, cr, uid, ids, name, args, context=None):268 def _amount_residual(self, cr, uid, ids, name, args, context=None):
209 cr.execute("""SELECT269 res = {}
210 l.asset_id as id, SUM(abs(l.debit-l.credit)) AS amount270 total_amount = 0.0
211 FROM
212 account_move_line l
213 WHERE
214 l.asset_id IN %s GROUP BY l.asset_id """, (tuple(ids),))
215 res=dict(cr.fetchall())
216 for asset in self.browse(cr, uid, ids, context):271 for asset in self.browse(cr, uid, ids, context):
217 res[asset.id] = asset.purchase_value - res.get(asset.id, 0.0) - asset.salvage_value272 for line in asset.depreciation_line_ids:
273 if line.move_check:
274 total_amount += line.amount
275 res[asset.id] = asset.value - total_amount - asset.salvage_value
218 for id in ids:276 for id in ids:
219 res.setdefault(id, 0.0)277 res.setdefault(id, 0.0)
220 return res278 return res
@@ -229,13 +287,13 @@
229 val['currency_id'] = company.currency_id.id287 val['currency_id'] = company.currency_id.id
230 return {'value': val}288 return {'value': val}
231 289
232 def onchange_purchase_salvage_value(self, cr, uid, ids, purchase_value, salvage_value, context=None):290 def onchange_purchase_salvage_value(self, cr, uid, ids, value, salvage_value, context=None):
233 val = {}291 val = {}
234 for asset in self.browse(cr, uid, ids, context=context):292 for asset in self.browse(cr, uid, ids, context=context):
235 if purchase_value:293 if value:
236 val['value_residual'] = purchase_value - salvage_value294 val['value_residual'] = value - salvage_value
237 if salvage_value:295 if salvage_value:
238 val['value_residual'] = purchase_value - salvage_value296 val['value_residual'] = value - salvage_value
239 return {'value': val} 297 return {'value': val}
240 def _entry_count(self, cr, uid, ids, field_name, arg, context=None):298 def _entry_count(self, cr, uid, ids, field_name, arg, context=None):
241 MoveLine = self.pool('account.move.line')299 MoveLine = self.pool('account.move.line')
@@ -248,14 +306,14 @@
248 'entry_count': fields.function(_entry_count, string='# Asset Entries', type='integer'),306 'entry_count': fields.function(_entry_count, string='# Asset Entries', type='integer'),
249 'name': fields.char('Asset Name', size=64, required=True, readonly=True, states={'draft':[('readonly',False)]}),307 'name': fields.char('Asset Name', size=64, required=True, readonly=True, states={'draft':[('readonly',False)]}),
250 'code': fields.char('Reference', size=32, readonly=True, states={'draft':[('readonly',False)]}),308 'code': fields.char('Reference', size=32, readonly=True, states={'draft':[('readonly',False)]}),
251 'purchase_value': fields.float('Gross Value', required=True, readonly=True, states={'draft':[('readonly',False)]}),309 'value': fields.float('Value', required=True, readonly=True, digits_compute=dp.get_precision('Account'), states={'draft':[('readonly',False)]}),
252 'currency_id': fields.many2one('res.currency','Currency',required=True, readonly=True, states={'draft':[('readonly',False)]}),310 'currency_id': fields.many2one('res.currency','Currency',required=True, readonly=True, states={'draft':[('readonly',False)]}),
253 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}),311 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}),
254 'note': fields.text('Note'),312 'note': fields.text('Note'),
255 'category_id': fields.many2one('account.asset.category', 'Asset Category', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}),313 'category_id': fields.many2one('account.asset.category', 'Category', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}),
256 'parent_id': fields.many2one('account.asset.asset', 'Parent Asset', readonly=True, states={'draft':[('readonly',False)]}),314 'parent_id': fields.many2one('account.asset.asset', 'Parent Asset', readonly=True, states={'draft':[('readonly',False)]}),
257 'child_ids': fields.one2many('account.asset.asset', 'parent_id', 'Children Assets'),315 'child_ids': fields.one2many('account.asset.asset', 'parent_id', 'Children Assets'),
258 'purchase_date': fields.date('Purchase Date', required=True, readonly=True, states={'draft':[('readonly',False)]}),316 'date': fields.date('Date', required=True, readonly=True, states={'draft':[('readonly',False)]}),
259 'state': fields.selection([('draft','Draft'),('open','Running'),('close','Close')], 'Status', required=True,317 'state': fields.selection([('draft','Draft'),('open','Running'),('close','Close')], 'Status', required=True,
260 help="When an asset is created, the status is 'Draft'.\n" \318 help="When an asset is created, the status is 'Draft'.\n" \
261 "If the asset is confirmed, the status goes in 'Running' and the depreciation lines can be posted in the accounting.\n" \319 "If the asset is confirmed, the status goes in 'Running' and the depreciation lines can be posted in the accounting.\n" \
@@ -274,14 +332,15 @@
274 help="Choose the method to use to compute the dates and number of depreciation lines.\n"\332 help="Choose the method to use to compute the dates and number of depreciation lines.\n"\
275 " * Number of Depreciations: Fix the number of depreciation lines and the time between 2 depreciations.\n" \333 " * Number of Depreciations: Fix the number of depreciation lines and the time between 2 depreciations.\n" \
276 " * Ending Date: Choose the time between 2 depreciations and the date the depreciations won't go beyond."),334 " * Ending Date: Choose the time between 2 depreciations and the date the depreciations won't go beyond."),
277 'prorata':fields.boolean('Prorata Temporis', readonly=True, states={'draft':[('readonly',False)]}, help='Indicates that the first depreciation entry for this asset have to be done from the purchase date instead of the first January'),335 'prorata':fields.boolean('Prorata Temporis', readonly=True, states={'draft':[('readonly',False)]}, help='Indicates that the first depreciation entry for this asset have to be done from the purchase date instead of the first January / Start date of fiscal year'),
278 'history_ids': fields.one2many('account.asset.history', 'asset_id', 'History', readonly=True),336 'history_ids': fields.one2many('account.asset.history', 'asset_id', 'History', readonly=True),
279 'depreciation_line_ids': fields.one2many('account.asset.depreciation.line', 'asset_id', 'Depreciation Lines', readonly=True, states={'draft':[('readonly',False)],'open':[('readonly',False)]}),337 'depreciation_line_ids': fields.one2many('account.asset.depreciation.line', 'asset_id', 'Depreciation Lines', readonly=True, states={'draft':[('readonly',False)],'open':[('readonly',False)]}),
280 'salvage_value': fields.float('Salvage Value', digits_compute=dp.get_precision('Account'), help="It is the amount you plan to have that you cannot depreciate.", readonly=True, states={'draft':[('readonly',False)]}),338 'salvage_value': fields.float('Salvage Value', digits_compute=dp.get_precision('Account'), help="It is the amount you plan to have that you cannot depreciate.", readonly=True, states={'draft':[('readonly',False)]}),
339 'invoice_id': fields.many2one('account.invoice','Invoice', states={'draft':[('readonly',False)]}),
281 }340 }
282 _defaults = {341 _defaults = {
283 'code': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'account.asset.code'),342 'code': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'account.asset.code'),
284 'purchase_date': lambda obj, cr, uid, context: time.strftime('%Y-%m-%d'),343 'date': lambda obj, cr, uid, context: time.strftime('%Y-%m-%d'),
285 'active': True,344 'active': True,
286 'state': 'draft',345 'state': 'draft',
287 'method': 'linear',346 'method': 'linear',
@@ -295,6 +354,10 @@
295354
296 def _check_recursion(self, cr, uid, ids, context=None, parent=None):355 def _check_recursion(self, cr, uid, ids, context=None, parent=None):
297 return super(account_asset_asset, self)._check_recursion(cr, uid, ids, context=context, parent=parent)356 return super(account_asset_asset, self)._check_recursion(cr, uid, ids, context=context, parent=parent)
357
358 def _check_recursion_msg(self, cr, uid, ids, context=None, parent=None):
359 type = self._get_category_type(cr, uid, ids, context=context).get('type')
360 return ' \n\n Error ! \n You cannot create recursive %s.' % type
298361
299 def _check_prorata(self, cr, uid, ids, context=None):362 def _check_prorata(self, cr, uid, ids, context=None):
300 for asset in self.browse(cr, uid, ids, context=context):363 for asset in self.browse(cr, uid, ids, context=context):
@@ -303,7 +366,7 @@
303 return True366 return True
304367
305 _constraints = [368 _constraints = [
306 (_check_recursion, 'Error ! You cannot create recursive assets.', ['parent_id']),369 (_check_recursion, lambda self, *a, **kw: self._check_recursion_msg(*a, **kw), ['parent_id']),
307 (_check_prorata, 'Prorata temporis can be applied only for time method "number of depreciations".', ['prorata']),370 (_check_prorata, 'Prorata temporis can be applied only for time method "number of depreciations".', ['prorata']),
308 ]371 ]
309372
@@ -334,7 +397,15 @@
334 default = {}397 default = {}
335 if context is None:398 if context is None:
336 context = {}399 context = {}
337 default.update({'depreciation_line_ids': [], 'account_move_line_ids': [], 'history_ids': [], 'state': 'draft'})400 asset = self.browse(cr, uid, id, context=context)
401 default.update({
402 'depreciation_line_ids': [],
403 'account_move_line_ids': [],
404 'history_ids': [],
405 'state': 'draft',
406 'name': asset.name+ _(' (copy)'),
407 'invoice_id': False
408 })
338 return super(account_asset_asset, self).copy(cr, uid, id, default, context=context)409 return super(account_asset_asset, self).copy(cr, uid, id, default, context=context)
339410
340 def _compute_entries(self, cr, uid, ids, period_id, context=None):411 def _compute_entries(self, cr, uid, ids, period_id, context=None):
@@ -342,17 +413,30 @@
342 period_obj = self.pool.get('account.period')413 period_obj = self.pool.get('account.period')
343 depreciation_obj = self.pool.get('account.asset.depreciation.line')414 depreciation_obj = self.pool.get('account.asset.depreciation.line')
344 period = period_obj.browse(cr, uid, period_id, context=context)415 period = period_obj.browse(cr, uid, period_id, context=context)
345 depreciation_ids = depreciation_obj.search(cr, uid, [('asset_id', 'in', ids), ('depreciation_date', '<=', period.date_stop), ('depreciation_date', '>=', period.date_start), ('move_check', '=', False)], context=context)416 depreciation_ids = depreciation_obj.search(cr, uid, [('asset_id', 'in', ids),
417 ('depreciation_date', '<=', period.date_stop),
418 ('depreciation_date', '>=', period.date_start),
419 ('move_check', '=', False)],
420 context=context)
346 if context is None:421 if context is None:
347 context = {}422 context = {}
348 context.update({'depreciation_date':period.date_stop})423 context.update({'depreciation_date': period.date_stop})
349 return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context)424 return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context)
350425
351 def create(self, cr, uid, vals, context=None):426 def create(self, cr, uid, vals, context=None):
427 context.update({'mail_create_nolog': True})
352 asset_id = super(account_asset_asset, self).create(cr, uid, vals, context=context)428 asset_id = super(account_asset_asset, self).create(cr, uid, vals, context=context)
353 self.compute_depreciation_board(cr, uid, [asset_id], context=context)429 self.compute_depreciation_board(cr, uid, [asset_id], context=context)
430 type = self._get_category_type(cr, uid, [asset_id], context=context).get('type')
431 self.message_post(cr, uid, [asset_id], body=_("%s created.") % type, context=context)
354 return asset_id432 return asset_id
355 433
434 def write(self, cr, uid, ids, vals, context=None):
435 res = super(account_asset_asset, self).write(cr, uid, ids, vals, context=context)
436 # We need to compute the depreciation line if any changes is there in asset
437 self.compute_depreciation_board(cr, uid, ids, context=context)
438 return res
439
356 def open_entries(self, cr, uid, ids, context=None):440 def open_entries(self, cr, uid, ids, context=None):
357 if context is None:441 if context is None:
358 context = {}442 context = {}
@@ -388,7 +472,7 @@
388 'depreciated_value': fields.float('Amount Already Depreciated', required=True),472 'depreciated_value': fields.float('Amount Already Depreciated', required=True),
389 'depreciation_date': fields.date('Depreciation Date', select=1),473 'depreciation_date': fields.date('Depreciation Date', select=1),
390 'move_id': fields.many2one('account.move', 'Depreciation Entry'),474 'move_id': fields.many2one('account.move', 'Depreciation Entry'),
391 'move_check': fields.function(_get_move_check, method=True, type='boolean', string='Posted', store=True)475 'move_check': fields.function(_get_move_check, method=True, type='boolean', string='Posted', store=True, track_visibility='always')
392 }476 }
393477
394 def create_move(self, cr, uid, ids, context=None):478 def create_move(self, cr, uid, ids, context=None):
@@ -400,33 +484,42 @@
400 move_obj = self.pool.get('account.move')484 move_obj = self.pool.get('account.move')
401 move_line_obj = self.pool.get('account.move.line')485 move_line_obj = self.pool.get('account.move.line')
402 currency_obj = self.pool.get('res.currency')486 currency_obj = self.pool.get('res.currency')
487 obj_sequence = self.pool.get('ir.sequence')
403 created_move_ids = []488 created_move_ids = []
404 asset_ids = []489 asset_ids = []
405 for line in self.browse(cr, uid, ids, context=context):490 for line in self.browse(cr, uid, ids, context=context):
406 depreciation_date = context.get('depreciation_date') or time.strftime('%Y-%m-%d')491 depreciation_date = context.get('depreciation_date') or line.depreciation_date or time.strftime('%Y-%m-%d')
407 period_ids = period_obj.find(cr, uid, depreciation_date, context=context)492 period_ids = period_obj.find(cr, uid, depreciation_date, context=context)
493 context.update({'date': depreciation_date})
408 company_currency = line.asset_id.company_id.currency_id.id494 company_currency = line.asset_id.company_id.currency_id.id
409 current_currency = line.asset_id.currency_id.id495 current_currency = line.asset_id.currency_id.id
410 context.update({'date': depreciation_date})
411 amount = currency_obj.compute(cr, uid, current_currency, company_currency, line.amount, context=context)496 amount = currency_obj.compute(cr, uid, current_currency, company_currency, line.amount, context=context)
412 sign = (line.asset_id.category_id.journal_id.type == 'purchase' and 1) or -1497 sign = (line.asset_id.category_id.journal_id.type == 'purchase' or line.asset_id.category_id.journal_id.type == 'sale' and 1) or -1
413 asset_name = line.asset_id.name498 asset_name = line.asset_id.name
414 reference = line.name499 reference = line.name
500 seq_num = obj_sequence.next_by_id(cr, uid, line.asset_id.category_id.journal_id.sequence_id.id, context)
415 move_vals = {501 move_vals = {
416 'name': asset_name,502 'name': seq_num,
417 'date': depreciation_date,503 'date': depreciation_date,
418 'ref': reference,504 'ref': seq_num,
419 'period_id': period_ids and period_ids[0] or False,505 'period_id': period_ids and period_ids[0] or False,
420 'journal_id': line.asset_id.category_id.journal_id.id,506 'journal_id': line.asset_id.category_id.journal_id.id,
421 }507 }
422 move_id = move_obj.create(cr, uid, move_vals, context=context)508 move_id = move_obj.create(cr, uid, move_vals, context=context)
423 journal_id = line.asset_id.category_id.journal_id.id509 journal_id = line.asset_id.category_id.journal_id.id
424 partner_id = line.asset_id.partner_id.id510 partner_id = line.asset_id.partner_id.id
511 categ_type = line.asset_id.category_id.type
512 if categ_type == 'purchase':
513 debit_account = line.asset_id.category_id.account_expense_depreciation_id.id
514 credit_acount = line.asset_id.category_id.account_depreciation_id.id
515 else:
516 debit_account = line.asset_id.category_id.account_asset_id.id
517 credit_acount = line.asset_id.category_id.account_income_recognition_id.id
425 move_line_obj.create(cr, uid, {518 move_line_obj.create(cr, uid, {
426 'name': asset_name,519 'name': asset_name or reference,
427 'ref': reference,520 'ref': seq_num,
428 'move_id': move_id,521 'move_id': move_id,
429 'account_id': line.asset_id.category_id.account_depreciation_id.id,522 'account_id': credit_acount,
430 'debit': 0.0,523 'debit': 0.0,
431 'credit': amount,524 'credit': amount,
432 'period_id': period_ids and period_ids[0] or False,525 'period_id': period_ids and period_ids[0] or False,
@@ -434,13 +527,14 @@
434 'partner_id': partner_id,527 'partner_id': partner_id,
435 'currency_id': company_currency != current_currency and current_currency or False,528 'currency_id': company_currency != current_currency and current_currency or False,
436 'amount_currency': company_currency != current_currency and - sign * line.amount or 0.0,529 'amount_currency': company_currency != current_currency and - sign * line.amount or 0.0,
437 'date': depreciation_date,530 'analytic_account_id': line.asset_id.category_id.account_analytic_id.id if categ_type == 'sales' else False,
531 'asset_id': line.asset_id.id if categ_type == 'sales' else False
438 })532 })
439 move_line_obj.create(cr, uid, {533 move_line_obj.create(cr, uid, {
440 'name': asset_name,534 'name': asset_name or reference,
441 'ref': reference,535 'ref': seq_num,
442 'move_id': move_id,536 'move_id': move_id,
443 'account_id': line.asset_id.category_id.account_expense_depreciation_id.id,537 'account_id': debit_account,
444 'credit': 0.0,538 'credit': 0.0,
445 'debit': amount,539 'debit': amount,
446 'period_id': period_ids and period_ids[0] or False,540 'period_id': period_ids and period_ids[0] or False,
@@ -448,19 +542,40 @@
448 'partner_id': partner_id,542 'partner_id': partner_id,
449 'currency_id': company_currency != current_currency and current_currency or False,543 'currency_id': company_currency != current_currency and current_currency or False,
450 'amount_currency': company_currency != current_currency and sign * line.amount or 0.0,544 'amount_currency': company_currency != current_currency and sign * line.amount or 0.0,
451 'analytic_account_id': line.asset_id.category_id.account_analytic_id.id,545 'analytic_account_id': line.asset_id.category_id.account_analytic_id.id if categ_type == 'purchase' else False,
452 'date': depreciation_date,546 'asset_id': line.asset_id.id if categ_type == 'purchase' else False
453 'asset_id': line.asset_id.id
454 })547 })
455 self.write(cr, uid, line.id, {'move_id': move_id}, context=context)548 self.write(cr, uid, line.id, {'move_id': move_id}, context=context)
456 created_move_ids.append(move_id)549 created_move_ids.append(move_id)
457 asset_ids.append(line.asset_id.id)550 asset_ids.append(line.asset_id.id)
458 # we re-evaluate the assets to determine whether we can close them551 partner_name = line.asset_id.partner_id.name
552 currency_name = line.asset_id.company_id.currency_id.name
553 msg_data = ['Depreciation','Supplier'] if categ_type == 'purchase' else ['Installment','Customer']
554 msg=_("%s line posted. <br/> <b>&nbsp;&nbsp;&nbsp;"
555 "&bull; Currency:</b> %s <br/> <b>&nbsp;&nbsp;&nbsp;"
556 "&bull; Posted Amount:</b> %s <br/> <b>&nbsp;&nbsp;&nbsp;"
557 "&bull; %s:</b> %s") % (msg_data[0],
558 currency_name,
559 line.amount,
560 msg_data[1],
561 partner_name)
562 asset_obj.message_post(cr, uid, line.asset_id.id, body=msg, context=context)
563 # we re-evaluate the assets to determine whether we can close them
459 for asset in asset_obj.browse(cr, uid, list(set(asset_ids)), context=context):564 for asset in asset_obj.browse(cr, uid, list(set(asset_ids)), context=context):
460 if currency_obj.is_zero(cr, uid, asset.currency_id, asset.value_residual):565 if currency_obj.is_zero(cr, uid, asset.currency_id, asset.value_residual):
566 name = 'Asset' if categ_type == 'purchase' else 'Recognition'
567 asset_obj.message_post(cr, uid, asset.id, body=_("%s closed.") % name, context=context)
461 asset.write({'state': 'close'})568 asset.write({'state': 'close'})
569 asset_obj.compute_depreciation_board(cr, uid, [], context=context)
462 return created_move_ids570 return created_move_ids
463571
572 def unlink(self, cr, uid, ids, context=None):
573 for record in self.browse(cr, uid, ids, context=context):
574 name = 'depreciation' if record.asset_id.category_id.type == 'purchase' else 'installment'
575 if record.move_check:
576 raise osv.except_osv(_('Error!'), _("You cannot delete posted %s lines.") % name)
577 return super(account_asset_depreciation_line, self).unlink(cr, uid, ids, context=context)
578
464579
465class account_move_line(osv.osv):580class account_move_line(osv.osv):
466 _inherit = 'account.move.line'581 _inherit = 'account.move.line'
@@ -493,5 +608,4 @@
493 'user_id': lambda self, cr, uid, ctx: uid608 'user_id': lambda self, cr, uid, ctx: uid
494 }609 }
495610
496
497# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:611# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
498612
=== modified file 'account_asset/account_asset_demo.xml'
--- account_asset/account_asset_demo.xml 2013-01-02 11:46:19 +0000
+++ account_asset/account_asset_demo.xml 2014-05-28 05:47:51 +0000
@@ -12,6 +12,8 @@
12 <field name="journal_id" ref="account.expenses_journal"/>12 <field name="journal_id" ref="account.expenses_journal"/>
13 <field name="name">Hardware - 3 Years</field>13 <field name="name">Hardware - 3 Years</field>
14 <field name="method_number">3</field>14 <field name="method_number">3</field>
15 <field name="method_period">12</field>
16 <field name="type">purchase</field>
15 </record>17 </record>
1618
17 <record id="account_asset_category_sale" model="account.asset.category">19 <record id="account_asset_category_sale" model="account.asset.category">
@@ -21,16 +23,33 @@
21 <field name="journal_id" ref="account.expenses_journal"/>23 <field name="journal_id" ref="account.expenses_journal"/>
22 <field name="name">Cars - 5 Years</field>24 <field name="name">Cars - 5 Years</field>
23 <field name="method_number">5</field>25 <field name="method_number">5</field>
24 </record>26 <field name="method_period">12</field>
2527 <field name="type">purchase</field>
2628 </record>
27 <record id="account_asset_category_sale" model="account.asset.category">29
28 <field name="account_expense_depreciation_id" ref="account.a_sale"/>30
29 <field name="account_asset_id" ref="account.xfa"/>31 <record id="account_asset_category_sale0" model="account.asset.category">
30 <field name="account_depreciation_id" ref="account.xfa"/>32 <field name="account_expense_depreciation_id" ref="account.a_sale"/>
31 <field name="journal_id" ref="account.expenses_journal"/>33 <field name="account_asset_id" ref="account.xfa"/>
32 <field name="name">Revenue Recognition Maintenance Contract - 3 Years</field>34 <field name="account_depreciation_id" ref="account.xfa"/>
33 <field name="method_number">3</field>35 <field name="account_income_recognition_id" ref="account.a_sale"/>
36 <field name="journal_id" ref="account.sales_journal"/>
37 <field name="name">Maintenance Contract - 6 month</field>
38 <field name="method_number">6</field>
39 <field name="method_period">1</field>
40 <field name="prorata" eval="True"/>
41 </record>
42
43 <record id="account_asset_category_sale1" model="account.asset.category">
44 <field name="account_expense_depreciation_id" ref="account.a_sale"/>
45 <field name="account_asset_id" ref="account.xfa"/>
46 <field name="account_depreciation_id" ref="account.xfa"/>
47 <field name="account_income_recognition_id" ref="account.a_sale"/>
48 <field name="journal_id" ref="account.sales_journal"/>
49 <field name="name">Contract - 12 month</field>
50 <field name="method_number">12</field>
51 <field name="method_period">1</field>
52 <field name="prorata" eval="True"/>
34 </record>53 </record>
3554
36 <!-- 55 <!--
@@ -41,10 +60,10 @@
41 <field eval="2000.0" name="salvage_value"/>60 <field eval="2000.0" name="salvage_value"/>
42 <field name="state">open</field>61 <field name="state">open</field>
43 <field eval="12" name="method_period"/>62 <field eval="12" name="method_period"/>
44 <field eval="10" name="method_number"/>63 <field eval="5" name="method_number"/>
45 <field name="name">CEO's Car</field>64 <field name="name">CEO's Car</field>
46 <field eval="12000.0" name="purchase_value"/>65 <field eval="12000.0" name="value"/>
47 <field name="category_id" ref="account_asset_category_fixedassets0"/>66 <field name="category_id" ref="account_asset_category_sale"/>
48 </record>67 </record>
4968
50 <record id="account_asset_asset_cab0" model="account.asset.asset">69 <record id="account_asset_asset_cab0" model="account.asset.asset">
@@ -52,7 +71,7 @@
52 <field eval="0.0" name="salvage_value"/>71 <field eval="0.0" name="salvage_value"/>
53 <field name="method_time">end</field>72 <field name="method_time">end</field>
54 <field name="name">V6 Engine and 10 inches tires</field>73 <field name="name">V6 Engine and 10 inches tires</field>
55 <field eval="2800.0" name="purchase_value"/>74 <field eval="2800.0" name="value"/>
56 <field name="category_id" ref="account_asset_category_fixedassets0"/>75 <field name="category_id" ref="account_asset_category_fixedassets0"/>
57 <field name="parent_id" ref="account_asset_asset_vehicles0"/>76 <field name="parent_id" ref="account_asset_asset_vehicles0"/>
58 </record>77 </record>
@@ -62,12 +81,34 @@
62 <field eval="100000.0" name="salvage_value"/>81 <field eval="100000.0" name="salvage_value"/>
63 <field name="state">open</field>82 <field name="state">open</field>
64 <field eval="12" name="method_period"/>83 <field eval="12" name="method_period"/>
65 <field eval="20" name="method_number"/>84 <field eval="3" name="method_number"/>
66 <field name="purchase_date" eval="time.strftime('%Y-01-01')"/>85 <field name="date" eval="time.strftime('%Y-01-01')"/>
67 <field name="name">Office</field>86 <field name="name">Office</field>
68 <field eval="500000.0" name="purchase_value"/>87 <field eval="500000.0" name="value"/>
69 <field name="category_id" ref="account_asset_category_fixedassets0"/>88 <field name="category_id" ref="account_asset_category_fixedassets0"/>
70 </record>89 </record>
90
91 <record id="account_asset_asset_pc" model="account.asset.asset">
92 <field eval="1" name="prorata"/>
93 <field name="state">open</field>
94 <field eval="1" name="method_period"/>
95 <field eval="12" name="method_number"/>
96 <field name="date" eval="time.strftime('%Y-01-01')"/>
97 <field name="name">Personal Computer</field>
98 <field eval="25000.0" name="value"/>
99 <field name="category_id" ref="account_asset_category_sale1"/>
100 </record>
101
102 <record id="account_asset_asset_a/c" model="account.asset.asset">
103 <field eval="1" name="prorata"/>
104 <field name="state">open</field>
105 <field eval="1" name="method_period"/>
106 <field eval="12" name="method_number"/>
107 <field name="date" eval="time.strftime('%Y-01-01')"/>
108 <field name="name">Air Conditioner</field>
109 <field eval="40000.0" name="value"/>
110 <field name="category_id" ref="account_asset_category_sale1"/>
111 </record>
71 112
72 </data>113 </data>
73</openerp>114</openerp>
74115
=== modified file 'account_asset/account_asset_invoice.py'
--- account_asset/account_asset_invoice.py 2013-10-27 12:31:04 +0000
+++ account_asset/account_asset_invoice.py 2014-05-28 05:47:51 +0000
@@ -41,6 +41,7 @@
41 _inherit = 'account.invoice.line'41 _inherit = 'account.invoice.line'
42 _columns = {42 _columns = {
43 'asset_category_id': fields.many2one('account.asset.category', 'Asset Category'),43 'asset_category_id': fields.many2one('account.asset.category', 'Asset Category'),
44 'recongnition_date': fields.date('Rev. Rec. Start Date'),
44 }45 }
45 def asset_create(self, cr, uid, lines, context=None):46 def asset_create(self, cr, uid, lines, context=None):
46 context = context or {}47 context = context or {}
@@ -51,12 +52,12 @@
51 'name': line.name,52 'name': line.name,
52 'code': line.invoice_id.number or False,53 'code': line.invoice_id.number or False,
53 'category_id': line.asset_category_id.id,54 'category_id': line.asset_category_id.id,
54 'purchase_value': line.price_subtotal,55 'value': line.price_subtotal,
55 'period_id': line.invoice_id.period_id.id,
56 'partner_id': line.invoice_id.partner_id.id,56 'partner_id': line.invoice_id.partner_id.id,
57 'company_id': line.invoice_id.company_id.id,57 'company_id': line.invoice_id.company_id.id,
58 'currency_id': line.invoice_id.currency_id.id,58 'currency_id': line.invoice_id.currency_id.id,
59 'purchase_date' : line.invoice_id.date_invoice,59 'date' : line.recongnition_date or line.invoice_id.date_invoice,
60 'invoice_id': line.invoice_id.id,
60 }61 }
61 changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context)62 changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context)
62 vals.update(changed_vals['value'])63 vals.update(changed_vals['value'])
6364
=== modified file 'account_asset/account_asset_invoice_view.xml'
--- account_asset/account_asset_invoice_view.xml 2013-10-27 12:31:04 +0000
+++ account_asset/account_asset_invoice_view.xml 2014-05-28 05:47:51 +0000
@@ -9,7 +9,8 @@
9 <field name="inherit_id" ref="account.view_invoice_line_form"/>9 <field name="inherit_id" ref="account.view_invoice_line_form"/>
10 <field name="arch" type="xml">10 <field name="arch" type="xml">
11 <field name="account_id" position="after">11 <field name="account_id" position="after">
12 <field name="asset_category_id"/>12 <field name="asset_category_id" domain="[('type','=','sales')]" string="Revenue Recognition Category"/>
13 <field name="recongnition_date"/>
13 </field>14 </field>
14 </field>15 </field>
15 </record>16 </record>
@@ -20,7 +21,19 @@
20 <field name="inherit_id" ref="account.invoice_supplier_form"/>21 <field name="inherit_id" ref="account.invoice_supplier_form"/>
21 <field name="arch" type="xml">22 <field name="arch" type="xml">
22 <xpath expr="//field[@name='invoice_line']/tree/field[@name='quantity']" position="before">23 <xpath expr="//field[@name='invoice_line']/tree/field[@name='quantity']" position="before">
23 <field name="asset_category_id"/>24 <field name="asset_category_id" domain="[('type','=','purchase')]" context="{'default_type':'purchase'}"/>
25 </xpath>
26 </field>
27 </record>
28
29 <record model="ir.ui.view" id="view_customer_invoice_asset_category">
30 <field name="name">account.invoice.customer.form</field>
31 <field name="model">account.invoice</field>
32 <field name="inherit_id" ref="account.invoice_form"/>
33 <field name="arch" type="xml">
34 <xpath expr="//field[@name='invoice_line']/tree/field[@name='quantity']" position="before">
35 <field name="asset_category_id" domain="[('type','=','sales')]" string="Revenue Recognition Category"/>
36 <field name="recongnition_date"/>
24 </xpath>37 </xpath>
25 </field>38 </field>
26 </record>39 </record>
2740
=== modified file 'account_asset/account_asset_view.xml'
--- account_asset/account_asset_view.xml 2014-03-28 14:06:51 +0000
+++ account_asset/account_asset_view.xml 2014-05-28 05:47:51 +0000
@@ -13,25 +13,37 @@
13 <group>13 <group>
14 <group>14 <group>
15 <field name="name"/>15 <field name="name"/>
16 <field name="type" widget="radio" on_change="onchange_type(type)" readonly="context.get('from_asset', False)"/>
16 <field name="company_id" widget="selection" groups="base.group_multi_company"/>17 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
17 </group>18 </group>
18 <group>19 <group>
19 <field name="journal_id"/>20 <field name="journal_id" on_change="onchange_journal_id(journal_id, type)"/>
20 <field name="account_asset_id" on_change="onchange_account_asset(account_asset_id)"/>21 <label for="account_asset_id" string="Revenue Recognition Account" attrs="{'invisible': [('type','!=','sales')]}"/>
21 <field name="account_depreciation_id"/>22 <label for="account_asset_id" string="Asset Account" attrs="{'invisible': [('type','!=','purchase')]}" style="margin-left: -8px"/>
22 <field name="account_expense_depreciation_id"/>23 <field name="account_asset_id" nolabel="1" on_change="onchange_account_asset(account_asset_id)" colspan="0" attrs="{'invisible': [('type','=', False)]}"/>
23 </group>24 <field name="account_income_recognition_id" attrs="{'invisible': [('type','!=','sales')],'required': [('type','=','sales')]}" colspan="0"/>
24 <group string="Depreciation Dates">25 <label for="account_depreciation_id" string="Depreciation Account" attrs="{'invisible': [('type','!=','purchase')]}" style="margin-left: -8px"/>
25 <field name="method_time"/>26 <field name="account_depreciation_id" nolabel="1" attrs="{'invisible': [('type','!=','purchase')]}" colspan="0"/>
26 <field name="method_number" attrs="{'invisible':[('method_time','=','end')], 'required':[('method_time','=','number')]}"/>27 <field name="account_expense_depreciation_id" attrs="{'invisible': [('type','!=','purchase')],'required': [('type','=','purchase')]}"/>
27 <field name="method_period"/>28 </group>
28 <field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','=','number')]}"/>29 <group>
29 </group>30 <separator string="Installment Information" attrs="{'invisible': [('type','!=','sales')]}" colspan="2"/>
30 <group string="Depreciation Method">31 <separator string="Depreciation Information" attrs="{'invisible': [('type','=','sales')]}" colspan="2"/>
32 <field name="method_time" string="Time Method Based On" widget="radio" attrs="{'invisible': [('type','!=','purchase')]}"/>
33 <label for="method_number" string="Number of Installment" attrs="{'invisible': [('type','!=','sales')]}"/>
34 <label for="method_number" string="Number of Depreciations" attrs="{'invisible': [('type','!=','purchase')]}" style="margin-left: -8px" colspan="0"/>
35 <field name="method_number" nolabel="1" string="Number of Depreciations" attrs="{'invisible':['|',('method_time','!=','number'),'&amp;',('type','=', False)], 'required':[('method_time','=','number')]}"/>
36 <label for="method_period" string="Installment Period" attrs="{'invisible': [('type','!=','sales')]}"/>
37 <label for="method_period" string="Depreciation Period " attrs="{'invisible': [('type','!=','purchase')]}" style="margin-left: -8px" colspan="0"/>
38 <field name="method_period" nolabel="1" attrs="{'invisible': [('type','=', False)]}"/>
39 <field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','!=','end')]}"/>
40 <field name="open_asset"/>
41 </group>
42 <group attrs="{'invisible': [('type','=','sales')]}">
43 <separator string="Depreciation Method" colspan="2"/>
31 <field name="method"/>44 <field name="method"/>
32 <field name="method_progress_factor" attrs="{'invisible':[('method','=','linear')], 'required':[('method','=','degressive')]}"/>45 <field name="method_progress_factor" attrs="{'invisible':[('method','=','linear')], 'required':[('method','=','degressive')]}"/>
33 <field name="prorata"/>46 <field name="prorata"/>
34 <field name="open_asset"/>
35 </group>47 </group>
36 <group groups="analytic.group_analytic_accounting" string="Analytic Information">48 <group groups="analytic.group_analytic_accounting" string="Analytic Information">
37 <field name="account_analytic_id"/>49 <field name="account_analytic_id"/>
@@ -51,6 +63,7 @@
51 <field name="name"/>63 <field name="name"/>
52 <field name="journal_id"/>64 <field name="journal_id"/>
53 <field name="method"/>65 <field name="method"/>
66 <field name="type"/>
54 <field name="company_id" groups="base.group_multi_company"/>67 <field name="company_id" groups="base.group_multi_company"/>
55 </tree>68 </tree>
56 </field>69 </field>
@@ -61,16 +74,222 @@
61 <field name="model">account.asset.category</field>74 <field name="model">account.asset.category</field>
62 <field name="arch" type="xml">75 <field name="arch" type="xml">
63 <search string="Search Asset Category">76 <search string="Search Asset Category">
64 <field name="name" string="Asset Category"/>77 <filter icon="terp-check" string="Sales" domain="[('type','=', 'sales')]" help="Revenue Recognitions"/>
78 <filter icon="terp-dialog-close" string="Purchase" domain="[('type','=', 'purchase')]" help="Assets"/>
79 <field name="name" string="Category"/>
65 <field name="journal_id"/>80 <field name="journal_id"/>
81 <group expand="0" string="Group By...">
82 <filter string="Type" domain="[]" context="{'group_by':'type'}"/>
83 </group>
84 </search>
85 </field>
86 </record>
87
88 <record id="view_account_move_line_filter_new" model="ir.ui.view">
89 <field name="name">Journal Items</field>
90 <field eval="30" name="priority"/>
91 <field name="model">account.move.line</field>
92 <field name="arch" type="xml">
93 <search string="Search Journal Items">
94 <field name="name" filter_domain="['|', ('name','ilike',self), ('ref','ilike',self)]" string="Move"/>
95 <field name="date"/>
96 <filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
97 <separator/>
98 <filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
99 <filter name="posted" icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/>
100 <separator/>
101 <filter icon="terp-dolar_ok!" string="Unreconciled" domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help="Unreconciled Journal Items" name="unreconciled"/>
102 <separator/>
103 <filter string="Next Partner to Reconcile" help="Next Partner Entries to reconcile" name="next_partner" context="{'next_partner_only': 1}" icon="terp-gtk-jump-to-ltr" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
104 <field name="move_id" string="Number (Move)"/>
105 <field name="account_id"/>
106 <field name="asset_id" string="Recognition"/>
107 <field name="partner_id"/>
108 <field name="journal_id" context="{'journal_id':self}" widget="selection"/> <!-- it's important to keep widget='selection' in this filter viewbecause without that the value passed in the context is not the ID but the textual value (name) of the selected journal -->
109 <field name="period_id" context="{'period_id':self}" widget="selection"/> <!-- it's important to keep the widget='selection' in this field, for the same reason as explained above -->
110 <group expand="0" string="Group By...">
111 <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
112 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
113 <filter string="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
114 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
115 </group>
66 </search>116 </search>
67 </field>117 </field>
68 </record>118 </record>
69119
120 <record id="action_account_moves_all_search" model="ir.actions.act_window">
121 <field name="name">Journal Items</field>
122 <field name="res_model">account.move.line</field>
123 <field name="context">{'search_default_asset_id': [active_id]}</field>
124 <field name="search_view_id" ref="view_account_move_line_filter_new"/>
125 </record>
126
70 <!--127 <!--
128 Asset Revenue Recognition Form
129 -->
130
131 <record model="ir.ui.view" id="view_revenue_recognition_form">
132 <field name="name">account.revenue.recognition.form</field>
133 <field name="model">account.asset.asset</field>
134 <field name="arch" type="xml">
135 <form string="Revenue" version="7.0">
136 <header>
137 <button name="validate" states="draft" string="Confirm Recognition" type="object" class="oe_highlight"/>
138 <button name="set_to_close" states="open" string="Set to Close" type="object" class="oe_highlight"/>
139 <button name="set_to_draft" states="open" string="Set to Draft" type="object" />
140 <field name="state" widget="statusbar" statusbar_visible="draft,open"/>
141 </header>
142 <sheet>
143 <div class="oe_button_box oe_right">
144 <button class="oe_inline oe_stat_button" name="%(action_account_moves_all_search)d" type="action" icon="fa-pencil">
145 <field string="Entries" name="entry_count" widget="statinfo" />
146 </button>
147 </div>
148 <div class="oe_title">
149 <label for="name" class="oe_edit_only" string="Recognition Name"/>
150 <h1>
151 <field name="name" class="oe_inline"/>
152 </h1>
153 </div>
154 <group>
155 <group>
156 <field name="category_id" on_change="onchange_category_id(category_id)" string="Category" domain="[('type','=','sales')]" help="Category of revenue recognition" context="{'from_asset':True}"/>
157 <field name="code"/>
158 <field name="parent_id" string="Parent Recognition" domain="[('category_id.type', '=', 'sales')]" help="Used as parent recognition of this recognition"/>
159 <field name="date" string="Sale Date" help="Sale date of revenue recognition"/>
160 <field name="company_id" widget="selection" groups="base.group_multi_company" on_change="onchange_company_id(company_id)"/>
161 </group>
162 <group>
163 <field name="currency_id" groups="base.group_multi_currency"/>
164 <field name="value" string="Sale Value" widget="monetary" options="{'currency_field': 'currency_id'}" help="Sale value of revenue recognition"/>
165 <field name="partner_id" string="Customer"/>
166 <field name="invoice_id" string="Sale Invoice" domain="[('invoice_line.asset_category_id.type','=','sales')]"/>
167 </group>
168 </group>
169 <notebook colspan="4">
170 <page string="Installment Board">
171 <field name="depreciation_line_ids" mode="tree" string="Installment Lines" options="{'reload_whole_on_button': true}">
172 <tree string="Installment Lines" colors="blue:(move_check == False);black:(move_check == True)" create="false">
173 <field name="sequence" string="Serial Number"/>
174 <field name="depreciation_date" string="Due Date"/>
175 <field name="depreciated_value" invisible="1" string="Amount Already Paid"/>
176 <field name="amount" readonly="1" string="Installment Amount"/>
177 <field name="remaining_value" readonly="1" string="Remaining Value"/>
178 <field name="move_check" invisible="1"/>
179 <field name="parent_state" invisible="1"/>
180 <button name="create_move" type="object" widget="widgetonbutton"/>
181 </tree>
182 <form string="Installment Lines">
183 <group>
184 <group>
185 <field name="asset_id" invisible="1"/>
186 <field name="parent_state" invisible="1"/>
187 <field name="name" string="Installment Name"/>
188 <field name="sequence"/>
189 <field name="move_id" string="Installment Entry"/>
190 <field name="move_check"/>
191 <field name="parent_state" invisible="1"/>
192 </group>
193 <group>
194 <field name="amount" string="Current Installment"/>
195 <field name="depreciation_date" string="Due Date"/>
196 <field name="depreciated_value" readonly="1" string="Amount Already Paid"/>
197 <field name="remaining_value" readonly="1" string="Remaining value"/>
198 </group>
199 </group>
200 </form>
201 </field>
202 <button type="object" name="compute_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','=','close')]}"/>
203 </page>
204 <page string="History">
205 <field name="history_ids" readonly="1"/>
206 </page>
207 </notebook>
208 <separator string="Installment Information" colspan="4"/>
209 <group>
210 <field name="method_number" string="Number of Installment" help="The number of installment needed for your recognition"/>
211 <field name="method_period" string="Installment Period" help="State here the time between 2 installments, in months"/>
212 <button name="%(action_asset_modify)d" states="open" string="(update)" type="action" class="oe_inline oe_link" colspan="4"/>
213 <field name="prorata" invisible="1"/>
214 </group>
215 </sheet>
216 <div class="oe_chatter">
217 <field name="message_follower_ids" widget="mail_followers" groups="base.group_user" />
218 <field name="message_ids" widget="mail_thread"/>
219 </div>
220 </form>
221 </field>
222 </record>
223
224 <record model="ir.ui.view" id="view_account_revenue_recognition_tree">
225 <field name="name">account.revenue.recognition.tree</field>
226 <field name="model">account.asset.asset</field>
227 <field name="field_parent">child_ids</field>
228 <field name="arch" type="xml">
229 <tree string="Revenue Recognition" colors="blue:(state == 'draft');grey:(state == 'close')">
230 <field name="name" string="Name"/>
231 <field name="category_id" string="Category"/>
232 <field name="date" string="Sale Date"/>
233 <field name="partner_id" string="Customer"/>
234 <field name="value" string="Sale Value"/>
235 <field name="currency_id" groups="base.group_multi_currency"/>
236 <field name="company_id" groups="base.group_multi_company"/>
237 <field name="state"/>
238 </tree>
239 </field>
240 </record>
241
242 <record id="view_account_revenue_recognition_search" model="ir.ui.view">
243 <field name="name">account.revenue.recognition.search</field>
244 <field name="model">account.asset.asset</field>
245 <field name="arch" type="xml">
246 <search string="Account Revenue Recognition Search">
247 <field name="name" string="Recognition"/>
248 <field name="category_id" string="Recognition Category"/>
249 <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
250 <filter icon="terp-check" string="Current" domain="[('state','in', ('draft','open'))]" help="Recognition in draft and open states"/>
251 <filter icon="terp-dialog-close" string="Closed" domain="[('state','=', 'close')]" help="Recognition in closed state"/>
252 <group expand="0" string="Group By...">
253 <filter string="Category" icon="terp-go-month" domain="[]" context="{'group_by':'category_id'}"/>
254 <filter string="Sale Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
255 <filter string="Parent" icon="terp-go-month" domain="[]" context="{'group_by':'parent_id'}"/>
256 <filter string="Recognition Name" context="{'group_by':'name'}" invisible="1"/>
257 </group>
258 </search>
259 </field>
260 </record>
261 <record model="ir.ui.view" id="view_account_revenue_recognition_graph">
262 <field name="name">account.revenue.recognition.graph</field>
263 <field name="model">account.asset.asset</field>
264 <field name="arch" type="xml">
265 <graph string="Assets" type="bar">
266 <field name="name" type="row"/>
267 <field name="value" type="measure"/>
268 </graph>
269 </field>
270 </record>
271
272 <record model="ir.ui.view" id="view_account_revenue_recognition_hierarchy_tree">
273 <field name="name">account.revenue.recognition.hierarchy</field>
274 <field name="model">account.asset.asset</field>
275 <field name="field_parent">child_ids</field>
276 <field name="arch" type="xml">
277 <tree string="Revenue Recognition Hierarchy view">
278 <field name="name" string="Name"/>
279 <field name="category_id" string="Category"/>
280 <field name="code"/>
281 <field name="date" string="Sales Date"/>
282 <field name="value" string="Sales value"/>
283 <field name="currency_id" groups="base.group_multi_currency"/>
284 <field name="company_id" groups="base.group_multi_company"/>
285 <field name="state"/>
286 </tree>
287 </field>
288 </record>
289 <!--
71 Asset290 Asset
72 -->291 -->
73292
74 <record model="ir.ui.view" id="view_account_asset_asset_form">293 <record model="ir.ui.view" id="view_account_asset_asset_form">
75 <field name="name">account.asset.asset.form</field>294 <field name="name">account.asset.asset.form</field>
76 <field name="model">account.asset.asset</field>295 <field name="model">account.asset.asset</field>
@@ -96,51 +315,33 @@
96 </div>315 </div>
97 <group>316 <group>
98 <group>317 <group>
99 <field name="category_id" on_change="onchange_category_id(category_id)"/>318 <field name="category_id" on_change="onchange_category_id(category_id)" domain="[('type','=','purchase')]" string="Asset Category" context="{'default_type':'purchase','default_method_period':12,'from_asset':True}" help="Category of asset"/>
100 <field name="code"/>319 <field name="code"/>
101 <field name="parent_id"/>320 <field name="parent_id" domain="[('category_id.type','=','purchase')]" help="Used as parent asset of this asset"/>
321 <field name="date" string="Purchase Date" help="Purchase date of asset"/>
322 <field name="company_id" widget="selection" groups="base.group_multi_company" on_change="onchange_company_id(company_id)"/>
102 </group>323 </group>
103 <group>324 <group>
104 <field name="purchase_date"/>
105 <field name="currency_id" groups="base.group_multi_currency"/>325 <field name="currency_id" groups="base.group_multi_currency"/>
106 <field name="company_id" widget="selection" groups="base.group_multi_company" on_change="onchange_company_id(company_id)"/>326 <field name="value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(value, salvage_value)" string="Gross Value" help="Gross value of asset"/>
327 <field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(value, salvage_value)"/>
328 <field name="value_residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
329 <field name="partner_id" string="Supplier"/>
330 <field name="invoice_id" string="Purchase Invoice" domain="[('invoice_line.asset_category_id.type','=','purchase')]"/>
107 </group>331 </group>
108 </group>332 </group>
109 <notebook colspan="4">333 <notebook colspan="4">
110 <page string="General">
111 <group>
112 <group>
113 <field name="purchase_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(purchase_value, salvage_value)"/>
114 <field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(purchase_value, salvage_value)"/>
115 <field name="value_residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
116 <field name="partner_id"/>
117 </group>
118 <group>
119 <field name="method"/>
120 <field name="method_progress_factor" attrs="{'invisible':[('method','=','linear')], 'required':[('method','=','degressive')]}"/>
121 <label for="method_time"/>
122 <div>
123 <field name="method_time" on_change="onchange_method_time(method_time)" class="oe_inline"/>
124 <button name="%(action_asset_modify)d" states="open" string="Change Duration" type="action" icon="terp-stock_effects-object-colorize" class="oe_inline" colspan="1"/>
125 </div>
126 <field name="prorata" attrs="{'invisible': [('method_time','=','end')]}"/>
127 <field name="method_number" attrs="{'invisible':[('method_time','=','end')], 'required':[('method_time','=','number')]}"/>
128 <field name="method_period"/>
129 <field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','=','number')]}"/>
130 </group>
131 </group>
132 </page>
133 <page string="Depreciation Board">334 <page string="Depreciation Board">
134 <field name="depreciation_line_ids" mode="tree">335 <field name="depreciation_line_ids" mode="tree" options="{'reload_whole_on_button': true}">
135 <tree string="Depreciation Lines" colors="blue:(move_check == False);black:(move_check == True)">336 <tree string="Depreciation Lines" colors="blue:(move_check == False);black:(move_check == True)" create="false">
337 <field name="sequence" string="Serial Number"/>
136 <field name="depreciation_date"/>338 <field name="depreciation_date"/>
137 <field name="sequence" invisible="1"/>
138 <field name="depreciated_value" readonly="1"/>339 <field name="depreciated_value" readonly="1"/>
139 <field name="amount"/>340 <field name="amount"/>
140 <field name="remaining_value" readonly="1"/>341 <field name="remaining_value" readonly="1"/>
141 <field name="move_check"/>342 <field name="move_check" invisible="1"/>
142 <field name="parent_state" invisible="1"/>343 <field name="parent_state" invisible="1"/>
143 <button name="create_move" attrs="{'invisible':['|',('move_check','!=',False),('parent_state','!=','open')]}" icon="gtk-execute" string="Create Move" type="object"/>344 <button name="create_move" type="object" widget="widgetonbutton"/>
144 </tree>345 </tree>
145 <form string="Depreciation Lines"> 346 <form string="Depreciation Lines">
146 <group>347 <group>
@@ -148,13 +349,13 @@
148 <field name="asset_id" invisible="1"/>349 <field name="asset_id" invisible="1"/>
149 <field name="parent_state" invisible="1"/>350 <field name="parent_state" invisible="1"/>
150 <field name="name"/>351 <field name="name"/>
352 <field name="sequence"/>
353 <field name="move_id"/>
354 <field name="move_check"/>
355 <field name="parent_state" invisible="1"/>
356 </group>
357 <group>
151 <field name="amount"/>358 <field name="amount"/>
152 <field name="move_id"/>
153 <field name="move_check"/>
154 <field name="parent_state" invisible="1"/>
155 </group>
156 <group>
157 <field name="sequence"/>
158 <field name="depreciation_date"/>359 <field name="depreciation_date"/>
159 <field name="depreciated_value" readonly="1"/>360 <field name="depreciated_value" readonly="1"/>
160 <field name="remaining_value" readonly="1"/>361 <field name="remaining_value" readonly="1"/>
@@ -165,14 +366,32 @@
165 <button type="object" name="compute_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','=','close')]}"/>366 <button type="object" name="compute_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','=','close')]}"/>
166 </page>367 </page>
167 <page string="History">368 <page string="History">
168 <field name="account_move_line_ids" readonly="1"/>
169 <field name="history_ids" readonly="1"/>369 <field name="history_ids" readonly="1"/>
170 </page>370 </page>
171 <page string="Notes">
172 <field name="note" placeholder="Add an internal note here..."/>
173 </page>
174 </notebook>371 </notebook>
372 <separator string="Depreciation Information" colspan="4"/>
373 <group>
374 <group>
375 <field name="method"/>
376 <field name="method_progress_factor" attrs="{'invisible':[('method','=','linear')], 'required':[('method','=','degressive')]}"/>
377 <label for="method_time"/>
378 <div>
379 <field name="method_time" on_change="onchange_method_time(method_time)"/>
380 <button name="%(action_asset_modify)d" states="open" string="(update)" type="action" class="oe_inline oe_link" colspan="1"/>
381 </div>
382 <field name="prorata" attrs="{'invisible': [('method_time','=','end')]}"/>
383 </group>
384 <group>
385 <field name="method_number" attrs="{'invisible':[('method_time','=','end')], 'required':[('method_time','=','number')]}"/>
386 <field name="method_period"/>
387 <field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','=','number')]}"/>
388 </group>
389 </group>
175 </sheet>390 </sheet>
391 <div class="oe_chatter">
392 <field name="message_follower_ids" widget="mail_followers"/>
393 <field name="message_ids" widget="mail_thread"/>
394 </div>
176 </form>395 </form>
177 </field>396 </field>
178 </record>397 </record>
@@ -183,11 +402,11 @@
183 <field name="field_parent">child_ids</field>402 <field name="field_parent">child_ids</field>
184 <field name="arch" type="xml">403 <field name="arch" type="xml">
185 <tree string="Assets" colors="blue:(state == 'draft');grey:(state == 'close')">404 <tree string="Assets" colors="blue:(state == 'draft');grey:(state == 'close')">
186 <field name="name"/>405 <field name="name" string="Name"/>
187 <field name="category_id"/>406 <field name="category_id" string="Category"/>
188 <field name="purchase_date"/>407 <field name="date" string="Purchase Date"/>
189 <field name="partner_id"/>408 <field name="partner_id" string="Supplier"/>
190 <field name="purchase_value"/>409 <field name="value" string="Gross Value"/>
191 <field name="value_residual"/>410 <field name="value_residual"/>
192 <field name="currency_id" groups="base.group_multi_currency"/>411 <field name="currency_id" groups="base.group_multi_currency"/>
193 <field name="company_id" groups="base.group_multi_company"/>412 <field name="company_id" groups="base.group_multi_company"/>
@@ -196,6 +415,17 @@
196 </field>415 </field>
197 </record>416 </record>
198417
418 <record model="ir.ui.view" id="view_account_asset_asset_graph">
419 <field name="name">account.asset.asset.graph</field>
420 <field name="model">account.asset.asset</field>
421 <field name="arch" type="xml">
422 <graph string="Assets" type="bar">
423 <field name="name" type="row"/>
424 <field name="value" type="measure"/>
425 </graph>
426 </field>
427 </record>
428
199 <record model="ir.ui.view" id="view_account_asset_asset_hierarchy_tree">429 <record model="ir.ui.view" id="view_account_asset_asset_hierarchy_tree">
200 <field name="name">account.asset.asset.hierarchy</field>430 <field name="name">account.asset.asset.hierarchy</field>
201 <field name="model">account.asset.asset</field>431 <field name="model">account.asset.asset</field>
@@ -204,9 +434,9 @@
204 <tree string="Assets">434 <tree string="Assets">
205 <field name="name"/>435 <field name="name"/>
206 <field name="code"/>436 <field name="code"/>
207 <field name="category_id"/>437 <field name="category_id" string="Asset Category"/>
208 <field name="purchase_date"/>438 <field name="date" string="Purchase Date"/>
209 <field name="purchase_value"/>439 <field name="value" string="Gross Value"/>
210 <field name="value_residual"/>440 <field name="value_residual"/>
211 <field name="currency_id" groups="base.group_multi_currency"/>441 <field name="currency_id" groups="base.group_multi_currency"/>
212 <field name="company_id" groups="base.group_multi_company"/>442 <field name="company_id" groups="base.group_multi_company"/>
@@ -221,11 +451,16 @@
221 <field name="arch" type="xml">451 <field name="arch" type="xml">
222 <search string="Account Asset">452 <search string="Account Asset">
223 <field name="name" string="Asset"/>453 <field name="name" string="Asset"/>
224 <field name="purchase_date"/>454 <field name="date" string="Purchase Date"/>
225 <filter icon="terp-check" string="Current" domain="[('state','in', ('draft','open'))]" help="Assets in draft and open states"/>455 <filter icon="terp-check" string="Current" domain="[('state','in', ('draft','open'))]" help="Assets in draft and open states"/>
226 <filter icon="terp-dialog-close" string="Closed" domain="[('state','=', 'close')]" help="Assets in closed state"/>456 <filter icon="terp-dialog-close" string="Closed" domain="[('state','=', 'close')]" help="Assets in closed state"/>
227 <field name="category_id"/>457 <field name="category_id"/>
228 <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>458 <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
459 <group expand="0" string="Group By...">
460 <filter string="Purchase Month" icon="terp-personal" domain="[]" context="{'group_by':'date'}"/>
461 <filter string="Category" icon="terp-personal" domain="[]" context="{'group_by':'category_id'}"/>
462 <filter string="Parent" icon="terp-go-month" domain="[]" context="{'group_by':'parent_id'}"/>
463 </group>
229 </search>464 </search>
230 </field>465 </field>
231 </record>466 </record>
@@ -273,22 +508,31 @@
273 </tree>508 </tree>
274 </field>509 </field>
275 </record>510 </record>
276511
277 <record model="ir.actions.act_window" id="action_account_asset_asset_tree">512 <record model="ir.actions.act_window" id="action_account_asset_asset_tree">
278 <field name="name">Asset Hierarchy</field>513 <field name="name">Asset Hierarchy</field>
279 <field name="res_model">account.asset.asset</field>514 <field name="res_model">account.asset.asset</field>
280 <field name="view_type">tree</field>515 <field name="view_type">tree</field>
281 <field name="domain">[('parent_id','=',False)]</field>516 <field name="domain">[('parent_id','=',False),('category_id.type', '=', 'purchase')]</field>
282 <field name="view_id" ref="view_account_asset_asset_hierarchy_tree"/>517 <field name="view_id" ref="view_account_asset_asset_hierarchy_tree"/>
283 </record>518 </record>
284519
520 <record model="ir.actions.act_window" id="action_account_revenue_recognition_hierarchy_tree">
521 <field name="name">Revenue Recognition Hierarchy</field>
522 <field name="res_model">account.asset.asset</field>
523 <field name="view_type">tree</field>
524 <field name="view_mode">tree,form</field>
525 <field name="domain">[('parent_id','=',False),('category_id.type', '=', 'sales')]</field>
526 <field name="view_id" ref="view_account_revenue_recognition_hierarchy_tree"/>
527 </record>
528
285 <record id="view_account_move_line_form_inherit" model="ir.ui.view">529 <record id="view_account_move_line_form_inherit" model="ir.ui.view">
286 <field name="name">Journal Items (form)</field>530 <field name="name">Journal Items (form)</field>
287 <field name="model">account.move.line</field>531 <field name="model">account.move.line</field>
288 <field name="inherit_id" ref="account.view_move_line_form"/>532 <field name="inherit_id" ref="account.view_move_line_form"/>
289 <field name="arch" type="xml">533 <field name="arch" type="xml">
290 <field name="statement_id" position="after">534 <field name="statement_id" position="after">
291 <field name="asset_id"/>535 <field name="asset_id" string="Asset"/>
292 </field>536 </field>
293 </field>537 </field>
294 </record>538 </record>
@@ -299,37 +543,94 @@
299 <field name="inherit_id" ref="account.view_account_move_line_filter"/>543 <field name="inherit_id" ref="account.view_account_move_line_filter"/>
300 <field name="arch" type="xml">544 <field name="arch" type="xml">
301 <field name="account_id" position="after">545 <field name="account_id" position="after">
302 <field name="asset_id"/>546 <field name="asset_id" string="Asset"/>
303 </field>547 </field>
304 </field>548 </field>
305 </record>549 </record>
306550
307 <menuitem id="menu_finance_assets" name="Assets" parent="account.menu_finance" sequence="9"/>551 <menuitem id="menu_finance_assets" name="Installment Plans" parent="account.menu_finance" sequence="9"/>
308 <menuitem parent="menu_finance_assets" id="menu_action_account_asset_asset_tree"
309 sequence="100"
310 action="action_account_asset_asset_tree"/>
311552
312 <record model="ir.actions.act_window" id="action_account_asset_asset_form">553 <record model="ir.actions.act_window" id="action_account_asset_asset_form">
313 <field name="name">Assets</field>554 <field name="name">Revenues Assets</field>
314 <field name="res_model">account.asset.asset</field>555 <field name="res_model">account.asset.asset</field>
315 <field name="view_type">form</field>556 <field name="view_type">form</field>
557 <field name="view_mode">tree,form,graph</field>
558 <field name="domain">[('category_id.type', '=', 'purchase')]</field>
316 <field name="view_id" ref="view_account_asset_asset_tree"/>559 <field name="view_id" ref="view_account_asset_asset_tree"/>
317 <field name="search_view_id" ref="view_account_asset_search"/>560 <field name="search_view_id" ref="view_account_asset_search"/>
318 </record>561 </record>
319562
320 <menuitem parent="menu_finance_assets" id="menu_action_account_asset_asset_form" action="action_account_asset_asset_form"/>563 <record model="ir.actions.act_window.view" id="view_action_account_asset_tree">
321564 <field name="sequence" eval="0"/>
322 <act_window id="act_entries_open" name="Entries" res_model="account.move.line" src_model="account.asset.asset" context="{'search_default_asset_id': [active_id], 'default_asset_id': active_id}"/>565 <field name="view_mode">tree</field>
323566 <field name="view_id" ref="view_account_asset_asset_tree"/>
324 <menuitem id="menu_finance_config_assets" name="Assets" parent="account.menu_finance_configuration" sequence="25"/>567 <field name="act_window_id" ref="action_account_asset_asset_form"/>
568 </record>
569 <record model="ir.actions.act_window.view" id="view_action_account_asset_form">
570 <field name="sequence" eval="1"/>
571 <field name="view_mode">form</field>
572 <field name="view_id" ref="view_account_asset_asset_form"/>
573 <field name="act_window_id" ref="action_account_asset_asset_form"/>
574 </record>
575 <record model="ir.actions.act_window.view" id="view_action_account_asset_graph">
576 <field name="sequence" eval="1"/>
577 <field name="view_mode">graph</field>
578 <field name="view_id" ref="view_account_asset_asset_graph"/>
579 <field name="act_window_id" ref="action_account_asset_asset_form"/>
580 </record>
581
582 <!-- Revenue Recognition Action -->
583
584 <record model="ir.actions.act_window" id="action_account_revenue_form">
585 <field name="name">Revenues Recognitions</field>
586 <field name="res_model">account.asset.asset</field>
587 <field name="view_type">form</field>
588 <field name="view_mode">tree,form,graph</field>
589 <field name="domain">[('category_id.type', '=', 'sales')]</field>
590 <field name="view_id" ref="view_account_revenue_recognition_tree"/>
591 <field name="search_view_id" ref="view_account_revenue_recognition_search"/>
592 </record>
593
594 <record model="ir.actions.act_window.view" id="view_action_account_revenue_tree">
595 <field name="sequence" eval="0"/>
596 <field name="view_mode">tree</field>
597 <field name="view_id" ref="view_account_revenue_recognition_tree"/>
598 <field name="act_window_id" ref="action_account_revenue_form"/>
599 </record>
600 <record model="ir.actions.act_window.view" id="view_action_account_revenue_form">
601 <field name="sequence" eval="1"/>
602 <field name="view_mode">form</field>
603 <field name="view_id" ref="view_revenue_recognition_form"/>
604 <field name="act_window_id" ref="action_account_revenue_form"/>
605 </record>
606 <record model="ir.actions.act_window.view" id="view_action_account_revenue_graph">
607 <field name="sequence" eval="1"/>
608 <field name="view_mode">graph</field>
609 <field name="view_id" ref="view_account_revenue_recognition_graph"/>
610 <field name="act_window_id" ref="action_account_revenue_form"/>
611 </record>
612
613 <menuitem parent="menu_finance_assets" id="menu_revenue_recognition" action="action_account_revenue_form" sequence="102"/>
614
615 <menuitem parent="menu_finance_assets" id="menu_action_account_asset_asset_form" action="action_account_asset_asset_form" sequence="104"/>
616
617 <menuitem id="menu_finance_config_assets" name="Installment Plans" parent="account.menu_finance_configuration" sequence="25"/>
325 <record model="ir.actions.act_window" id="action_account_asset_asset_list_normal">618 <record model="ir.actions.act_window" id="action_account_asset_asset_list_normal">
326 <field name="name">Asset Categories</field>619 <field name="name">Categories</field>
327 <field name="res_model">account.asset.category</field>620 <field name="res_model">account.asset.category</field>
328 <field name="view_type">form</field>621 <field name="view_type">form</field>
329 <field name="view_mode">tree,form</field>622 <field name="view_mode">tree,form</field>
330 </record>623 </record>
331624
332 <menuitem parent="menu_finance_config_assets" id="menu_action_account_asset_asset_list_normal" action="action_account_asset_asset_list_normal"/>625 <menuitem name="Categories" parent="menu_finance_config_assets" id="menu_action_account_asset_asset_list_normal" action="action_account_asset_asset_list_normal" sequence="1"/>
333626 <menuitem name="Assets Hierarchy" parent="menu_finance_assets" id="menu_action_account_asset_asset_tree" action="action_account_asset_asset_tree" sequence="105"/>
627 <menuitem name="Revenues Recognition Hierarchy" parent="menu_finance_assets" id="menu_action_revenue_recognition_hierarchy" sequence="103" action="action_account_revenue_recognition_hierarchy_tree"/>
628
629 <template id="assets_backend" name="accountasset assets" inherit_id="web.assets_backend">
630 <xpath expr="." position="inside">
631 <script type="text/javascript" src="/account_asset/static/src/js/account_asset.js"></script>
632 </xpath>
633 </template>
634
334</data>635</data>
335</openerp>636</openerp>
336637
=== modified file 'account_asset/report/account_asset_report.py'
--- account_asset/report/account_asset_report.py 2013-10-27 12:31:04 +0000
+++ account_asset/report/account_asset_report.py 2014-05-28 05:47:51 +0000
@@ -28,15 +28,17 @@
28 _auto = False28 _auto = False
29 _columns = {29 _columns = {
30 'name': fields.char('Year', size=16, required=False, readonly=True),30 'name': fields.char('Year', size=16, required=False, readonly=True),
31 'purchase_date': fields.date('Purchase Date', readonly=True),31 'date': fields.date('Purchase Date', readonly=True),
32 'depreciation_date': fields.date('Depreciation Date', readonly=True),32 'depreciation_date': fields.date('Depreciation Date', readonly=True),
33 'asset_id': fields.many2one('account.asset.asset', string='Asset', readonly=True),33 'asset_id': fields.many2one('account.asset.asset', string='Asset', readonly=True),
34 'asset_category_id': fields.many2one('account.asset.category',string='Asset category'),34 'asset_category_id': fields.many2one('account.asset.category',string='Asset category'),
35 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),35 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
36 'state': fields.selection([('draft','Draft'),('open','Running'),('close','Close')], 'Status', readonly=True),36 'state': fields.selection([('draft','Draft'),('open','Running'),('close','Close')], 'Status', readonly=True),
37 'depreciation_value': fields.float('Amount of Depreciation Lines', readonly=True),37 'depreciation_value': fields.float('Amount of Depreciation Lines', readonly=True),
38 'installment_value': fields.float('Amount of Installment Lines', readonly=True),
38 'move_check': fields.boolean('Posted', readonly=True),39 'move_check': fields.boolean('Posted', readonly=True),
39 'nbr': fields.integer('# of Depreciation Lines', readonly=True),40 'installment_nbr': fields.integer('# of Installment Lines', readonly=True),
41 'depreciation_nbr': fields.integer('# of Depreciation Lines', readonly=True),
40 'gross_value': fields.float('Gross Amount', readonly=True),42 'gross_value': fields.float('Gross Amount', readonly=True),
41 'posted_value': fields.float('Posted Amount', readonly=True),43 'posted_value': fields.float('Posted Amount', readonly=True),
42 'unposted_value': fields.float('Unposted Amount', readonly=True),44 'unposted_value': fields.float('Unposted Amount', readonly=True),
@@ -51,14 +53,15 @@
51 min(dl.id) as id,53 min(dl.id) as id,
52 dl.name as name,54 dl.name as name,
53 dl.depreciation_date as depreciation_date,55 dl.depreciation_date as depreciation_date,
54 a.purchase_date as purchase_date,56 a.date as date,
55 (CASE WHEN (select min(d.id) from account_asset_depreciation_line as d57 (CASE WHEN (select min(d.id) from account_asset_depreciation_line as d
56 left join account_asset_asset as ac ON (ac.id=d.asset_id)58 left join account_asset_asset as ac ON (ac.id=d.asset_id)
57 where a.id=ac.id) = min(dl.id)59 where a.id=ac.id) = min(dl.id)
58 THEN a.purchase_value60 THEN a.value
59 ELSE 061 ELSE 0
60 END) as gross_value,62 END) as gross_value,
61 dl.amount as depreciation_value, 63 dl.amount as depreciation_value,
64 dl.amount as installment_value,
62 (CASE WHEN dl.move_check65 (CASE WHEN dl.move_check
63 THEN dl.amount66 THEN dl.amount
64 ELSE 067 ELSE 0
@@ -72,14 +75,15 @@
72 a.category_id as asset_category_id,75 a.category_id as asset_category_id,
73 a.partner_id as partner_id,76 a.partner_id as partner_id,
74 a.state as state,77 a.state as state,
75 count(dl.*) as nbr,78 count(dl.*) as installment_nbr,
79 count(dl.*) as depreciation_nbr,
76 a.company_id as company_id80 a.company_id as company_id
77 from account_asset_depreciation_line dl81 from account_asset_depreciation_line dl
78 left join account_asset_asset a on (dl.asset_id=a.id)82 left join account_asset_asset a on (dl.asset_id=a.id)
79 group by 83 group by
80 dl.amount,dl.asset_id,dl.depreciation_date,dl.name,84 dl.amount,dl.asset_id,dl.depreciation_date,dl.name,
81 a.purchase_date, dl.move_check, a.state, a.category_id, a.partner_id, a.company_id,85 a.date, dl.move_check, a.state, a.category_id, a.partner_id, a.company_id,
82 a.purchase_value, a.id, a.salvage_value86 a.value, a.id, a.salvage_value
83 )""")87 )""")
84 88
8589
8690
=== modified file 'account_asset/report/account_asset_report_view.xml'
--- account_asset/report/account_asset_report_view.xml 2014-01-29 16:07:09 +0000
+++ account_asset/report/account_asset_report_view.xml 2014-05-28 05:47:51 +0000
@@ -8,7 +8,7 @@
8 <field name="arch" type="xml">8 <field name="arch" type="xml">
9 <graph string="Assets Analysis" type="pivot">9 <graph string="Assets Analysis" type="pivot">
10 <field name="asset_id" type="row"/>10 <field name="asset_id" type="row"/>
11 <field name="nbr" type="measure"/>11 <field name="depreciation_nbr" type="measure"/>
12 <field name="gross_value" type="measure"/>12 <field name="gross_value" type="measure"/>
13 <field name="depreciation_value" type="measure"/>13 <field name="depreciation_value" type="measure"/>
14 <field name="posted_value" type="measure"/>14 <field name="posted_value" type="measure"/>
@@ -16,12 +16,30 @@
16 </field>16 </field>
17 </record>17 </record>
18 18
19 <!--
20 Asset Revenue Recognition Graph
21 -->
22
23 <record model="ir.ui.view" id="action_account_revenue_report_graph">
24 <field name="name">asset.revenue.report.graph</field>
25 <field name="model">asset.asset.report</field>
26 <field name="arch" type="xml">
27 <graph string="Revenue Recognition Analysis" type="pivot">
28 <field name="asset_id" type="row"/>
29 <field name="installment_nbr" type="measure" string="# of Installment Lines"/>
30 <field name="gross_value" type="measure"/>
31 <field name="installment_value" string="Amount of Payment Schedule Line" type="measure"/>
32 <field name="posted_value" type="measure"/>
33 </graph>
34 </field>
35 </record>
36
19 <record id="view_asset_asset_report_search" model="ir.ui.view">37 <record id="view_asset_asset_report_search" model="ir.ui.view">
20 <field name="name">asset.asset.report.search</field>38 <field name="name">asset.asset.report.search</field>
21 <field name="model">asset.asset.report</field>39 <field name="model">asset.asset.report</field>
22 <field name="arch" type="xml">40 <field name="arch" type="xml">
23 <search string="Assets Analysis">41 <search string="Assets Analysis">
24 <field name="purchase_date"/>42 <field name="date"/>
25 <field name="depreciation_date"/>43 <field name="depreciation_date"/>
26 <filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Assets in draft state"/>44 <filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Assets in draft state"/>
27 <filter string="Running" icon="terp-check" domain="[('state','=','open')]" help="Assets in running state"/>45 <filter string="Running" icon="terp-check" domain="[('state','=','open')]" help="Assets in running state"/>
@@ -38,7 +56,7 @@
38 <filter string="Asset Category" name="asset_category" icon="terp-stock_symbol-selection" context="{'group_by':'asset_category_id'}"/>56 <filter string="Asset Category" name="asset_category" icon="terp-stock_symbol-selection" context="{'group_by':'asset_category_id'}"/>
39 <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>57 <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
40 <filter string="Purchase Month" icon="terp-go-month"58 <filter string="Purchase Month" icon="terp-go-month"
41 domain="[]" context="{'group_by':'purchase_date'}" help="Date of asset purchase"/>59 domain="[]" context="{'group_by':'date'}" help="Date of asset purchase"/>
42 <filter string="Depreciation Month" icon="terp-go-today"60 <filter string="Depreciation Month" icon="terp-go-today"
43 domain="[]" context="{'group_by':'depreciation_date'}" help="Date of depreciation"/>61 domain="[]" context="{'group_by':'depreciation_date'}" help="Date of depreciation"/>
44 </group>62 </group>
@@ -46,12 +64,47 @@
46 </field>64 </field>
47 </record>65 </record>
48 66
67 <!--
68 Asset Revenue Recognition Serach
69 -->
70
71 <record id="view_asset_revenue_report_search" model="ir.ui.view">
72 <field name="name">asset.revenue.report.search</field>
73 <field name="model">asset.asset.report</field>
74 <field name="arch" type="xml">
75 <search string="Revenue Recognition Analysis">
76 <field name="date"/>
77 <field name="depreciation_date"/>
78 <filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Assets in draft state"/>
79 <filter string="Running" icon="terp-check" domain="[('state','=','open')]" help="Assets in running state"/>
80 <separator/>
81 <filter string="Posted" name="posted" icon="terp-camera_test" domain="[('move_check','=',True)]" help="Posted depreciation lines" context="{'unposted_value_visible': 0}"/>
82 <field name="asset_id"/>
83 <field name="asset_category_id"/>
84 <group expand="0" string="Extended Filters...">
85 <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
86 <field name="company_id" groups="base.group_multi_company"/>
87 </group>
88 <group expand="1" string="Group By...">
89 <filter string="Revenue Recognition" name="revenue" context="{'group_by':'asset_id'}"/>
90 <filter string="Category" name="category" context="{'group_by':'asset_category_id'}"/>
91 <filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
92 <filter string="Sales Month" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]" context="{'group_by':'date'}" help="Date of Revenue Sales"/>
93 <filter string="Revenue Month" icon="terp-go-month" name='rev_month'
94 context="{'group_by':'depreciation_date'}" help="Revenue Month"/>
95 </group>
96 </search>
97 </field>
98 </record>
99
49 <record model="ir.actions.act_window" id="action_asset_asset_report"> 100 <record model="ir.actions.act_window" id="action_asset_asset_report">
50 <field name="name">Assets Analysis</field>101 <field name="name">Assets</field>
51 <field name="res_model">asset.asset.report</field>102 <field name="res_model">asset.asset.report</field>
52 <field name="view_type">form</field>103 <field name="view_type">form</field>
53 <field name="view_mode">graph</field>104 <field name="view_mode">graph</field>
54 <field name="search_view_id" ref="view_asset_asset_report_search"/>105 <field name="search_view_id" ref="view_asset_asset_report_search"/>
106 <field name="view_id" ref="action_account_asset_report_graph"/>
107 <field name="domain">[('asset_category_id.type', '=', 'purchase')]</field>
55 <field name="context">{'search_default_year':1,'search_default_this_month':1,'search_default_asset_category':1, 'search_default_posted':1, 'group_by':[], 'group_by_no_leaf':1}</field>108 <field name="context">{'search_default_year':1,'search_default_this_month':1,'search_default_asset_category':1, 'search_default_posted':1, 'group_by':[], 'group_by_no_leaf':1}</field>
56 <field name="help" type="html">109 <field name="help" type="html">
57 <p>110 <p>
@@ -62,8 +115,38 @@
62 </field>115 </field>
63 </record>116 </record>
64 117
118 <!--
119 Asset Revenue Recognition Action
120 -->
121
122 <record model="ir.actions.act_window" id="action_asset_revenue_report">
123 <field name="name">Revenues Recognitions</field>
124 <field name="res_model">asset.asset.report</field>
125 <field name="view_type">form</field>
126 <field name="view_mode">graph</field>
127 <field name="search_view_id" ref="view_asset_revenue_report_search"/>
128 <field name="view_id" ref="action_account_revenue_report_graph"/>
129 <field name="domain">[('asset_category_id.type', '=', 'sales')]</field>
130 <field name="context">{'search_default_asset_category':2,'search_default_posted':1,'group_by':[],'group_by_no_leaf':1}</field>
131 <field name="help" type="html">
132 <p>
133 From this report, you can have an overview on all depreciation. The
134 tool search can also be used to personalise your Revenue Recognition reports and
135 so, match this analysis to your needs;
136 </p>
137 </field>
138 </record>
139
65 <menuitem action="action_asset_asset_report"140 <menuitem action="action_asset_asset_report"
66 id="menu_action_asset_asset_report"141 id="menu_action_asset_asset_report"
67 parent="account.menu_finance_reporting"/>142 parent="account.menu_finance_reporting" sequence="21"/>
143
144 <!--
145 Asset Revenue Recognition Manu
146 -->
147
148 <menuitem action="action_asset_revenue_report"
149 id="menu_action_asset_revenue_report"
150 parent="account.menu_finance_reporting" sequence="20"/>
68</data>151</data>
69</openerp>152</openerp>
70153
=== added directory 'account_asset/static/src/js'
=== added file 'account_asset/static/src/js/account_asset.js'
--- account_asset/static/src/js/account_asset.js 1970-01-01 00:00:00 +0000
+++ account_asset/static/src/js/account_asset.js 2014-05-28 05:47:51 +0000
@@ -0,0 +1,22 @@
1openerp.account_asset = function (instance) {
2 var _t = instance.web._t,
3 _lt = instance.web._lt;
4 var QWeb = instance.web.qweb;
5 instance.web.list.WidgetOnButton = instance.web.list.Column.extend({
6 format: function (row_data, options) {
7 this._super(row_data, options);
8 this.has_value = !!row_data.move_check.value;
9 this.parent_state = row_data.parent_state.value;
10 this.icon = this.has_value ? 'gtk-yes' : 'gtk-no';
11 this.string = this.has_value ? 'Posted' : 'Unposted'
12 var template = this.icon && 'ListView.row.buttonwidget';
13 return QWeb.render(template, {
14 widget: this,
15 prefix: instance.session.prefix,
16 disabled: this.has_value,
17 invisible : 'true' ? this.parent_state !== 'open' : 'false'
18 });
19 },
20 });
21 instance.web.list.columns.add("button.widgetonbutton", "instance.web.list.WidgetOnButton");
22};
0\ No newline at end of file23\ No newline at end of file
124
=== modified file 'account_asset/test/account_asset_demo.yml'
--- account_asset/test/account_asset_demo.yml 2011-12-20 10:08:42 +0000
+++ account_asset/test/account_asset_demo.yml 2014-05-28 05:47:51 +0000
@@ -6,4 +6,4 @@
6 category_id: account_asset_category_sale6 category_id: account_asset_category_sale
7-7-
8 !record {model: account.asset.asset, id: account_asset_asset_vehicles0}:8 !record {model: account.asset.asset, id: account_asset_asset_vehicles0}:
9 method_number: 109 method_number: 1
1010
=== added file 'account_asset/test/account_revenue_recognition.yml'
--- account_asset/test/account_revenue_recognition.yml 1970-01-01 00:00:00 +0000
+++ account_asset/test/account_revenue_recognition.yml 2014-05-28 05:47:51 +0000
@@ -0,0 +1,54 @@
1-
2 In order to test the process of revenue recognition from customer invoice, I create customer invoice.
3-
4 !record {model: account.invoice, id: account_invoice_insurance}:
5 partner_id: base.res_partner_12
6 invoice_line:
7 - price_unit: 450.0
8 quantity: 1.0
9 name: 'Insurance claim'
10 recongnition_date: !eval "'%s-01-01' %(datetime.now().year)"
11 asset_category_id: account_asset_category_sale1
12
13-
14 I create revenue recognition by validating invoice.
15-
16 !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_insurance}
17-
18 Test the process of revenue recognition.
19-
20 !python {model: account.asset.asset}: |
21 from datetime import datetime
22 from dateutil.relativedelta import relativedelta
23 line_obj = self.pool.get('account.asset.depreciation.line')
24 invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_insurance"))
25 recognition_ids = self.search(cr, uid, [('code', '=', invoice.number)])
26 assert recognition_ids, 'Revenue recognition has been not created from invoice.'
27
28 #I confirm revenue recognition.
29 self.validate(cr, uid, recognition_ids)
30 recognition = self.browse(cr, uid, recognition_ids[0])
31 first_invoice_line = invoice.invoice_line[0]
32 assert recognition.state == 'open', 'Recognition should be in Open state'
33 assert recognition.value == first_invoice_line.price_subtotal, 'Recognition value is not same as invoice line.'
34 assert recognition.date == first_invoice_line.recongnition_date, 'Recognition date is not same as invoice line.'
35
36 #I post installment lines.
37 line_ids = [rec.id for rec in recognition.depreciation_line_ids]
38 line_obj.create_move(cr, uid, line_ids)
39
40 #I check that move line is created from posted installment lines.
41 assert len(recognition.depreciation_line_ids) == len(recognition.account_move_line_ids), 'Move lines not created correctly.'
42
43 #I check data in move line and installment line.
44 first_installment_line = recognition.depreciation_line_ids[0]
45 first_move_line = recognition.account_move_line_ids[0]
46 assert first_installment_line.amount == first_move_line.credit, 'First installment line amount is incorrect.'
47 assert recognition.category_id.account_income_recognition_id == first_move_line.account_id, 'Move line account and recognition category account is not same.'
48 remaining_value = recognition.value - first_installment_line.amount
49 assert first_installment_line.remaining_value == recognition.value - first_installment_line.amount, 'Remaining value is incorrect.'
50
51 #I check next installment date.
52 last_installment_date = datetime.strptime(first_installment_line.depreciation_date, '%Y-%m-%d')
53 installment_date = (last_installment_date+relativedelta(months=+recognition.method_period))
54 assert recognition.depreciation_line_ids[1].depreciation_date == str(installment_date.date()), 'Installment date is incorrect.'
0\ No newline at end of file55\ No newline at end of file
156
=== added file 'account_asset/test/account_revenue_recognition_demo.yml'
--- account_asset/test/account_revenue_recognition_demo.yml 1970-01-01 00:00:00 +0000
+++ account_asset/test/account_revenue_recognition_demo.yml 2014-05-28 05:47:51 +0000
@@ -0,0 +1,9 @@
1-
2 !record {model: account.asset.category, id: account_asset_category_sale1}:
3 account_asset_id: account.xfa
4-
5 !record {model: account.asset.asset, id: account_asset_asset_pc}:
6 category_id: account_asset_category_sale
7-
8 !record {model: account.asset.asset, id: account_asset_asset_pc}:
9 method_number: 12
0\ No newline at end of file10\ No newline at end of file
111
=== modified file 'account_asset/wizard/account_asset_change_duration.py'
--- account_asset/wizard/account_asset_change_duration.py 2013-10-27 12:31:04 +0000
+++ account_asset/wizard/account_asset_change_duration.py 2014-05-28 05:47:51 +0000
@@ -22,6 +22,7 @@
22from lxml import etree22from lxml import etree
2323
24from openerp.osv import fields, osv24from openerp.osv import fields, osv
25from openerp.osv.orm import setup_modifiers
2526
26class asset_modify(osv.osv_memory):27class asset_modify(osv.osv_memory):
27 _name = 'asset.modify'28 _name = 'asset.modify'
@@ -51,16 +52,18 @@
51 asset_obj = self.pool.get('account.asset.asset')52 asset_obj = self.pool.get('account.asset.asset')
52 result = super(asset_modify, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)53 result = super(asset_modify, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
53 asset_id = context.get('active_id', False)54 asset_id = context.get('active_id', False)
54 active_model = context.get('active_model', '')55 active_model = context.get('active_model')
55 if active_model == 'account.asset.asset' and asset_id:56 if active_model == 'account.asset.asset' and asset_id:
56 asset = asset_obj.browse(cr, uid, asset_id, context=context)57 asset = asset_obj.browse(cr, uid, asset_id, context=context)
57 doc = etree.XML(result['arch'])58 doc = etree.XML(result['arch'])
58 if asset.method_time == 'number':59 if asset.method_time == 'number' and doc.xpath("//field[@name='method_end']"):
59 node = doc.xpath("//field[@name='method_end']")[0]60 node = doc.xpath("//field[@name='method_end']")[0]
60 node.set('invisible', '1')61 node.set('invisible', '1')
61 elif asset.method_time == 'end':62 setup_modifiers(node, result['fields']['method_end'])
63 elif asset.method_time == 'end' and doc.xpath("//field[@name='method_number']"):
62 node = doc.xpath("//field[@name='method_number']")[0]64 node = doc.xpath("//field[@name='method_number']")[0]
63 node.set('invisible', '1')65 node.set('invisible', '1')
66 setup_modifiers(node, result['fields']['method_number'])
64 result['arch'] = etree.tostring(doc)67 result['arch'] = etree.tostring(doc)
65 return result68 return result
6669
6770
=== modified file 'account_asset/wizard/wizard_asset_compute.py'
--- account_asset/wizard/wizard_asset_compute.py 2013-10-27 12:31:04 +0000
+++ account_asset/wizard/wizard_asset_compute.py 2014-05-28 05:47:51 +0000
@@ -41,12 +41,15 @@
4141
42 def asset_compute(self, cr, uid, ids, context):42 def asset_compute(self, cr, uid, ids, context):
43 ass_obj = self.pool.get('account.asset.asset')43 ass_obj = self.pool.get('account.asset.asset')
44 asset_ids = ass_obj.search(cr, uid, [('state','=','open')], context=context)44 asset_ids = ass_obj.search(cr, uid, [('state', '=', 'open'),
45 ('category_id.type', '=', context.get('type',False))],
46 context=context)
45 data = self.browse(cr, uid, ids, context=context)47 data = self.browse(cr, uid, ids, context=context)
46 period_id = data[0].period_id.id48 period_id = data[0].period_id.id
47 created_move_ids = ass_obj._compute_entries(cr, uid, asset_ids, period_id, context=context)49 created_move_ids = ass_obj._compute_entries(cr, uid, asset_ids, period_id, context=context)
50 asset_type = 'Asset' if context.get('type', False) == 'purchase' else 'Recognition'
48 return {51 return {
49 'name': _('Created Asset Moves'),52 'name': _('Created %s Moves') % asset_type,
50 'view_type': 'form',53 'view_type': 'form',
51 'view_mode': 'tree,form',54 'view_mode': 'tree,form',
52 'res_model': 'account.move',55 'res_model': 'account.move',
5356
=== modified file 'account_asset/wizard/wizard_asset_compute_view.xml'
--- account_asset/wizard/wizard_asset_compute_view.xml 2012-11-29 22:26:45 +0000
+++ account_asset/wizard/wizard_asset_compute_view.xml 2014-05-28 05:47:51 +0000
@@ -5,12 +5,18 @@
5 <field name="name">asset.depreciation.confirmation.wizard</field>5 <field name="name">asset.depreciation.confirmation.wizard</field>
6 <field name="model">asset.depreciation.confirmation.wizard</field>6 <field name="model">asset.depreciation.confirmation.wizard</field>
7 <field name="arch" type="xml">7 <field name="arch" type="xml">
8 <form string="Compute Asset" version="7.0">8 <form string="Compute Assets" version="7.0">
9 <div>
10 <p>
11 This wizard will post installment/depreciation lines of selected month.<br/>
12 Note: This will generate journal entry for all related installment lines relay on this period of asset/revenue recongnition and post the installment/depreciation lines.
13 </p>
14 </div>
9 <group>15 <group>
10 <field name="period_id"/>16 <field name="period_id"/>
11 </group>17 </group>
12 <footer>18 <footer>
13 <button string="Compute" name="asset_compute" type="object" class="oe_highlight"/>19 <button string="Generate Entries" name="asset_compute" type="object" class="oe_highlight"/>
14 or20 or
15 <button string="Cancel" class="oe_link" special="cancel"/>21 <button string="Cancel" class="oe_link" special="cancel"/>
16 </footer>22 </footer>
@@ -19,17 +25,33 @@
19 </record>25 </record>
2026
21 <record id="action_asset_depreciation_confirmation_wizard" model="ir.actions.act_window">27 <record id="action_asset_depreciation_confirmation_wizard" model="ir.actions.act_window">
22 <field name="name">Compute Assets</field>28 <field name="name">Post Depreciation Lines</field>
23 <field name="res_model">asset.depreciation.confirmation.wizard</field>29 <field name="res_model">asset.depreciation.confirmation.wizard</field>
24 <field name="view_type">form</field>30 <field name="view_type">form</field>
25 <field name="view_mode">tree,form</field>31 <field name="view_mode">tree,form</field>
26 <field name="view_id" ref="view_asset_depreciation_confirmation_wizard"/>32 <field name="view_id" ref="view_asset_depreciation_confirmation_wizard"/>
27 <field name="target">new</field>33 <field name="target">new</field>
34 <field name="context">{'type':'purchase'}</field>
28 </record>35 </record>
2936
30 <menuitem action="action_asset_depreciation_confirmation_wizard"37 <menuitem name="Generate Monthly Assets Entries" action="action_asset_depreciation_confirmation_wizard"
31 id="menu_asset_depreciation_confirmation_wizard"38 id="menu_asset_depreciation_confirmation_wizard"
32 parent="account.menu_finance_recurrent_entries" />39 parent="account.menu_finance_recurrent_entries" sequence="2"/>
40
41
42 <record id="action_recognition_depreciation_confirmation_wizard" model="ir.actions.act_window">
43 <field name="name">Post Installment Lines</field>
44 <field name="res_model">asset.depreciation.confirmation.wizard</field>
45 <field name="view_type">form</field>
46 <field name="view_mode">tree,form</field>
47 <field name="view_id" ref="view_asset_depreciation_confirmation_wizard"/>
48 <field name="target">new</field>
49 <field name="context">{'type':'sales'}</field>
50 </record>
51
52 <menuitem name="Generate Monthly Recognition Entries" action="action_recognition_depreciation_confirmation_wizard"
53 id="menu_recognition_depreciation_confirmation_wizard"
54 parent="account.menu_finance_recurrent_entries" sequence="1"/>
3355
34 </data>56 </data>
35</openerp>57</openerp>

Subscribers

People subscribed via source and target branches

to all changes: