Merge lp:~openerp-dev/openobject-addons/trunk-asset-amortization into lp:openobject-addons
- trunk-asset-amortization
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Turkesh Patel (openERP) | Pending | ||
Review via email: mp+194827@code.launchpad.net |
Commit message
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).
- 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 processAso 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/Organizatio n
- 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_propertie s
http://schema. org/Product
http://schema. org/Offer Tested with http://
www.google. com/webmasters/ tools/richsnipp ets - 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 viewhr_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 aliasmisc
- 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 dataMisc:
- 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 improvementswebsite_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-claimcoun
t-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
1 | === modified file 'account/res_config.py' | |||
2 | --- account/res_config.py 2014-04-23 11:40:53 +0000 | |||
3 | +++ account/res_config.py 2014-05-28 05:47:51 +0000 | |||
4 | @@ -84,9 +84,11 @@ | |||
5 | 84 | '-This installs the module account_check_writing.'), | 84 | '-This installs the module account_check_writing.'), |
6 | 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.', |
7 | 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, ...)"""), |
11 | 87 | 'module_account_asset': fields.boolean('Assets management', | 87 | 'module_account_asset': fields.boolean('Assets management & Revenue recognition', |
12 | 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.' |
13 | 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' |
14 | 90 | 'Revenue recognition: This allows you to manage the Revenue recognition on selling product.' | ||
15 | 91 | 'It keeps track of the installment occurred on those revenue recognition, and creates account move for those installment lines.\n' | ||
16 | 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, ' |
17 | 91 | 'but not accounting (Journal Items, Chart of Accounts, ...)'), | 93 | 'but not accounting (Journal Items, Chart of Accounts, ...)'), |
18 | 92 | 'module_account_budget': fields.boolean('Budget management', | 94 | 'module_account_budget': fields.boolean('Budget management', |
19 | 93 | 95 | ||
20 | === modified file 'account_asset/__openerp__.py' | |||
21 | --- account_asset/__openerp__.py 2012-12-06 15:38:56 +0000 | |||
22 | +++ account_asset/__openerp__.py 2014-05-28 05:47:51 +0000 | |||
23 | @@ -20,17 +20,21 @@ | |||
24 | 20 | ############################################################################## | 20 | ############################################################################## |
25 | 21 | 21 | ||
26 | 22 | { | 22 | { |
28 | 23 | 'name': 'Assets Management', | 23 | 'name': 'Assets & Revenue Recognitions Management', |
29 | 24 | 'version': '1.0', | 24 | 'version': '1.0', |
30 | 25 | 'depends': ['account'], | 25 | 'depends': ['account'], |
31 | 26 | 'author': 'OpenERP S.A.', | 26 | 'author': 'OpenERP S.A.', |
32 | 27 | 'description': """ | 27 | 'description': """ |
34 | 28 | Financial and accounting asset management. | 28 | Assets management. |
35 | 29 | ========================================== | 29 | ========================================== |
36 | 30 | 30 | ||
40 | 31 | This Module manages the assets owned by a company or an individual. It will keep | 31 | It allows you to manage the assets owned by a company or a person. |
41 | 32 | track of depreciation's occurred on those assets. And it allows to create Move's | 32 | It keeps track of the depreciation occurred on those assets, and creates account moves for those depreciation lines. |
42 | 33 | of the depreciation lines. | 33 | |
43 | 34 | Revenue recognitions. | ||
44 | 35 | =========================================== | ||
45 | 36 | It allows you to manage the revenue recognition on product's sale. | ||
46 | 37 | It keeps track of the installments occurred on those revenue recognition, and creates account moves for those installment lines. | ||
47 | 34 | 38 | ||
48 | 35 | """, | 39 | """, |
49 | 36 | 'website': 'http://www.openerp.com', | 40 | 'website': 'http://www.openerp.com', |
50 | @@ -41,6 +45,8 @@ | |||
51 | 41 | 'test/account_asset_demo.yml', | 45 | 'test/account_asset_demo.yml', |
52 | 42 | 'test/account_asset.yml', | 46 | 'test/account_asset.yml', |
53 | 43 | 'test/account_asset_wizard.yml', | 47 | 'test/account_asset_wizard.yml', |
54 | 48 | 'test/account_revenue_recognition_demo.yml', | ||
55 | 49 | 'test/account_revenue_recognition.yml', | ||
56 | 44 | ], | 50 | ], |
57 | 45 | 'data': [ | 51 | 'data': [ |
58 | 46 | 'security/account_asset_security.xml', | 52 | 'security/account_asset_security.xml', |
59 | 47 | 53 | ||
60 | === modified file 'account_asset/account_asset.py' | |||
61 | --- account_asset/account_asset.py 2014-05-07 13:45:44 +0000 | |||
62 | +++ account_asset/account_asset.py 2014-05-28 05:47:51 +0000 | |||
63 | @@ -26,6 +26,7 @@ | |||
64 | 26 | from openerp.osv import fields, osv | 26 | from openerp.osv import fields, osv |
65 | 27 | import openerp.addons.decimal_precision as dp | 27 | import openerp.addons.decimal_precision as dp |
66 | 28 | from openerp.tools.translate import _ | 28 | from openerp.tools.translate import _ |
67 | 29 | import openerp | ||
68 | 29 | 30 | ||
69 | 30 | class account_asset_category(osv.osv): | 31 | class account_asset_category(osv.osv): |
70 | 31 | _name = 'account.asset.category' | 32 | _name = 'account.asset.category' |
71 | @@ -34,10 +35,11 @@ | |||
72 | 34 | _columns = { | 35 | _columns = { |
73 | 35 | 'name': fields.char('Name', size=64, required=True, select=1), | 36 | 'name': fields.char('Name', size=64, required=True, select=1), |
74 | 36 | 'note': fields.text('Note'), | 37 | 'note': fields.text('Note'), |
76 | 37 | 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic account'), | 38 | 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), |
77 | 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')]), |
78 | 40 | 'account_income_recognition_id': fields.many2one('account.account', 'Recognition Income Account', domain=[('type','=','other')]), | ||
79 | 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')]), |
81 | 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')]), |
82 | 41 | 'journal_id': fields.many2one('account.journal', 'Journal', required=True), | 43 | 'journal_id': fields.many2one('account.journal', 'Journal', required=True), |
83 | 42 | 'company_id': fields.many2one('res.company', 'Company', required=True), | 44 | 'company_id': fields.many2one('res.company', 'Company', required=True), |
84 | 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"\ |
85 | @@ -53,6 +55,7 @@ | |||
86 | 53 | 'method_end': fields.date('Ending date'), | 55 | 'method_end': fields.date('Ending date'), |
87 | 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'), |
88 | 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."), |
89 | 58 | 'type': fields.selection([('sales','Sale: Revenue Recognition'),('purchase','Purchase: Asset')], 'Type', required=True, select=True), | ||
90 | 56 | } | 59 | } |
91 | 57 | 60 | ||
92 | 58 | _defaults = { | 61 | _defaults = { |
93 | @@ -60,8 +63,9 @@ | |||
94 | 60 | 'method': 'linear', | 63 | 'method': 'linear', |
95 | 61 | 'method_number': 5, | 64 | 'method_number': 5, |
96 | 62 | 'method_time': 'number', | 65 | 'method_time': 'number', |
97 | 63 | 'method_period': 12, | ||
98 | 64 | 'method_progress_factor': 0.3, | 66 | 'method_progress_factor': 0.3, |
99 | 67 | 'type': 'sales', | ||
100 | 68 | 'method_period': 1, | ||
101 | 65 | } | 69 | } |
102 | 66 | 70 | ||
103 | 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): |
104 | @@ -69,16 +73,40 @@ | |||
105 | 69 | if account_asset_id: | 73 | if account_asset_id: |
106 | 70 | res['value'] = {'account_depreciation_id': account_asset_id} | 74 | res['value'] = {'account_depreciation_id': account_asset_id} |
107 | 71 | return res | 75 | return res |
108 | 76 | |||
109 | 77 | def onchange_journal_id(self, cr, uid, ids, journal_id, type, context=None): | ||
110 | 78 | res = {} | ||
111 | 79 | if not journal_id: | ||
112 | 80 | return {'value':{}} | ||
113 | 81 | journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context) | ||
114 | 82 | if type == 'sales': | ||
115 | 83 | res['value'] = {'account_income_recognition_id': journal.default_credit_account_id.id} | ||
116 | 84 | else: | ||
117 | 85 | res['value'] = {'account_expense_depreciation_id': journal.default_debit_account_id.id} | ||
118 | 86 | return res | ||
119 | 72 | 87 | ||
120 | 88 | def onchange_type(self, cr, uid, ids, type, context=None): | ||
121 | 89 | res = {} | ||
122 | 90 | res['value'] = {'prorata': True,'method_period': 1} if type == 'sales' else {'method_period': 12} | ||
123 | 91 | return res | ||
124 | 73 | 92 | ||
125 | 74 | class account_asset_asset(osv.osv): | 93 | class account_asset_asset(osv.osv): |
126 | 75 | _name = 'account.asset.asset' | 94 | _name = 'account.asset.asset' |
128 | 76 | _description = 'Asset' | 95 | _description = 'Asset/Recognition' |
129 | 96 | _inherit = ['mail.thread', 'ir.needaction_mixin'] | ||
130 | 97 | |||
131 | 98 | def _get_category_type(self, cr, uid, ids, context=None): | ||
132 | 99 | type = self.browse(cr, uid, ids, context=context)[0].category_id.type | ||
133 | 100 | res = {'name': 'Installment', 'type': 'Recongnition'} if type == 'sales' else {'name': 'Depreciation', 'type': 'Asset'} | ||
134 | 101 | return res | ||
135 | 77 | 102 | ||
136 | 78 | def unlink(self, cr, uid, ids, context=None): | 103 | def unlink(self, cr, uid, ids, context=None): |
140 | 79 | for asset in self.browse(cr, uid, ids, context=context): | 104 | record = self.browse(cr, uid, ids, context=context)[0] |
141 | 80 | if asset.account_move_line_ids: | 105 | res = self._get_category_type(cr, uid, ids, context=context) |
142 | 81 | raise osv.except_osv(_('Error!'), _('You cannot delete an asset that contains posted depreciation lines.')) | 106 | if record.state in ['open', 'close']: |
143 | 107 | raise osv.except_osv(_('Error!'), _('You cannot delete an %s which is in %s state.') % (res.get('type'), record.state)) | ||
144 | 108 | if record.account_move_line_ids: | ||
145 | 109 | raise osv.except_osv(_('Error!'), _('You cannot delete an %s that contains posted %s lines.') % (res.get('type'), res.get('name'))) | ||
146 | 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) |
147 | 83 | 111 | ||
148 | 84 | def _get_period(self, cr, uid, context=None): | 112 | def _get_period(self, cr, uid, context=None): |
149 | @@ -94,11 +122,11 @@ | |||
150 | 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 asset | 122 | @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 |
151 | 95 | """ | 123 | """ |
152 | 96 | cr.execute(""" | 124 | cr.execute(""" |
154 | 97 | SELECT a.id as id, COALESCE(MAX(l.date),a.purchase_date) AS date | 125 | SELECT a.id as id, COALESCE(MAX(l.date),a.date) AS date |
155 | 98 | FROM account_asset_asset a | 126 | FROM account_asset_asset a |
156 | 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) |
157 | 100 | WHERE a.id IN %s | 128 | WHERE a.id IN %s |
159 | 101 | GROUP BY a.id, a.purchase_date """, (tuple(ids),)) | 129 | GROUP BY a.id, a.date """, (tuple(ids),)) |
160 | 102 | return dict(cr.fetchall()) | 130 | return dict(cr.fetchall()) |
161 | 103 | 131 | ||
162 | 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): |
163 | @@ -109,7 +137,7 @@ | |||
164 | 109 | else: | 137 | else: |
165 | 110 | if asset.method == 'linear': | 138 | if asset.method == 'linear': |
166 | 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)) |
168 | 112 | if asset.prorata: | 140 | if asset.prorata and asset.category_id.type == 'purchase': |
169 | 113 | amount = amount_to_depr / asset.method_number | 141 | amount = amount_to_depr / asset.method_number |
170 | 114 | days = total_days - float(depreciation_date.strftime('%j')) | 142 | days = total_days - float(depreciation_date.strftime('%j')) |
171 | 115 | if i == 1: | 143 | if i == 1: |
172 | @@ -134,13 +162,14 @@ | |||
173 | 134 | while depreciation_date <= end_date: | 162 | while depreciation_date <= end_date: |
174 | 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)) |
175 | 136 | undone_dotation_number += 1 | 164 | undone_dotation_number += 1 |
177 | 137 | if asset.prorata: | 165 | if asset.prorata and asset.category_id.type == 'purchase': |
178 | 138 | undone_dotation_number += 1 | 166 | undone_dotation_number += 1 |
179 | 139 | return undone_dotation_number | 167 | return undone_dotation_number |
180 | 140 | 168 | ||
181 | 141 | def compute_depreciation_board(self, cr, uid, ids, context=None): | 169 | def compute_depreciation_board(self, cr, uid, ids, context=None): |
182 | 142 | depreciation_lin_obj = self.pool.get('account.asset.depreciation.line') | 170 | depreciation_lin_obj = self.pool.get('account.asset.depreciation.line') |
183 | 143 | currency_obj = self.pool.get('res.currency') | 171 | currency_obj = self.pool.get('res.currency') |
184 | 172 | fiscal_year_obj = self.pool.get('account.fiscalyear') | ||
185 | 144 | for asset in self.browse(cr, uid, ids, context=context): | 173 | for asset in self.browse(cr, uid, ids, context=context): |
186 | 145 | if asset.value_residual == 0.0: | 174 | if asset.value_residual == 0.0: |
187 | 146 | continue | 175 | continue |
188 | @@ -153,35 +182,51 @@ | |||
189 | 153 | if asset.prorata: | 182 | if asset.prorata: |
190 | 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') |
191 | 155 | else: | 184 | else: |
194 | 156 | # depreciation_date = 1st January of purchase year | 185 | # Asset Purchase date & year |
195 | 157 | purchase_date = datetime.strptime(asset.purchase_date, '%Y-%m-%d') | 186 | date = datetime.strptime(asset.date, '%Y-%m-%d') |
196 | 158 | #if we already have some previous validated entries, starting date isn't 1st January but last entry + method period | 187 | #if we already have some previous validated entries, starting date isn't 1st January but last entry + method period |
197 | 159 | if (len(posted_depreciation_line_ids)>0): | 188 | if (len(posted_depreciation_line_ids)>0): |
198 | 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') |
199 | 161 | depreciation_date = (last_depreciation_date+relativedelta(months=+asset.method_period)) | 190 | depreciation_date = (last_depreciation_date+relativedelta(months=+asset.method_period)) |
200 | 162 | else: | 191 | else: |
202 | 163 | depreciation_date = datetime(purchase_date.year, 1, 1) | 192 | # Fiscal year based on depreciation date of Asset |
203 | 193 | fiscal_year = fiscal_year_obj.search_read(cr, uid, | ||
204 | 194 | [('date_start', '<=', time.strftime('%Y-%m-%d')), | ||
205 | 195 | ('date_stop', '>=', time.strftime('%Y-%m-%d'))], | ||
206 | 196 | ['date_start'], context=context) | ||
207 | 197 | # Fiscal year should be there related to purchase date otherwise the journal items have wrong periods and date | ||
208 | 198 | if not fiscal_year: | ||
209 | 199 | model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_fiscalyear') | ||
210 | 200 | msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods and configure a fiscal year.') % asset.date | ||
211 | 201 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
212 | 202 | fis_date = datetime.strptime(fiscal_year[0]['date_start'], '%Y-%m-%d') | ||
213 | 203 | depreciation_date = datetime(date.year, fis_date.month, fis_date.day) | ||
214 | 164 | day = depreciation_date.day | 204 | day = depreciation_date.day |
215 | 165 | month = depreciation_date.month | 205 | month = depreciation_date.month |
216 | 166 | year = depreciation_date.year | 206 | year = depreciation_date.year |
217 | 167 | total_days = (year % 4) and 365 or 366 | 207 | total_days = (year % 4) and 365 or 366 |
218 | 168 | 208 | ||
219 | 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) |
220 | 210 | dep_sequence = 0 | ||
221 | 211 | for dep_lines in depreciation_lin_obj.browse(cr, uid, sorted(posted_depreciation_line_ids, key=int), context=context): | ||
222 | 212 | dep_sequence += 1 | ||
223 | 213 | depreciation_lin_obj.write(cr, uid, dep_lines.id, {'sequence': dep_sequence}, context=context) | ||
224 | 214 | i = 1 | ||
225 | 215 | if posted_depreciation_line_ids: | ||
226 | 216 | i+= len(posted_depreciation_line_ids) | ||
227 | 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): |
228 | 171 | i = x + 1 | ||
229 | 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) |
230 | 173 | company_currency = asset.company_id.currency_id.id | 219 | company_currency = asset.company_id.currency_id.id |
231 | 174 | current_currency = asset.currency_id.id | 220 | current_currency = asset.currency_id.id |
234 | 175 | # compute amount into company currency | 221 | amount = currency_obj.round(cr, uid, asset.currency_id, amount) |
233 | 176 | amount = currency_obj.compute(cr, uid, current_currency, company_currency, amount, context=context) | ||
235 | 177 | residual_amount -= amount | 222 | residual_amount -= amount |
236 | 178 | vals = { | 223 | vals = { |
237 | 179 | 'amount': amount, | 224 | 'amount': amount, |
238 | 180 | 'asset_id': asset.id, | 225 | 'asset_id': asset.id, |
239 | 181 | 'sequence': i, | 226 | 'sequence': i, |
241 | 182 | 'name': str(asset.id) +'/' + str(i), | 227 | 'name': (asset.code or str(asset.id)) +'/' + str(i), |
242 | 183 | 'remaining_value': residual_amount, | 228 | 'remaining_value': residual_amount, |
244 | 184 | 'depreciated_value': (asset.purchase_value - asset.salvage_value) - (residual_amount + amount), | 229 | 'depreciated_value': (asset.value - asset.salvage_value) - (residual_amount + amount), |
245 | 185 | 'depreciation_date': depreciation_date.strftime('%Y-%m-%d'), | 230 | 'depreciation_date': depreciation_date.strftime('%Y-%m-%d'), |
246 | 186 | } | 231 | } |
247 | 187 | depreciation_lin_obj.create(cr, uid, vals, context=context) | 232 | depreciation_lin_obj.create(cr, uid, vals, context=context) |
248 | @@ -190,31 +235,44 @@ | |||
249 | 190 | day = depreciation_date.day | 235 | day = depreciation_date.day |
250 | 191 | month = depreciation_date.month | 236 | month = depreciation_date.month |
251 | 192 | year = depreciation_date.year | 237 | year = depreciation_date.year |
252 | 238 | i += 1 | ||
253 | 193 | return True | 239 | return True |
254 | 194 | 240 | ||
255 | 195 | def validate(self, cr, uid, ids, context=None): | 241 | def validate(self, cr, uid, ids, context=None): |
256 | 196 | if context is None: | 242 | if context is None: |
261 | 197 | context = {} | 243 | context = {} |
262 | 198 | return self.write(cr, uid, ids, { | 244 | type = self._get_category_type(cr, uid, ids, context=context).get('type') |
263 | 199 | 'state':'open' | 245 | self.message_post(cr, uid, ids, body=_("%s confirmed.") % type, context=context) |
264 | 200 | }, context) | 246 | return self.write(cr, uid, ids, {'state':'open'}, context=context) |
265 | 201 | 247 | ||
266 | 202 | def set_to_close(self, cr, uid, ids, context=None): | 248 | def set_to_close(self, cr, uid, ids, context=None): |
267 | 249 | if context is None: | ||
268 | 250 | context = {} | ||
269 | 251 | dep_line_obj = self.pool.get('account.asset.depreciation.line') | ||
270 | 252 | res = self._get_category_type(cr, uid, ids, context=context) | ||
271 | 253 | unposted_dep_line_ids = dep_line_obj.search(cr, uid, | ||
272 | 254 | [('asset_id', 'in', ids), | ||
273 | 255 | ('move_check', '=', False)], | ||
274 | 256 | order='depreciation_date desc', | ||
275 | 257 | context=context) | ||
276 | 258 | if len(unposted_dep_line_ids) > 0: | ||
277 | 259 | raise osv.except_osv(_('Error !'), | ||
278 | 260 | _('You cannot close an %s which has unposted %s lines.') | ||
279 | 261 | % (res.get('type'), res.get('name'))) | ||
280 | 262 | self.message_post(cr, uid, ids, body=_("%s closed.") % res.get('type'), context=context) | ||
281 | 203 | return self.write(cr, uid, ids, {'state': 'close'}, context=context) | 263 | return self.write(cr, uid, ids, {'state': 'close'}, context=context) |
282 | 204 | 264 | ||
283 | 205 | def set_to_draft(self, cr, uid, ids, context=None): | 265 | def set_to_draft(self, cr, uid, ids, context=None): |
284 | 206 | return self.write(cr, uid, ids, {'state': 'draft'}, context=context) | 266 | return self.write(cr, uid, ids, {'state': 'draft'}, context=context) |
285 | 207 | 267 | ||
286 | 208 | def _amount_residual(self, cr, uid, ids, name, args, context=None): | 268 | def _amount_residual(self, cr, uid, ids, name, args, context=None): |
294 | 209 | cr.execute("""SELECT | 269 | res = {} |
295 | 210 | l.asset_id as id, SUM(abs(l.debit-l.credit)) AS amount | 270 | total_amount = 0.0 |
289 | 211 | FROM | ||
290 | 212 | account_move_line l | ||
291 | 213 | WHERE | ||
292 | 214 | l.asset_id IN %s GROUP BY l.asset_id """, (tuple(ids),)) | ||
293 | 215 | res=dict(cr.fetchall()) | ||
296 | 216 | for asset in self.browse(cr, uid, ids, context): | 271 | for asset in self.browse(cr, uid, ids, context): |
298 | 217 | res[asset.id] = asset.purchase_value - res.get(asset.id, 0.0) - asset.salvage_value | 272 | for line in asset.depreciation_line_ids: |
299 | 273 | if line.move_check: | ||
300 | 274 | total_amount += line.amount | ||
301 | 275 | res[asset.id] = asset.value - total_amount - asset.salvage_value | ||
302 | 218 | for id in ids: | 276 | for id in ids: |
303 | 219 | res.setdefault(id, 0.0) | 277 | res.setdefault(id, 0.0) |
304 | 220 | return res | 278 | return res |
305 | @@ -229,13 +287,13 @@ | |||
306 | 229 | val['currency_id'] = company.currency_id.id | 287 | val['currency_id'] = company.currency_id.id |
307 | 230 | return {'value': val} | 288 | return {'value': val} |
308 | 231 | 289 | ||
310 | 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): |
311 | 233 | val = {} | 291 | val = {} |
312 | 234 | for asset in self.browse(cr, uid, ids, context=context): | 292 | for asset in self.browse(cr, uid, ids, context=context): |
315 | 235 | if purchase_value: | 293 | if value: |
316 | 236 | val['value_residual'] = purchase_value - salvage_value | 294 | val['value_residual'] = value - salvage_value |
317 | 237 | if salvage_value: | 295 | if salvage_value: |
319 | 238 | val['value_residual'] = purchase_value - salvage_value | 296 | val['value_residual'] = value - salvage_value |
320 | 239 | return {'value': val} | 297 | return {'value': val} |
321 | 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): |
322 | 241 | MoveLine = self.pool('account.move.line') | 299 | MoveLine = self.pool('account.move.line') |
323 | @@ -248,14 +306,14 @@ | |||
324 | 248 | 'entry_count': fields.function(_entry_count, string='# Asset Entries', type='integer'), | 306 | 'entry_count': fields.function(_entry_count, string='# Asset Entries', type='integer'), |
325 | 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)]}), |
326 | 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)]}), |
328 | 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)]}), |
329 | 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)]}), |
330 | 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)]}), |
331 | 254 | 'note': fields.text('Note'), | 312 | 'note': fields.text('Note'), |
333 | 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)]}), |
334 | 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)]}), |
335 | 257 | 'child_ids': fields.one2many('account.asset.asset', 'parent_id', 'Children Assets'), | 315 | 'child_ids': fields.one2many('account.asset.asset', 'parent_id', 'Children Assets'), |
337 | 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)]}), |
338 | 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, |
339 | 260 | help="When an asset is created, the status is 'Draft'.\n" \ | 318 | help="When an asset is created, the status is 'Draft'.\n" \ |
340 | 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" \ |
341 | @@ -274,14 +332,15 @@ | |||
342 | 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"\ |
343 | 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" \ |
344 | 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."), |
346 | 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'), |
347 | 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), |
348 | 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)]}), |
349 | 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)]}), |
350 | 339 | 'invoice_id': fields.many2one('account.invoice','Invoice', states={'draft':[('readonly',False)]}), | ||
351 | 281 | } | 340 | } |
352 | 282 | _defaults = { | 341 | _defaults = { |
353 | 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'), |
355 | 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'), |
356 | 285 | 'active': True, | 344 | 'active': True, |
357 | 286 | 'state': 'draft', | 345 | 'state': 'draft', |
358 | 287 | 'method': 'linear', | 346 | 'method': 'linear', |
359 | @@ -295,6 +354,10 @@ | |||
360 | 295 | 354 | ||
361 | 296 | def _check_recursion(self, cr, uid, ids, context=None, parent=None): | 355 | def _check_recursion(self, cr, uid, ids, context=None, parent=None): |
362 | 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) |
363 | 357 | |||
364 | 358 | def _check_recursion_msg(self, cr, uid, ids, context=None, parent=None): | ||
365 | 359 | type = self._get_category_type(cr, uid, ids, context=context).get('type') | ||
366 | 360 | return ' \n\n Error ! \n You cannot create recursive %s.' % type | ||
367 | 298 | 361 | ||
368 | 299 | def _check_prorata(self, cr, uid, ids, context=None): | 362 | def _check_prorata(self, cr, uid, ids, context=None): |
369 | 300 | for asset in self.browse(cr, uid, ids, context=context): | 363 | for asset in self.browse(cr, uid, ids, context=context): |
370 | @@ -303,7 +366,7 @@ | |||
371 | 303 | return True | 366 | return True |
372 | 304 | 367 | ||
373 | 305 | _constraints = [ | 368 | _constraints = [ |
375 | 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']), |
376 | 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']), |
377 | 308 | ] | 371 | ] |
378 | 309 | 372 | ||
379 | @@ -334,7 +397,15 @@ | |||
380 | 334 | default = {} | 397 | default = {} |
381 | 335 | if context is None: | 398 | if context is None: |
382 | 336 | context = {} | 399 | context = {} |
384 | 337 | default.update({'depreciation_line_ids': [], 'account_move_line_ids': [], 'history_ids': [], 'state': 'draft'}) | 400 | asset = self.browse(cr, uid, id, context=context) |
385 | 401 | default.update({ | ||
386 | 402 | 'depreciation_line_ids': [], | ||
387 | 403 | 'account_move_line_ids': [], | ||
388 | 404 | 'history_ids': [], | ||
389 | 405 | 'state': 'draft', | ||
390 | 406 | 'name': asset.name+ _(' (copy)'), | ||
391 | 407 | 'invoice_id': False | ||
392 | 408 | }) | ||
393 | 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) |
394 | 339 | 410 | ||
395 | 340 | def _compute_entries(self, cr, uid, ids, period_id, context=None): | 411 | def _compute_entries(self, cr, uid, ids, period_id, context=None): |
396 | @@ -342,17 +413,30 @@ | |||
397 | 342 | period_obj = self.pool.get('account.period') | 413 | period_obj = self.pool.get('account.period') |
398 | 343 | depreciation_obj = self.pool.get('account.asset.depreciation.line') | 414 | depreciation_obj = self.pool.get('account.asset.depreciation.line') |
399 | 344 | period = period_obj.browse(cr, uid, period_id, context=context) | 415 | period = period_obj.browse(cr, uid, period_id, context=context) |
401 | 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), |
402 | 417 | ('depreciation_date', '<=', period.date_stop), | ||
403 | 418 | ('depreciation_date', '>=', period.date_start), | ||
404 | 419 | ('move_check', '=', False)], | ||
405 | 420 | context=context) | ||
406 | 346 | if context is None: | 421 | if context is None: |
407 | 347 | context = {} | 422 | context = {} |
409 | 348 | context.update({'depreciation_date':period.date_stop}) | 423 | context.update({'depreciation_date': period.date_stop}) |
410 | 349 | return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context) | 424 | return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context) |
411 | 350 | 425 | ||
412 | 351 | def create(self, cr, uid, vals, context=None): | 426 | def create(self, cr, uid, vals, context=None): |
413 | 427 | context.update({'mail_create_nolog': True}) | ||
414 | 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) |
415 | 353 | self.compute_depreciation_board(cr, uid, [asset_id], context=context) | 429 | self.compute_depreciation_board(cr, uid, [asset_id], context=context) |
416 | 430 | type = self._get_category_type(cr, uid, [asset_id], context=context).get('type') | ||
417 | 431 | self.message_post(cr, uid, [asset_id], body=_("%s created.") % type, context=context) | ||
418 | 354 | return asset_id | 432 | return asset_id |
419 | 355 | 433 | ||
420 | 434 | def write(self, cr, uid, ids, vals, context=None): | ||
421 | 435 | res = super(account_asset_asset, self).write(cr, uid, ids, vals, context=context) | ||
422 | 436 | # We need to compute the depreciation line if any changes is there in asset | ||
423 | 437 | self.compute_depreciation_board(cr, uid, ids, context=context) | ||
424 | 438 | return res | ||
425 | 439 | |||
426 | 356 | def open_entries(self, cr, uid, ids, context=None): | 440 | def open_entries(self, cr, uid, ids, context=None): |
427 | 357 | if context is None: | 441 | if context is None: |
428 | 358 | context = {} | 442 | context = {} |
429 | @@ -388,7 +472,7 @@ | |||
430 | 388 | 'depreciated_value': fields.float('Amount Already Depreciated', required=True), | 472 | 'depreciated_value': fields.float('Amount Already Depreciated', required=True), |
431 | 389 | 'depreciation_date': fields.date('Depreciation Date', select=1), | 473 | 'depreciation_date': fields.date('Depreciation Date', select=1), |
432 | 390 | 'move_id': fields.many2one('account.move', 'Depreciation Entry'), | 474 | 'move_id': fields.many2one('account.move', 'Depreciation Entry'), |
434 | 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') |
435 | 392 | } | 476 | } |
436 | 393 | 477 | ||
437 | 394 | def create_move(self, cr, uid, ids, context=None): | 478 | def create_move(self, cr, uid, ids, context=None): |
438 | @@ -400,33 +484,42 @@ | |||
439 | 400 | move_obj = self.pool.get('account.move') | 484 | move_obj = self.pool.get('account.move') |
440 | 401 | move_line_obj = self.pool.get('account.move.line') | 485 | move_line_obj = self.pool.get('account.move.line') |
441 | 402 | currency_obj = self.pool.get('res.currency') | 486 | currency_obj = self.pool.get('res.currency') |
442 | 487 | obj_sequence = self.pool.get('ir.sequence') | ||
443 | 403 | created_move_ids = [] | 488 | created_move_ids = [] |
444 | 404 | asset_ids = [] | 489 | asset_ids = [] |
445 | 405 | for line in self.browse(cr, uid, ids, context=context): | 490 | for line in self.browse(cr, uid, ids, context=context): |
447 | 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') |
448 | 407 | period_ids = period_obj.find(cr, uid, depreciation_date, context=context) | 492 | period_ids = period_obj.find(cr, uid, depreciation_date, context=context) |
449 | 493 | context.update({'date': depreciation_date}) | ||
450 | 408 | company_currency = line.asset_id.company_id.currency_id.id | 494 | company_currency = line.asset_id.company_id.currency_id.id |
451 | 409 | current_currency = line.asset_id.currency_id.id | 495 | current_currency = line.asset_id.currency_id.id |
452 | 410 | context.update({'date': depreciation_date}) | ||
453 | 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) |
455 | 412 | sign = (line.asset_id.category_id.journal_id.type == 'purchase' and 1) or -1 | 497 | sign = (line.asset_id.category_id.journal_id.type == 'purchase' or line.asset_id.category_id.journal_id.type == 'sale' and 1) or -1 |
456 | 413 | asset_name = line.asset_id.name | 498 | asset_name = line.asset_id.name |
457 | 414 | reference = line.name | 499 | reference = line.name |
458 | 500 | seq_num = obj_sequence.next_by_id(cr, uid, line.asset_id.category_id.journal_id.sequence_id.id, context) | ||
459 | 415 | move_vals = { | 501 | move_vals = { |
461 | 416 | 'name': asset_name, | 502 | 'name': seq_num, |
462 | 417 | 'date': depreciation_date, | 503 | 'date': depreciation_date, |
464 | 418 | 'ref': reference, | 504 | 'ref': seq_num, |
465 | 419 | 'period_id': period_ids and period_ids[0] or False, | 505 | 'period_id': period_ids and period_ids[0] or False, |
466 | 420 | 'journal_id': line.asset_id.category_id.journal_id.id, | 506 | 'journal_id': line.asset_id.category_id.journal_id.id, |
467 | 421 | } | 507 | } |
468 | 422 | move_id = move_obj.create(cr, uid, move_vals, context=context) | 508 | move_id = move_obj.create(cr, uid, move_vals, context=context) |
469 | 423 | journal_id = line.asset_id.category_id.journal_id.id | 509 | journal_id = line.asset_id.category_id.journal_id.id |
470 | 424 | partner_id = line.asset_id.partner_id.id | 510 | partner_id = line.asset_id.partner_id.id |
471 | 511 | categ_type = line.asset_id.category_id.type | ||
472 | 512 | if categ_type == 'purchase': | ||
473 | 513 | debit_account = line.asset_id.category_id.account_expense_depreciation_id.id | ||
474 | 514 | credit_acount = line.asset_id.category_id.account_depreciation_id.id | ||
475 | 515 | else: | ||
476 | 516 | debit_account = line.asset_id.category_id.account_asset_id.id | ||
477 | 517 | credit_acount = line.asset_id.category_id.account_income_recognition_id.id | ||
478 | 425 | move_line_obj.create(cr, uid, { | 518 | move_line_obj.create(cr, uid, { |
481 | 426 | 'name': asset_name, | 519 | 'name': asset_name or reference, |
482 | 427 | 'ref': reference, | 520 | 'ref': seq_num, |
483 | 428 | 'move_id': move_id, | 521 | 'move_id': move_id, |
485 | 429 | 'account_id': line.asset_id.category_id.account_depreciation_id.id, | 522 | 'account_id': credit_acount, |
486 | 430 | 'debit': 0.0, | 523 | 'debit': 0.0, |
487 | 431 | 'credit': amount, | 524 | 'credit': amount, |
488 | 432 | 'period_id': period_ids and period_ids[0] or False, | 525 | 'period_id': period_ids and period_ids[0] or False, |
489 | @@ -434,13 +527,14 @@ | |||
490 | 434 | 'partner_id': partner_id, | 527 | 'partner_id': partner_id, |
491 | 435 | 'currency_id': company_currency != current_currency and current_currency or False, | 528 | 'currency_id': company_currency != current_currency and current_currency or False, |
492 | 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, |
494 | 437 | 'date': depreciation_date, | 530 | 'analytic_account_id': line.asset_id.category_id.account_analytic_id.id if categ_type == 'sales' else False, |
495 | 531 | 'asset_id': line.asset_id.id if categ_type == 'sales' else False | ||
496 | 438 | }) | 532 | }) |
497 | 439 | move_line_obj.create(cr, uid, { | 533 | move_line_obj.create(cr, uid, { |
500 | 440 | 'name': asset_name, | 534 | 'name': asset_name or reference, |
501 | 441 | 'ref': reference, | 535 | 'ref': seq_num, |
502 | 442 | 'move_id': move_id, | 536 | 'move_id': move_id, |
504 | 443 | 'account_id': line.asset_id.category_id.account_expense_depreciation_id.id, | 537 | 'account_id': debit_account, |
505 | 444 | 'credit': 0.0, | 538 | 'credit': 0.0, |
506 | 445 | 'debit': amount, | 539 | 'debit': amount, |
507 | 446 | 'period_id': period_ids and period_ids[0] or False, | 540 | 'period_id': period_ids and period_ids[0] or False, |
508 | @@ -448,19 +542,40 @@ | |||
509 | 448 | 'partner_id': partner_id, | 542 | 'partner_id': partner_id, |
510 | 449 | 'currency_id': company_currency != current_currency and current_currency or False, | 543 | 'currency_id': company_currency != current_currency and current_currency or False, |
511 | 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, |
515 | 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, |
516 | 452 | 'date': depreciation_date, | 546 | 'asset_id': line.asset_id.id if categ_type == 'purchase' else False |
514 | 453 | 'asset_id': line.asset_id.id | ||
517 | 454 | }) | 547 | }) |
518 | 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) |
519 | 456 | created_move_ids.append(move_id) | 549 | created_move_ids.append(move_id) |
520 | 457 | asset_ids.append(line.asset_id.id) | 550 | asset_ids.append(line.asset_id.id) |
522 | 458 | # we re-evaluate the assets to determine whether we can close them | 551 | partner_name = line.asset_id.partner_id.name |
523 | 552 | currency_name = line.asset_id.company_id.currency_id.name | ||
524 | 553 | msg_data = ['Depreciation','Supplier'] if categ_type == 'purchase' else ['Installment','Customer'] | ||
525 | 554 | msg=_("%s line posted. <br/> <b> " | ||
526 | 555 | "• Currency:</b> %s <br/> <b> " | ||
527 | 556 | "• Posted Amount:</b> %s <br/> <b> " | ||
528 | 557 | "• %s:</b> %s") % (msg_data[0], | ||
529 | 558 | currency_name, | ||
530 | 559 | line.amount, | ||
531 | 560 | msg_data[1], | ||
532 | 561 | partner_name) | ||
533 | 562 | asset_obj.message_post(cr, uid, line.asset_id.id, body=msg, context=context) | ||
534 | 563 | # we re-evaluate the assets to determine whether we can close them | ||
535 | 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): |
536 | 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): |
537 | 566 | name = 'Asset' if categ_type == 'purchase' else 'Recognition' | ||
538 | 567 | asset_obj.message_post(cr, uid, asset.id, body=_("%s closed.") % name, context=context) | ||
539 | 461 | asset.write({'state': 'close'}) | 568 | asset.write({'state': 'close'}) |
540 | 569 | asset_obj.compute_depreciation_board(cr, uid, [], context=context) | ||
541 | 462 | return created_move_ids | 570 | return created_move_ids |
542 | 463 | 571 | ||
543 | 572 | def unlink(self, cr, uid, ids, context=None): | ||
544 | 573 | for record in self.browse(cr, uid, ids, context=context): | ||
545 | 574 | name = 'depreciation' if record.asset_id.category_id.type == 'purchase' else 'installment' | ||
546 | 575 | if record.move_check: | ||
547 | 576 | raise osv.except_osv(_('Error!'), _("You cannot delete posted %s lines.") % name) | ||
548 | 577 | return super(account_asset_depreciation_line, self).unlink(cr, uid, ids, context=context) | ||
549 | 578 | |||
550 | 464 | 579 | ||
551 | 465 | class account_move_line(osv.osv): | 580 | class account_move_line(osv.osv): |
552 | 466 | _inherit = 'account.move.line' | 581 | _inherit = 'account.move.line' |
553 | @@ -493,5 +608,4 @@ | |||
554 | 493 | 'user_id': lambda self, cr, uid, ctx: uid | 608 | 'user_id': lambda self, cr, uid, ctx: uid |
555 | 494 | } | 609 | } |
556 | 495 | 610 | ||
557 | 496 | |||
558 | 497 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 611 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
559 | 498 | 612 | ||
560 | === modified file 'account_asset/account_asset_demo.xml' | |||
561 | --- account_asset/account_asset_demo.xml 2013-01-02 11:46:19 +0000 | |||
562 | +++ account_asset/account_asset_demo.xml 2014-05-28 05:47:51 +0000 | |||
563 | @@ -12,6 +12,8 @@ | |||
564 | 12 | <field name="journal_id" ref="account.expenses_journal"/> | 12 | <field name="journal_id" ref="account.expenses_journal"/> |
565 | 13 | <field name="name">Hardware - 3 Years</field> | 13 | <field name="name">Hardware - 3 Years</field> |
566 | 14 | <field name="method_number">3</field> | 14 | <field name="method_number">3</field> |
567 | 15 | <field name="method_period">12</field> | ||
568 | 16 | <field name="type">purchase</field> | ||
569 | 15 | </record> | 17 | </record> |
570 | 16 | 18 | ||
571 | 17 | <record id="account_asset_category_sale" model="account.asset.category"> | 19 | <record id="account_asset_category_sale" model="account.asset.category"> |
572 | @@ -21,16 +23,33 @@ | |||
573 | 21 | <field name="journal_id" ref="account.expenses_journal"/> | 23 | <field name="journal_id" ref="account.expenses_journal"/> |
574 | 22 | <field name="name">Cars - 5 Years</field> | 24 | <field name="name">Cars - 5 Years</field> |
575 | 23 | <field name="method_number">5</field> | 25 | <field name="method_number">5</field> |
586 | 24 | </record> | 26 | <field name="method_period">12</field> |
587 | 25 | 27 | <field name="type">purchase</field> | |
588 | 26 | 28 | </record> | |
589 | 27 | <record id="account_asset_category_sale" model="account.asset.category"> | 29 | |
590 | 28 | <field name="account_expense_depreciation_id" ref="account.a_sale"/> | 30 | |
591 | 29 | <field name="account_asset_id" ref="account.xfa"/> | 31 | <record id="account_asset_category_sale0" model="account.asset.category"> |
592 | 30 | <field name="account_depreciation_id" ref="account.xfa"/> | 32 | <field name="account_expense_depreciation_id" ref="account.a_sale"/> |
593 | 31 | <field name="journal_id" ref="account.expenses_journal"/> | 33 | <field name="account_asset_id" ref="account.xfa"/> |
594 | 32 | <field name="name">Revenue Recognition Maintenance Contract - 3 Years</field> | 34 | <field name="account_depreciation_id" ref="account.xfa"/> |
595 | 33 | <field name="method_number">3</field> | 35 | <field name="account_income_recognition_id" ref="account.a_sale"/> |
596 | 36 | <field name="journal_id" ref="account.sales_journal"/> | ||
597 | 37 | <field name="name">Maintenance Contract - 6 month</field> | ||
598 | 38 | <field name="method_number">6</field> | ||
599 | 39 | <field name="method_period">1</field> | ||
600 | 40 | <field name="prorata" eval="True"/> | ||
601 | 41 | </record> | ||
602 | 42 | |||
603 | 43 | <record id="account_asset_category_sale1" model="account.asset.category"> | ||
604 | 44 | <field name="account_expense_depreciation_id" ref="account.a_sale"/> | ||
605 | 45 | <field name="account_asset_id" ref="account.xfa"/> | ||
606 | 46 | <field name="account_depreciation_id" ref="account.xfa"/> | ||
607 | 47 | <field name="account_income_recognition_id" ref="account.a_sale"/> | ||
608 | 48 | <field name="journal_id" ref="account.sales_journal"/> | ||
609 | 49 | <field name="name">Contract - 12 month</field> | ||
610 | 50 | <field name="method_number">12</field> | ||
611 | 51 | <field name="method_period">1</field> | ||
612 | 52 | <field name="prorata" eval="True"/> | ||
613 | 34 | </record> | 53 | </record> |
614 | 35 | 54 | ||
615 | 36 | <!-- | 55 | <!-- |
616 | @@ -41,10 +60,10 @@ | |||
617 | 41 | <field eval="2000.0" name="salvage_value"/> | 60 | <field eval="2000.0" name="salvage_value"/> |
618 | 42 | <field name="state">open</field> | 61 | <field name="state">open</field> |
619 | 43 | <field eval="12" name="method_period"/> | 62 | <field eval="12" name="method_period"/> |
621 | 44 | <field eval="10" name="method_number"/> | 63 | <field eval="5" name="method_number"/> |
622 | 45 | <field name="name">CEO's Car</field> | 64 | <field name="name">CEO's Car</field> |
625 | 46 | <field eval="12000.0" name="purchase_value"/> | 65 | <field eval="12000.0" name="value"/> |
626 | 47 | <field name="category_id" ref="account_asset_category_fixedassets0"/> | 66 | <field name="category_id" ref="account_asset_category_sale"/> |
627 | 48 | </record> | 67 | </record> |
628 | 49 | 68 | ||
629 | 50 | <record id="account_asset_asset_cab0" model="account.asset.asset"> | 69 | <record id="account_asset_asset_cab0" model="account.asset.asset"> |
630 | @@ -52,7 +71,7 @@ | |||
631 | 52 | <field eval="0.0" name="salvage_value"/> | 71 | <field eval="0.0" name="salvage_value"/> |
632 | 53 | <field name="method_time">end</field> | 72 | <field name="method_time">end</field> |
633 | 54 | <field name="name">V6 Engine and 10 inches tires</field> | 73 | <field name="name">V6 Engine and 10 inches tires</field> |
635 | 55 | <field eval="2800.0" name="purchase_value"/> | 74 | <field eval="2800.0" name="value"/> |
636 | 56 | <field name="category_id" ref="account_asset_category_fixedassets0"/> | 75 | <field name="category_id" ref="account_asset_category_fixedassets0"/> |
637 | 57 | <field name="parent_id" ref="account_asset_asset_vehicles0"/> | 76 | <field name="parent_id" ref="account_asset_asset_vehicles0"/> |
638 | 58 | </record> | 77 | </record> |
639 | @@ -62,12 +81,34 @@ | |||
640 | 62 | <field eval="100000.0" name="salvage_value"/> | 81 | <field eval="100000.0" name="salvage_value"/> |
641 | 63 | <field name="state">open</field> | 82 | <field name="state">open</field> |
642 | 64 | <field eval="12" name="method_period"/> | 83 | <field eval="12" name="method_period"/> |
645 | 65 | <field eval="20" name="method_number"/> | 84 | <field eval="3" name="method_number"/> |
646 | 66 | <field name="purchase_date" eval="time.strftime('%Y-01-01')"/> | 85 | <field name="date" eval="time.strftime('%Y-01-01')"/> |
647 | 67 | <field name="name">Office</field> | 86 | <field name="name">Office</field> |
649 | 68 | <field eval="500000.0" name="purchase_value"/> | 87 | <field eval="500000.0" name="value"/> |
650 | 69 | <field name="category_id" ref="account_asset_category_fixedassets0"/> | 88 | <field name="category_id" ref="account_asset_category_fixedassets0"/> |
651 | 70 | </record> | 89 | </record> |
652 | 90 | |||
653 | 91 | <record id="account_asset_asset_pc" model="account.asset.asset"> | ||
654 | 92 | <field eval="1" name="prorata"/> | ||
655 | 93 | <field name="state">open</field> | ||
656 | 94 | <field eval="1" name="method_period"/> | ||
657 | 95 | <field eval="12" name="method_number"/> | ||
658 | 96 | <field name="date" eval="time.strftime('%Y-01-01')"/> | ||
659 | 97 | <field name="name">Personal Computer</field> | ||
660 | 98 | <field eval="25000.0" name="value"/> | ||
661 | 99 | <field name="category_id" ref="account_asset_category_sale1"/> | ||
662 | 100 | </record> | ||
663 | 101 | |||
664 | 102 | <record id="account_asset_asset_a/c" model="account.asset.asset"> | ||
665 | 103 | <field eval="1" name="prorata"/> | ||
666 | 104 | <field name="state">open</field> | ||
667 | 105 | <field eval="1" name="method_period"/> | ||
668 | 106 | <field eval="12" name="method_number"/> | ||
669 | 107 | <field name="date" eval="time.strftime('%Y-01-01')"/> | ||
670 | 108 | <field name="name">Air Conditioner</field> | ||
671 | 109 | <field eval="40000.0" name="value"/> | ||
672 | 110 | <field name="category_id" ref="account_asset_category_sale1"/> | ||
673 | 111 | </record> | ||
674 | 71 | 112 | ||
675 | 72 | </data> | 113 | </data> |
676 | 73 | </openerp> | 114 | </openerp> |
677 | 74 | 115 | ||
678 | === modified file 'account_asset/account_asset_invoice.py' | |||
679 | --- account_asset/account_asset_invoice.py 2013-10-27 12:31:04 +0000 | |||
680 | +++ account_asset/account_asset_invoice.py 2014-05-28 05:47:51 +0000 | |||
681 | @@ -41,6 +41,7 @@ | |||
682 | 41 | _inherit = 'account.invoice.line' | 41 | _inherit = 'account.invoice.line' |
683 | 42 | _columns = { | 42 | _columns = { |
684 | 43 | 'asset_category_id': fields.many2one('account.asset.category', 'Asset Category'), | 43 | 'asset_category_id': fields.many2one('account.asset.category', 'Asset Category'), |
685 | 44 | 'recongnition_date': fields.date('Rev. Rec. Start Date'), | ||
686 | 44 | } | 45 | } |
687 | 45 | def asset_create(self, cr, uid, lines, context=None): | 46 | def asset_create(self, cr, uid, lines, context=None): |
688 | 46 | context = context or {} | 47 | context = context or {} |
689 | @@ -51,12 +52,12 @@ | |||
690 | 51 | 'name': line.name, | 52 | 'name': line.name, |
691 | 52 | 'code': line.invoice_id.number or False, | 53 | 'code': line.invoice_id.number or False, |
692 | 53 | 'category_id': line.asset_category_id.id, | 54 | 'category_id': line.asset_category_id.id, |
695 | 54 | 'purchase_value': line.price_subtotal, | 55 | 'value': line.price_subtotal, |
694 | 55 | 'period_id': line.invoice_id.period_id.id, | ||
696 | 56 | 'partner_id': line.invoice_id.partner_id.id, | 56 | 'partner_id': line.invoice_id.partner_id.id, |
697 | 57 | 'company_id': line.invoice_id.company_id.id, | 57 | 'company_id': line.invoice_id.company_id.id, |
698 | 58 | 'currency_id': line.invoice_id.currency_id.id, | 58 | 'currency_id': line.invoice_id.currency_id.id, |
700 | 59 | 'purchase_date' : line.invoice_id.date_invoice, | 59 | 'date' : line.recongnition_date or line.invoice_id.date_invoice, |
701 | 60 | 'invoice_id': line.invoice_id.id, | ||
702 | 60 | } | 61 | } |
703 | 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) |
704 | 62 | vals.update(changed_vals['value']) | 63 | vals.update(changed_vals['value']) |
705 | 63 | 64 | ||
706 | === modified file 'account_asset/account_asset_invoice_view.xml' | |||
707 | --- account_asset/account_asset_invoice_view.xml 2013-10-27 12:31:04 +0000 | |||
708 | +++ account_asset/account_asset_invoice_view.xml 2014-05-28 05:47:51 +0000 | |||
709 | @@ -9,7 +9,8 @@ | |||
710 | 9 | <field name="inherit_id" ref="account.view_invoice_line_form"/> | 9 | <field name="inherit_id" ref="account.view_invoice_line_form"/> |
711 | 10 | <field name="arch" type="xml"> | 10 | <field name="arch" type="xml"> |
712 | 11 | <field name="account_id" position="after"> | 11 | <field name="account_id" position="after"> |
714 | 12 | <field name="asset_category_id"/> | 12 | <field name="asset_category_id" domain="[('type','=','sales')]" string="Revenue Recognition Category"/> |
715 | 13 | <field name="recongnition_date"/> | ||
716 | 13 | </field> | 14 | </field> |
717 | 14 | </field> | 15 | </field> |
718 | 15 | </record> | 16 | </record> |
719 | @@ -20,7 +21,19 @@ | |||
720 | 20 | <field name="inherit_id" ref="account.invoice_supplier_form"/> | 21 | <field name="inherit_id" ref="account.invoice_supplier_form"/> |
721 | 21 | <field name="arch" type="xml"> | 22 | <field name="arch" type="xml"> |
722 | 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"> |
724 | 23 | <field name="asset_category_id"/> | 24 | <field name="asset_category_id" domain="[('type','=','purchase')]" context="{'default_type':'purchase'}"/> |
725 | 25 | </xpath> | ||
726 | 26 | </field> | ||
727 | 27 | </record> | ||
728 | 28 | |||
729 | 29 | <record model="ir.ui.view" id="view_customer_invoice_asset_category"> | ||
730 | 30 | <field name="name">account.invoice.customer.form</field> | ||
731 | 31 | <field name="model">account.invoice</field> | ||
732 | 32 | <field name="inherit_id" ref="account.invoice_form"/> | ||
733 | 33 | <field name="arch" type="xml"> | ||
734 | 34 | <xpath expr="//field[@name='invoice_line']/tree/field[@name='quantity']" position="before"> | ||
735 | 35 | <field name="asset_category_id" domain="[('type','=','sales')]" string="Revenue Recognition Category"/> | ||
736 | 36 | <field name="recongnition_date"/> | ||
737 | 24 | </xpath> | 37 | </xpath> |
738 | 25 | </field> | 38 | </field> |
739 | 26 | </record> | 39 | </record> |
740 | 27 | 40 | ||
741 | === modified file 'account_asset/account_asset_view.xml' | |||
742 | --- account_asset/account_asset_view.xml 2014-03-28 14:06:51 +0000 | |||
743 | +++ account_asset/account_asset_view.xml 2014-05-28 05:47:51 +0000 | |||
744 | @@ -13,25 +13,37 @@ | |||
745 | 13 | <group> | 13 | <group> |
746 | 14 | <group> | 14 | <group> |
747 | 15 | <field name="name"/> | 15 | <field name="name"/> |
748 | 16 | <field name="type" widget="radio" on_change="onchange_type(type)" readonly="context.get('from_asset', False)"/> | ||
749 | 16 | <field name="company_id" widget="selection" groups="base.group_multi_company"/> | 17 | <field name="company_id" widget="selection" groups="base.group_multi_company"/> |
750 | 17 | </group> | 18 | </group> |
751 | 18 | <group> | 19 | <group> |
764 | 19 | <field name="journal_id"/> | 20 | <field name="journal_id" on_change="onchange_journal_id(journal_id, type)"/> |
765 | 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')]}"/> |
766 | 21 | <field name="account_depreciation_id"/> | 22 | <label for="account_asset_id" string="Asset Account" attrs="{'invisible': [('type','!=','purchase')]}" style="margin-left: -8px"/> |
767 | 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)]}"/> |
768 | 23 | </group> | 24 | <field name="account_income_recognition_id" attrs="{'invisible': [('type','!=','sales')],'required': [('type','=','sales')]}" colspan="0"/> |
769 | 24 | <group string="Depreciation Dates"> | 25 | <label for="account_depreciation_id" string="Depreciation Account" attrs="{'invisible': [('type','!=','purchase')]}" style="margin-left: -8px"/> |
770 | 25 | <field name="method_time"/> | 26 | <field name="account_depreciation_id" nolabel="1" attrs="{'invisible': [('type','!=','purchase')]}" colspan="0"/> |
771 | 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')]}"/> |
772 | 27 | <field name="method_period"/> | 28 | </group> |
773 | 28 | <field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','=','number')]}"/> | 29 | <group> |
774 | 29 | </group> | 30 | <separator string="Installment Information" attrs="{'invisible': [('type','!=','sales')]}" colspan="2"/> |
775 | 30 | <group string="Depreciation Method"> | 31 | <separator string="Depreciation Information" attrs="{'invisible': [('type','=','sales')]}" colspan="2"/> |
776 | 32 | <field name="method_time" string="Time Method Based On" widget="radio" attrs="{'invisible': [('type','!=','purchase')]}"/> | ||
777 | 33 | <label for="method_number" string="Number of Installment" attrs="{'invisible': [('type','!=','sales')]}"/> | ||
778 | 34 | <label for="method_number" string="Number of Depreciations" attrs="{'invisible': [('type','!=','purchase')]}" style="margin-left: -8px" colspan="0"/> | ||
779 | 35 | <field name="method_number" nolabel="1" string="Number of Depreciations" attrs="{'invisible':['|',('method_time','!=','number'),'&',('type','=', False)], 'required':[('method_time','=','number')]}"/> | ||
780 | 36 | <label for="method_period" string="Installment Period" attrs="{'invisible': [('type','!=','sales')]}"/> | ||
781 | 37 | <label for="method_period" string="Depreciation Period " attrs="{'invisible': [('type','!=','purchase')]}" style="margin-left: -8px" colspan="0"/> | ||
782 | 38 | <field name="method_period" nolabel="1" attrs="{'invisible': [('type','=', False)]}"/> | ||
783 | 39 | <field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','!=','end')]}"/> | ||
784 | 40 | <field name="open_asset"/> | ||
785 | 41 | </group> | ||
786 | 42 | <group attrs="{'invisible': [('type','=','sales')]}"> | ||
787 | 43 | <separator string="Depreciation Method" colspan="2"/> | ||
788 | 31 | <field name="method"/> | 44 | <field name="method"/> |
789 | 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')]}"/> |
790 | 33 | <field name="prorata"/> | 46 | <field name="prorata"/> |
791 | 34 | <field name="open_asset"/> | ||
792 | 35 | </group> | 47 | </group> |
793 | 36 | <group groups="analytic.group_analytic_accounting" string="Analytic Information"> | 48 | <group groups="analytic.group_analytic_accounting" string="Analytic Information"> |
794 | 37 | <field name="account_analytic_id"/> | 49 | <field name="account_analytic_id"/> |
795 | @@ -51,6 +63,7 @@ | |||
796 | 51 | <field name="name"/> | 63 | <field name="name"/> |
797 | 52 | <field name="journal_id"/> | 64 | <field name="journal_id"/> |
798 | 53 | <field name="method"/> | 65 | <field name="method"/> |
799 | 66 | <field name="type"/> | ||
800 | 54 | <field name="company_id" groups="base.group_multi_company"/> | 67 | <field name="company_id" groups="base.group_multi_company"/> |
801 | 55 | </tree> | 68 | </tree> |
802 | 56 | </field> | 69 | </field> |
803 | @@ -61,16 +74,222 @@ | |||
804 | 61 | <field name="model">account.asset.category</field> | 74 | <field name="model">account.asset.category</field> |
805 | 62 | <field name="arch" type="xml"> | 75 | <field name="arch" type="xml"> |
806 | 63 | <search string="Search Asset Category"> | 76 | <search string="Search Asset Category"> |
808 | 64 | <field name="name" string="Asset Category"/> | 77 | <filter icon="terp-check" string="Sales" domain="[('type','=', 'sales')]" help="Revenue Recognitions"/> |
809 | 78 | <filter icon="terp-dialog-close" string="Purchase" domain="[('type','=', 'purchase')]" help="Assets"/> | ||
810 | 79 | <field name="name" string="Category"/> | ||
811 | 65 | <field name="journal_id"/> | 80 | <field name="journal_id"/> |
812 | 81 | <group expand="0" string="Group By..."> | ||
813 | 82 | <filter string="Type" domain="[]" context="{'group_by':'type'}"/> | ||
814 | 83 | </group> | ||
815 | 84 | </search> | ||
816 | 85 | </field> | ||
817 | 86 | </record> | ||
818 | 87 | |||
819 | 88 | <record id="view_account_move_line_filter_new" model="ir.ui.view"> | ||
820 | 89 | <field name="name">Journal Items</field> | ||
821 | 90 | <field eval="30" name="priority"/> | ||
822 | 91 | <field name="model">account.move.line</field> | ||
823 | 92 | <field name="arch" type="xml"> | ||
824 | 93 | <search string="Search Journal Items"> | ||
825 | 94 | <field name="name" filter_domain="['|', ('name','ilike',self), ('ref','ilike',self)]" string="Move"/> | ||
826 | 95 | <field name="date"/> | ||
827 | 96 | <filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/> | ||
828 | 97 | <separator/> | ||
829 | 98 | <filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/> | ||
830 | 99 | <filter name="posted" icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/> | ||
831 | 100 | <separator/> | ||
832 | 101 | <filter icon="terp-dolar_ok!" string="Unreconciled" domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help="Unreconciled Journal Items" name="unreconciled"/> | ||
833 | 102 | <separator/> | ||
834 | 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)]"/> | ||
835 | 104 | <field name="move_id" string="Number (Move)"/> | ||
836 | 105 | <field name="account_id"/> | ||
837 | 106 | <field name="asset_id" string="Recognition"/> | ||
838 | 107 | <field name="partner_id"/> | ||
839 | 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 --> | ||
840 | 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 --> | ||
841 | 110 | <group expand="0" string="Group By..."> | ||
842 | 111 | <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> | ||
843 | 112 | <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/> | ||
844 | 113 | <filter string="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/> | ||
845 | 114 | <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/> | ||
846 | 115 | </group> | ||
847 | 66 | </search> | 116 | </search> |
848 | 67 | </field> | 117 | </field> |
849 | 68 | </record> | 118 | </record> |
850 | 69 | 119 | ||
851 | 120 | <record id="action_account_moves_all_search" model="ir.actions.act_window"> | ||
852 | 121 | <field name="name">Journal Items</field> | ||
853 | 122 | <field name="res_model">account.move.line</field> | ||
854 | 123 | <field name="context">{'search_default_asset_id': [active_id]}</field> | ||
855 | 124 | <field name="search_view_id" ref="view_account_move_line_filter_new"/> | ||
856 | 125 | </record> | ||
857 | 126 | |||
858 | 70 | <!-- | 127 | <!-- |
859 | 128 | Asset Revenue Recognition Form | ||
860 | 129 | --> | ||
861 | 130 | |||
862 | 131 | <record model="ir.ui.view" id="view_revenue_recognition_form"> | ||
863 | 132 | <field name="name">account.revenue.recognition.form</field> | ||
864 | 133 | <field name="model">account.asset.asset</field> | ||
865 | 134 | <field name="arch" type="xml"> | ||
866 | 135 | <form string="Revenue" version="7.0"> | ||
867 | 136 | <header> | ||
868 | 137 | <button name="validate" states="draft" string="Confirm Recognition" type="object" class="oe_highlight"/> | ||
869 | 138 | <button name="set_to_close" states="open" string="Set to Close" type="object" class="oe_highlight"/> | ||
870 | 139 | <button name="set_to_draft" states="open" string="Set to Draft" type="object" /> | ||
871 | 140 | <field name="state" widget="statusbar" statusbar_visible="draft,open"/> | ||
872 | 141 | </header> | ||
873 | 142 | <sheet> | ||
874 | 143 | <div class="oe_button_box oe_right"> | ||
875 | 144 | <button class="oe_inline oe_stat_button" name="%(action_account_moves_all_search)d" type="action" icon="fa-pencil"> | ||
876 | 145 | <field string="Entries" name="entry_count" widget="statinfo" /> | ||
877 | 146 | </button> | ||
878 | 147 | </div> | ||
879 | 148 | <div class="oe_title"> | ||
880 | 149 | <label for="name" class="oe_edit_only" string="Recognition Name"/> | ||
881 | 150 | <h1> | ||
882 | 151 | <field name="name" class="oe_inline"/> | ||
883 | 152 | </h1> | ||
884 | 153 | </div> | ||
885 | 154 | <group> | ||
886 | 155 | <group> | ||
887 | 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}"/> | ||
888 | 157 | <field name="code"/> | ||
889 | 158 | <field name="parent_id" string="Parent Recognition" domain="[('category_id.type', '=', 'sales')]" help="Used as parent recognition of this recognition"/> | ||
890 | 159 | <field name="date" string="Sale Date" help="Sale date of revenue recognition"/> | ||
891 | 160 | <field name="company_id" widget="selection" groups="base.group_multi_company" on_change="onchange_company_id(company_id)"/> | ||
892 | 161 | </group> | ||
893 | 162 | <group> | ||
894 | 163 | <field name="currency_id" groups="base.group_multi_currency"/> | ||
895 | 164 | <field name="value" string="Sale Value" widget="monetary" options="{'currency_field': 'currency_id'}" help="Sale value of revenue recognition"/> | ||
896 | 165 | <field name="partner_id" string="Customer"/> | ||
897 | 166 | <field name="invoice_id" string="Sale Invoice" domain="[('invoice_line.asset_category_id.type','=','sales')]"/> | ||
898 | 167 | </group> | ||
899 | 168 | </group> | ||
900 | 169 | <notebook colspan="4"> | ||
901 | 170 | <page string="Installment Board"> | ||
902 | 171 | <field name="depreciation_line_ids" mode="tree" string="Installment Lines" options="{'reload_whole_on_button': true}"> | ||
903 | 172 | <tree string="Installment Lines" colors="blue:(move_check == False);black:(move_check == True)" create="false"> | ||
904 | 173 | <field name="sequence" string="Serial Number"/> | ||
905 | 174 | <field name="depreciation_date" string="Due Date"/> | ||
906 | 175 | <field name="depreciated_value" invisible="1" string="Amount Already Paid"/> | ||
907 | 176 | <field name="amount" readonly="1" string="Installment Amount"/> | ||
908 | 177 | <field name="remaining_value" readonly="1" string="Remaining Value"/> | ||
909 | 178 | <field name="move_check" invisible="1"/> | ||
910 | 179 | <field name="parent_state" invisible="1"/> | ||
911 | 180 | <button name="create_move" type="object" widget="widgetonbutton"/> | ||
912 | 181 | </tree> | ||
913 | 182 | <form string="Installment Lines"> | ||
914 | 183 | <group> | ||
915 | 184 | <group> | ||
916 | 185 | <field name="asset_id" invisible="1"/> | ||
917 | 186 | <field name="parent_state" invisible="1"/> | ||
918 | 187 | <field name="name" string="Installment Name"/> | ||
919 | 188 | <field name="sequence"/> | ||
920 | 189 | <field name="move_id" string="Installment Entry"/> | ||
921 | 190 | <field name="move_check"/> | ||
922 | 191 | <field name="parent_state" invisible="1"/> | ||
923 | 192 | </group> | ||
924 | 193 | <group> | ||
925 | 194 | <field name="amount" string="Current Installment"/> | ||
926 | 195 | <field name="depreciation_date" string="Due Date"/> | ||
927 | 196 | <field name="depreciated_value" readonly="1" string="Amount Already Paid"/> | ||
928 | 197 | <field name="remaining_value" readonly="1" string="Remaining value"/> | ||
929 | 198 | </group> | ||
930 | 199 | </group> | ||
931 | 200 | </form> | ||
932 | 201 | </field> | ||
933 | 202 | <button type="object" name="compute_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','=','close')]}"/> | ||
934 | 203 | </page> | ||
935 | 204 | <page string="History"> | ||
936 | 205 | <field name="history_ids" readonly="1"/> | ||
937 | 206 | </page> | ||
938 | 207 | </notebook> | ||
939 | 208 | <separator string="Installment Information" colspan="4"/> | ||
940 | 209 | <group> | ||
941 | 210 | <field name="method_number" string="Number of Installment" help="The number of installment needed for your recognition"/> | ||
942 | 211 | <field name="method_period" string="Installment Period" help="State here the time between 2 installments, in months"/> | ||
943 | 212 | <button name="%(action_asset_modify)d" states="open" string="(update)" type="action" class="oe_inline oe_link" colspan="4"/> | ||
944 | 213 | <field name="prorata" invisible="1"/> | ||
945 | 214 | </group> | ||
946 | 215 | </sheet> | ||
947 | 216 | <div class="oe_chatter"> | ||
948 | 217 | <field name="message_follower_ids" widget="mail_followers" groups="base.group_user" /> | ||
949 | 218 | <field name="message_ids" widget="mail_thread"/> | ||
950 | 219 | </div> | ||
951 | 220 | </form> | ||
952 | 221 | </field> | ||
953 | 222 | </record> | ||
954 | 223 | |||
955 | 224 | <record model="ir.ui.view" id="view_account_revenue_recognition_tree"> | ||
956 | 225 | <field name="name">account.revenue.recognition.tree</field> | ||
957 | 226 | <field name="model">account.asset.asset</field> | ||
958 | 227 | <field name="field_parent">child_ids</field> | ||
959 | 228 | <field name="arch" type="xml"> | ||
960 | 229 | <tree string="Revenue Recognition" colors="blue:(state == 'draft');grey:(state == 'close')"> | ||
961 | 230 | <field name="name" string="Name"/> | ||
962 | 231 | <field name="category_id" string="Category"/> | ||
963 | 232 | <field name="date" string="Sale Date"/> | ||
964 | 233 | <field name="partner_id" string="Customer"/> | ||
965 | 234 | <field name="value" string="Sale Value"/> | ||
966 | 235 | <field name="currency_id" groups="base.group_multi_currency"/> | ||
967 | 236 | <field name="company_id" groups="base.group_multi_company"/> | ||
968 | 237 | <field name="state"/> | ||
969 | 238 | </tree> | ||
970 | 239 | </field> | ||
971 | 240 | </record> | ||
972 | 241 | |||
973 | 242 | <record id="view_account_revenue_recognition_search" model="ir.ui.view"> | ||
974 | 243 | <field name="name">account.revenue.recognition.search</field> | ||
975 | 244 | <field name="model">account.asset.asset</field> | ||
976 | 245 | <field name="arch" type="xml"> | ||
977 | 246 | <search string="Account Revenue Recognition Search"> | ||
978 | 247 | <field name="name" string="Recognition"/> | ||
979 | 248 | <field name="category_id" string="Recognition Category"/> | ||
980 | 249 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> | ||
981 | 250 | <filter icon="terp-check" string="Current" domain="[('state','in', ('draft','open'))]" help="Recognition in draft and open states"/> | ||
982 | 251 | <filter icon="terp-dialog-close" string="Closed" domain="[('state','=', 'close')]" help="Recognition in closed state"/> | ||
983 | 252 | <group expand="0" string="Group By..."> | ||
984 | 253 | <filter string="Category" icon="terp-go-month" domain="[]" context="{'group_by':'category_id'}"/> | ||
985 | 254 | <filter string="Sale Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/> | ||
986 | 255 | <filter string="Parent" icon="terp-go-month" domain="[]" context="{'group_by':'parent_id'}"/> | ||
987 | 256 | <filter string="Recognition Name" context="{'group_by':'name'}" invisible="1"/> | ||
988 | 257 | </group> | ||
989 | 258 | </search> | ||
990 | 259 | </field> | ||
991 | 260 | </record> | ||
992 | 261 | <record model="ir.ui.view" id="view_account_revenue_recognition_graph"> | ||
993 | 262 | <field name="name">account.revenue.recognition.graph</field> | ||
994 | 263 | <field name="model">account.asset.asset</field> | ||
995 | 264 | <field name="arch" type="xml"> | ||
996 | 265 | <graph string="Assets" type="bar"> | ||
997 | 266 | <field name="name" type="row"/> | ||
998 | 267 | <field name="value" type="measure"/> | ||
999 | 268 | </graph> | ||
1000 | 269 | </field> | ||
1001 | 270 | </record> | ||
1002 | 271 | |||
1003 | 272 | <record model="ir.ui.view" id="view_account_revenue_recognition_hierarchy_tree"> | ||
1004 | 273 | <field name="name">account.revenue.recognition.hierarchy</field> | ||
1005 | 274 | <field name="model">account.asset.asset</field> | ||
1006 | 275 | <field name="field_parent">child_ids</field> | ||
1007 | 276 | <field name="arch" type="xml"> | ||
1008 | 277 | <tree string="Revenue Recognition Hierarchy view"> | ||
1009 | 278 | <field name="name" string="Name"/> | ||
1010 | 279 | <field name="category_id" string="Category"/> | ||
1011 | 280 | <field name="code"/> | ||
1012 | 281 | <field name="date" string="Sales Date"/> | ||
1013 | 282 | <field name="value" string="Sales value"/> | ||
1014 | 283 | <field name="currency_id" groups="base.group_multi_currency"/> | ||
1015 | 284 | <field name="company_id" groups="base.group_multi_company"/> | ||
1016 | 285 | <field name="state"/> | ||
1017 | 286 | </tree> | ||
1018 | 287 | </field> | ||
1019 | 288 | </record> | ||
1020 | 289 | <!-- | ||
1021 | 71 | Asset | 290 | Asset |
1022 | 72 | --> | 291 | --> |
1024 | 73 | 292 | ||
1025 | 74 | <record model="ir.ui.view" id="view_account_asset_asset_form"> | 293 | <record model="ir.ui.view" id="view_account_asset_asset_form"> |
1026 | 75 | <field name="name">account.asset.asset.form</field> | 294 | <field name="name">account.asset.asset.form</field> |
1027 | 76 | <field name="model">account.asset.asset</field> | 295 | <field name="model">account.asset.asset</field> |
1028 | @@ -96,51 +315,33 @@ | |||
1029 | 96 | </div> | 315 | </div> |
1030 | 97 | <group> | 316 | <group> |
1031 | 98 | <group> | 317 | <group> |
1033 | 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"/> |
1034 | 100 | <field name="code"/> | 319 | <field name="code"/> |
1036 | 101 | <field name="parent_id"/> | 320 | <field name="parent_id" domain="[('category_id.type','=','purchase')]" help="Used as parent asset of this asset"/> |
1037 | 321 | <field name="date" string="Purchase Date" help="Purchase date of asset"/> | ||
1038 | 322 | <field name="company_id" widget="selection" groups="base.group_multi_company" on_change="onchange_company_id(company_id)"/> | ||
1039 | 102 | </group> | 323 | </group> |
1040 | 103 | <group> | 324 | <group> |
1041 | 104 | <field name="purchase_date"/> | ||
1042 | 105 | <field name="currency_id" groups="base.group_multi_currency"/> | 325 | <field name="currency_id" groups="base.group_multi_currency"/> |
1044 | 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"/> |
1045 | 327 | <field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(value, salvage_value)"/> | ||
1046 | 328 | <field name="value_residual" widget="monetary" options="{'currency_field': 'currency_id'}"/> | ||
1047 | 329 | <field name="partner_id" string="Supplier"/> | ||
1048 | 330 | <field name="invoice_id" string="Purchase Invoice" domain="[('invoice_line.asset_category_id.type','=','purchase')]"/> | ||
1049 | 107 | </group> | 331 | </group> |
1050 | 108 | </group> | 332 | </group> |
1051 | 109 | <notebook colspan="4"> | 333 | <notebook colspan="4"> |
1052 | 110 | <page string="General"> | ||
1053 | 111 | <group> | ||
1054 | 112 | <group> | ||
1055 | 113 | <field name="purchase_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(purchase_value, salvage_value)"/> | ||
1056 | 114 | <field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(purchase_value, salvage_value)"/> | ||
1057 | 115 | <field name="value_residual" widget="monetary" options="{'currency_field': 'currency_id'}"/> | ||
1058 | 116 | <field name="partner_id"/> | ||
1059 | 117 | </group> | ||
1060 | 118 | <group> | ||
1061 | 119 | <field name="method"/> | ||
1062 | 120 | <field name="method_progress_factor" attrs="{'invisible':[('method','=','linear')], 'required':[('method','=','degressive')]}"/> | ||
1063 | 121 | <label for="method_time"/> | ||
1064 | 122 | <div> | ||
1065 | 123 | <field name="method_time" on_change="onchange_method_time(method_time)" class="oe_inline"/> | ||
1066 | 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"/> | ||
1067 | 125 | </div> | ||
1068 | 126 | <field name="prorata" attrs="{'invisible': [('method_time','=','end')]}"/> | ||
1069 | 127 | <field name="method_number" attrs="{'invisible':[('method_time','=','end')], 'required':[('method_time','=','number')]}"/> | ||
1070 | 128 | <field name="method_period"/> | ||
1071 | 129 | <field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','=','number')]}"/> | ||
1072 | 130 | </group> | ||
1073 | 131 | </group> | ||
1074 | 132 | </page> | ||
1075 | 133 | <page string="Depreciation Board"> | 334 | <page string="Depreciation Board"> |
1078 | 134 | <field name="depreciation_line_ids" mode="tree"> | 335 | <field name="depreciation_line_ids" mode="tree" options="{'reload_whole_on_button': true}"> |
1079 | 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"> |
1080 | 337 | <field name="sequence" string="Serial Number"/> | ||
1081 | 136 | <field name="depreciation_date"/> | 338 | <field name="depreciation_date"/> |
1082 | 137 | <field name="sequence" invisible="1"/> | ||
1083 | 138 | <field name="depreciated_value" readonly="1"/> | 339 | <field name="depreciated_value" readonly="1"/> |
1084 | 139 | <field name="amount"/> | 340 | <field name="amount"/> |
1085 | 140 | <field name="remaining_value" readonly="1"/> | 341 | <field name="remaining_value" readonly="1"/> |
1087 | 141 | <field name="move_check"/> | 342 | <field name="move_check" invisible="1"/> |
1088 | 142 | <field name="parent_state" invisible="1"/> | 343 | <field name="parent_state" invisible="1"/> |
1090 | 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"/> |
1091 | 144 | </tree> | 345 | </tree> |
1092 | 145 | <form string="Depreciation Lines"> | 346 | <form string="Depreciation Lines"> |
1093 | 146 | <group> | 347 | <group> |
1094 | @@ -148,13 +349,13 @@ | |||
1095 | 148 | <field name="asset_id" invisible="1"/> | 349 | <field name="asset_id" invisible="1"/> |
1096 | 149 | <field name="parent_state" invisible="1"/> | 350 | <field name="parent_state" invisible="1"/> |
1097 | 150 | <field name="name"/> | 351 | <field name="name"/> |
1098 | 352 | <field name="sequence"/> | ||
1099 | 353 | <field name="move_id"/> | ||
1100 | 354 | <field name="move_check"/> | ||
1101 | 355 | <field name="parent_state" invisible="1"/> | ||
1102 | 356 | </group> | ||
1103 | 357 | <group> | ||
1104 | 151 | <field name="amount"/> | 358 | <field name="amount"/> |
1105 | 152 | <field name="move_id"/> | ||
1106 | 153 | <field name="move_check"/> | ||
1107 | 154 | <field name="parent_state" invisible="1"/> | ||
1108 | 155 | </group> | ||
1109 | 156 | <group> | ||
1110 | 157 | <field name="sequence"/> | ||
1111 | 158 | <field name="depreciation_date"/> | 359 | <field name="depreciation_date"/> |
1112 | 159 | <field name="depreciated_value" readonly="1"/> | 360 | <field name="depreciated_value" readonly="1"/> |
1113 | 160 | <field name="remaining_value" readonly="1"/> | 361 | <field name="remaining_value" readonly="1"/> |
1114 | @@ -165,14 +366,32 @@ | |||
1115 | 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')]}"/> |
1116 | 166 | </page> | 367 | </page> |
1117 | 167 | <page string="History"> | 368 | <page string="History"> |
1118 | 168 | <field name="account_move_line_ids" readonly="1"/> | ||
1119 | 169 | <field name="history_ids" readonly="1"/> | 369 | <field name="history_ids" readonly="1"/> |
1120 | 170 | </page> | 370 | </page> |
1121 | 171 | <page string="Notes"> | ||
1122 | 172 | <field name="note" placeholder="Add an internal note here..."/> | ||
1123 | 173 | </page> | ||
1124 | 174 | </notebook> | 371 | </notebook> |
1125 | 372 | <separator string="Depreciation Information" colspan="4"/> | ||
1126 | 373 | <group> | ||
1127 | 374 | <group> | ||
1128 | 375 | <field name="method"/> | ||
1129 | 376 | <field name="method_progress_factor" attrs="{'invisible':[('method','=','linear')], 'required':[('method','=','degressive')]}"/> | ||
1130 | 377 | <label for="method_time"/> | ||
1131 | 378 | <div> | ||
1132 | 379 | <field name="method_time" on_change="onchange_method_time(method_time)"/> | ||
1133 | 380 | <button name="%(action_asset_modify)d" states="open" string="(update)" type="action" class="oe_inline oe_link" colspan="1"/> | ||
1134 | 381 | </div> | ||
1135 | 382 | <field name="prorata" attrs="{'invisible': [('method_time','=','end')]}"/> | ||
1136 | 383 | </group> | ||
1137 | 384 | <group> | ||
1138 | 385 | <field name="method_number" attrs="{'invisible':[('method_time','=','end')], 'required':[('method_time','=','number')]}"/> | ||
1139 | 386 | <field name="method_period"/> | ||
1140 | 387 | <field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','=','number')]}"/> | ||
1141 | 388 | </group> | ||
1142 | 389 | </group> | ||
1143 | 175 | </sheet> | 390 | </sheet> |
1144 | 391 | <div class="oe_chatter"> | ||
1145 | 392 | <field name="message_follower_ids" widget="mail_followers"/> | ||
1146 | 393 | <field name="message_ids" widget="mail_thread"/> | ||
1147 | 394 | </div> | ||
1148 | 176 | </form> | 395 | </form> |
1149 | 177 | </field> | 396 | </field> |
1150 | 178 | </record> | 397 | </record> |
1151 | @@ -183,11 +402,11 @@ | |||
1152 | 183 | <field name="field_parent">child_ids</field> | 402 | <field name="field_parent">child_ids</field> |
1153 | 184 | <field name="arch" type="xml"> | 403 | <field name="arch" type="xml"> |
1154 | 185 | <tree string="Assets" colors="blue:(state == 'draft');grey:(state == 'close')"> | 404 | <tree string="Assets" colors="blue:(state == 'draft');grey:(state == 'close')"> |
1160 | 186 | <field name="name"/> | 405 | <field name="name" string="Name"/> |
1161 | 187 | <field name="category_id"/> | 406 | <field name="category_id" string="Category"/> |
1162 | 188 | <field name="purchase_date"/> | 407 | <field name="date" string="Purchase Date"/> |
1163 | 189 | <field name="partner_id"/> | 408 | <field name="partner_id" string="Supplier"/> |
1164 | 190 | <field name="purchase_value"/> | 409 | <field name="value" string="Gross Value"/> |
1165 | 191 | <field name="value_residual"/> | 410 | <field name="value_residual"/> |
1166 | 192 | <field name="currency_id" groups="base.group_multi_currency"/> | 411 | <field name="currency_id" groups="base.group_multi_currency"/> |
1167 | 193 | <field name="company_id" groups="base.group_multi_company"/> | 412 | <field name="company_id" groups="base.group_multi_company"/> |
1168 | @@ -196,6 +415,17 @@ | |||
1169 | 196 | </field> | 415 | </field> |
1170 | 197 | </record> | 416 | </record> |
1171 | 198 | 417 | ||
1172 | 418 | <record model="ir.ui.view" id="view_account_asset_asset_graph"> | ||
1173 | 419 | <field name="name">account.asset.asset.graph</field> | ||
1174 | 420 | <field name="model">account.asset.asset</field> | ||
1175 | 421 | <field name="arch" type="xml"> | ||
1176 | 422 | <graph string="Assets" type="bar"> | ||
1177 | 423 | <field name="name" type="row"/> | ||
1178 | 424 | <field name="value" type="measure"/> | ||
1179 | 425 | </graph> | ||
1180 | 426 | </field> | ||
1181 | 427 | </record> | ||
1182 | 428 | |||
1183 | 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"> |
1184 | 200 | <field name="name">account.asset.asset.hierarchy</field> | 430 | <field name="name">account.asset.asset.hierarchy</field> |
1185 | 201 | <field name="model">account.asset.asset</field> | 431 | <field name="model">account.asset.asset</field> |
1186 | @@ -204,9 +434,9 @@ | |||
1187 | 204 | <tree string="Assets"> | 434 | <tree string="Assets"> |
1188 | 205 | <field name="name"/> | 435 | <field name="name"/> |
1189 | 206 | <field name="code"/> | 436 | <field name="code"/> |
1193 | 207 | <field name="category_id"/> | 437 | <field name="category_id" string="Asset Category"/> |
1194 | 208 | <field name="purchase_date"/> | 438 | <field name="date" string="Purchase Date"/> |
1195 | 209 | <field name="purchase_value"/> | 439 | <field name="value" string="Gross Value"/> |
1196 | 210 | <field name="value_residual"/> | 440 | <field name="value_residual"/> |
1197 | 211 | <field name="currency_id" groups="base.group_multi_currency"/> | 441 | <field name="currency_id" groups="base.group_multi_currency"/> |
1198 | 212 | <field name="company_id" groups="base.group_multi_company"/> | 442 | <field name="company_id" groups="base.group_multi_company"/> |
1199 | @@ -221,11 +451,16 @@ | |||
1200 | 221 | <field name="arch" type="xml"> | 451 | <field name="arch" type="xml"> |
1201 | 222 | <search string="Account Asset"> | 452 | <search string="Account Asset"> |
1202 | 223 | <field name="name" string="Asset"/> | 453 | <field name="name" string="Asset"/> |
1204 | 224 | <field name="purchase_date"/> | 454 | <field name="date" string="Purchase Date"/> |
1205 | 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"/> |
1206 | 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"/> |
1207 | 227 | <field name="category_id"/> | 457 | <field name="category_id"/> |
1208 | 228 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> | 458 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> |
1209 | 459 | <group expand="0" string="Group By..."> | ||
1210 | 460 | <filter string="Purchase Month" icon="terp-personal" domain="[]" context="{'group_by':'date'}"/> | ||
1211 | 461 | <filter string="Category" icon="terp-personal" domain="[]" context="{'group_by':'category_id'}"/> | ||
1212 | 462 | <filter string="Parent" icon="terp-go-month" domain="[]" context="{'group_by':'parent_id'}"/> | ||
1213 | 463 | </group> | ||
1214 | 229 | </search> | 464 | </search> |
1215 | 230 | </field> | 465 | </field> |
1216 | 231 | </record> | 466 | </record> |
1217 | @@ -273,22 +508,31 @@ | |||
1218 | 273 | </tree> | 508 | </tree> |
1219 | 274 | </field> | 509 | </field> |
1220 | 275 | </record> | 510 | </record> |
1222 | 276 | 511 | ||
1223 | 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"> |
1224 | 278 | <field name="name">Asset Hierarchy</field> | 513 | <field name="name">Asset Hierarchy</field> |
1225 | 279 | <field name="res_model">account.asset.asset</field> | 514 | <field name="res_model">account.asset.asset</field> |
1226 | 280 | <field name="view_type">tree</field> | 515 | <field name="view_type">tree</field> |
1228 | 281 | <field name="domain">[('parent_id','=',False)]</field> | 516 | <field name="domain">[('parent_id','=',False),('category_id.type', '=', 'purchase')]</field> |
1229 | 282 | <field name="view_id" ref="view_account_asset_asset_hierarchy_tree"/> | 517 | <field name="view_id" ref="view_account_asset_asset_hierarchy_tree"/> |
1230 | 283 | </record> | 518 | </record> |
1232 | 284 | 519 | ||
1233 | 520 | <record model="ir.actions.act_window" id="action_account_revenue_recognition_hierarchy_tree"> | ||
1234 | 521 | <field name="name">Revenue Recognition Hierarchy</field> | ||
1235 | 522 | <field name="res_model">account.asset.asset</field> | ||
1236 | 523 | <field name="view_type">tree</field> | ||
1237 | 524 | <field name="view_mode">tree,form</field> | ||
1238 | 525 | <field name="domain">[('parent_id','=',False),('category_id.type', '=', 'sales')]</field> | ||
1239 | 526 | <field name="view_id" ref="view_account_revenue_recognition_hierarchy_tree"/> | ||
1240 | 527 | </record> | ||
1241 | 528 | |||
1242 | 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"> |
1243 | 286 | <field name="name">Journal Items (form)</field> | 530 | <field name="name">Journal Items (form)</field> |
1244 | 287 | <field name="model">account.move.line</field> | 531 | <field name="model">account.move.line</field> |
1245 | 288 | <field name="inherit_id" ref="account.view_move_line_form"/> | 532 | <field name="inherit_id" ref="account.view_move_line_form"/> |
1246 | 289 | <field name="arch" type="xml"> | 533 | <field name="arch" type="xml"> |
1247 | 290 | <field name="statement_id" position="after"> | 534 | <field name="statement_id" position="after"> |
1249 | 291 | <field name="asset_id"/> | 535 | <field name="asset_id" string="Asset"/> |
1250 | 292 | </field> | 536 | </field> |
1251 | 293 | </field> | 537 | </field> |
1252 | 294 | </record> | 538 | </record> |
1253 | @@ -299,37 +543,94 @@ | |||
1254 | 299 | <field name="inherit_id" ref="account.view_account_move_line_filter"/> | 543 | <field name="inherit_id" ref="account.view_account_move_line_filter"/> |
1255 | 300 | <field name="arch" type="xml"> | 544 | <field name="arch" type="xml"> |
1256 | 301 | <field name="account_id" position="after"> | 545 | <field name="account_id" position="after"> |
1258 | 302 | <field name="asset_id"/> | 546 | <field name="asset_id" string="Asset"/> |
1259 | 303 | </field> | 547 | </field> |
1260 | 304 | </field> | 548 | </field> |
1261 | 305 | </record> | 549 | </record> |
1262 | 306 | 550 | ||
1267 | 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"/> |
1264 | 308 | <menuitem parent="menu_finance_assets" id="menu_action_account_asset_asset_tree" | ||
1265 | 309 | sequence="100" | ||
1266 | 310 | action="action_account_asset_asset_tree"/> | ||
1268 | 311 | 552 | ||
1269 | 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"> |
1271 | 313 | <field name="name">Assets</field> | 554 | <field name="name">Revenues Assets</field> |
1272 | 314 | <field name="res_model">account.asset.asset</field> | 555 | <field name="res_model">account.asset.asset</field> |
1273 | 315 | <field name="view_type">form</field> | 556 | <field name="view_type">form</field> |
1274 | 557 | <field name="view_mode">tree,form,graph</field> | ||
1275 | 558 | <field name="domain">[('category_id.type', '=', 'purchase')]</field> | ||
1276 | 316 | <field name="view_id" ref="view_account_asset_asset_tree"/> | 559 | <field name="view_id" ref="view_account_asset_asset_tree"/> |
1277 | 317 | <field name="search_view_id" ref="view_account_asset_search"/> | 560 | <field name="search_view_id" ref="view_account_asset_search"/> |
1278 | 318 | </record> | 561 | </record> |
1279 | 319 | 562 | ||
1285 | 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"> |
1286 | 321 | 564 | <field name="sequence" eval="0"/> | |
1287 | 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> |
1288 | 323 | 566 | <field name="view_id" ref="view_account_asset_asset_tree"/> | |
1289 | 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"/> |
1290 | 568 | </record> | ||
1291 | 569 | <record model="ir.actions.act_window.view" id="view_action_account_asset_form"> | ||
1292 | 570 | <field name="sequence" eval="1"/> | ||
1293 | 571 | <field name="view_mode">form</field> | ||
1294 | 572 | <field name="view_id" ref="view_account_asset_asset_form"/> | ||
1295 | 573 | <field name="act_window_id" ref="action_account_asset_asset_form"/> | ||
1296 | 574 | </record> | ||
1297 | 575 | <record model="ir.actions.act_window.view" id="view_action_account_asset_graph"> | ||
1298 | 576 | <field name="sequence" eval="1"/> | ||
1299 | 577 | <field name="view_mode">graph</field> | ||
1300 | 578 | <field name="view_id" ref="view_account_asset_asset_graph"/> | ||
1301 | 579 | <field name="act_window_id" ref="action_account_asset_asset_form"/> | ||
1302 | 580 | </record> | ||
1303 | 581 | |||
1304 | 582 | <!-- Revenue Recognition Action --> | ||
1305 | 583 | |||
1306 | 584 | <record model="ir.actions.act_window" id="action_account_revenue_form"> | ||
1307 | 585 | <field name="name">Revenues Recognitions</field> | ||
1308 | 586 | <field name="res_model">account.asset.asset</field> | ||
1309 | 587 | <field name="view_type">form</field> | ||
1310 | 588 | <field name="view_mode">tree,form,graph</field> | ||
1311 | 589 | <field name="domain">[('category_id.type', '=', 'sales')]</field> | ||
1312 | 590 | <field name="view_id" ref="view_account_revenue_recognition_tree"/> | ||
1313 | 591 | <field name="search_view_id" ref="view_account_revenue_recognition_search"/> | ||
1314 | 592 | </record> | ||
1315 | 593 | |||
1316 | 594 | <record model="ir.actions.act_window.view" id="view_action_account_revenue_tree"> | ||
1317 | 595 | <field name="sequence" eval="0"/> | ||
1318 | 596 | <field name="view_mode">tree</field> | ||
1319 | 597 | <field name="view_id" ref="view_account_revenue_recognition_tree"/> | ||
1320 | 598 | <field name="act_window_id" ref="action_account_revenue_form"/> | ||
1321 | 599 | </record> | ||
1322 | 600 | <record model="ir.actions.act_window.view" id="view_action_account_revenue_form"> | ||
1323 | 601 | <field name="sequence" eval="1"/> | ||
1324 | 602 | <field name="view_mode">form</field> | ||
1325 | 603 | <field name="view_id" ref="view_revenue_recognition_form"/> | ||
1326 | 604 | <field name="act_window_id" ref="action_account_revenue_form"/> | ||
1327 | 605 | </record> | ||
1328 | 606 | <record model="ir.actions.act_window.view" id="view_action_account_revenue_graph"> | ||
1329 | 607 | <field name="sequence" eval="1"/> | ||
1330 | 608 | <field name="view_mode">graph</field> | ||
1331 | 609 | <field name="view_id" ref="view_account_revenue_recognition_graph"/> | ||
1332 | 610 | <field name="act_window_id" ref="action_account_revenue_form"/> | ||
1333 | 611 | </record> | ||
1334 | 612 | |||
1335 | 613 | <menuitem parent="menu_finance_assets" id="menu_revenue_recognition" action="action_account_revenue_form" sequence="102"/> | ||
1336 | 614 | |||
1337 | 615 | <menuitem parent="menu_finance_assets" id="menu_action_account_asset_asset_form" action="action_account_asset_asset_form" sequence="104"/> | ||
1338 | 616 | |||
1339 | 617 | <menuitem id="menu_finance_config_assets" name="Installment Plans" parent="account.menu_finance_configuration" sequence="25"/> | ||
1340 | 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"> |
1342 | 326 | <field name="name">Asset Categories</field> | 619 | <field name="name">Categories</field> |
1343 | 327 | <field name="res_model">account.asset.category</field> | 620 | <field name="res_model">account.asset.category</field> |
1344 | 328 | <field name="view_type">form</field> | 621 | <field name="view_type">form</field> |
1345 | 329 | <field name="view_mode">tree,form</field> | 622 | <field name="view_mode">tree,form</field> |
1346 | 330 | </record> | 623 | </record> |
1347 | 331 | 624 | ||
1350 | 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"/> |
1351 | 333 | 626 | <menuitem name="Assets Hierarchy" parent="menu_finance_assets" id="menu_action_account_asset_asset_tree" action="action_account_asset_asset_tree" sequence="105"/> | |
1352 | 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"/> | ||
1353 | 628 | |||
1354 | 629 | <template id="assets_backend" name="accountasset assets" inherit_id="web.assets_backend"> | ||
1355 | 630 | <xpath expr="." position="inside"> | ||
1356 | 631 | <script type="text/javascript" src="/account_asset/static/src/js/account_asset.js"></script> | ||
1357 | 632 | </xpath> | ||
1358 | 633 | </template> | ||
1359 | 634 | |||
1360 | 334 | </data> | 635 | </data> |
1361 | 335 | </openerp> | 636 | </openerp> |
1362 | 336 | 637 | ||
1363 | === modified file 'account_asset/report/account_asset_report.py' | |||
1364 | --- account_asset/report/account_asset_report.py 2013-10-27 12:31:04 +0000 | |||
1365 | +++ account_asset/report/account_asset_report.py 2014-05-28 05:47:51 +0000 | |||
1366 | @@ -28,15 +28,17 @@ | |||
1367 | 28 | _auto = False | 28 | _auto = False |
1368 | 29 | _columns = { | 29 | _columns = { |
1369 | 30 | 'name': fields.char('Year', size=16, required=False, readonly=True), | 30 | 'name': fields.char('Year', size=16, required=False, readonly=True), |
1371 | 31 | 'purchase_date': fields.date('Purchase Date', readonly=True), | 31 | 'date': fields.date('Purchase Date', readonly=True), |
1372 | 32 | 'depreciation_date': fields.date('Depreciation Date', readonly=True), | 32 | 'depreciation_date': fields.date('Depreciation Date', readonly=True), |
1373 | 33 | 'asset_id': fields.many2one('account.asset.asset', string='Asset', readonly=True), | 33 | 'asset_id': fields.many2one('account.asset.asset', string='Asset', readonly=True), |
1374 | 34 | 'asset_category_id': fields.many2one('account.asset.category',string='Asset category'), | 34 | 'asset_category_id': fields.many2one('account.asset.category',string='Asset category'), |
1375 | 35 | 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True), | 35 | 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True), |
1376 | 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), |
1377 | 37 | 'depreciation_value': fields.float('Amount of Depreciation Lines', readonly=True), | 37 | 'depreciation_value': fields.float('Amount of Depreciation Lines', readonly=True), |
1378 | 38 | 'installment_value': fields.float('Amount of Installment Lines', readonly=True), | ||
1379 | 38 | 'move_check': fields.boolean('Posted', readonly=True), | 39 | 'move_check': fields.boolean('Posted', readonly=True), |
1381 | 39 | 'nbr': fields.integer('# of Depreciation Lines', readonly=True), | 40 | 'installment_nbr': fields.integer('# of Installment Lines', readonly=True), |
1382 | 41 | 'depreciation_nbr': fields.integer('# of Depreciation Lines', readonly=True), | ||
1383 | 40 | 'gross_value': fields.float('Gross Amount', readonly=True), | 42 | 'gross_value': fields.float('Gross Amount', readonly=True), |
1384 | 41 | 'posted_value': fields.float('Posted Amount', readonly=True), | 43 | 'posted_value': fields.float('Posted Amount', readonly=True), |
1385 | 42 | 'unposted_value': fields.float('Unposted Amount', readonly=True), | 44 | 'unposted_value': fields.float('Unposted Amount', readonly=True), |
1386 | @@ -51,14 +53,15 @@ | |||
1387 | 51 | min(dl.id) as id, | 53 | min(dl.id) as id, |
1388 | 52 | dl.name as name, | 54 | dl.name as name, |
1389 | 53 | dl.depreciation_date as depreciation_date, | 55 | dl.depreciation_date as depreciation_date, |
1391 | 54 | a.purchase_date as purchase_date, | 56 | a.date as date, |
1392 | 55 | (CASE WHEN (select min(d.id) from account_asset_depreciation_line as d | 57 | (CASE WHEN (select min(d.id) from account_asset_depreciation_line as d |
1393 | 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) |
1394 | 57 | where a.id=ac.id) = min(dl.id) | 59 | where a.id=ac.id) = min(dl.id) |
1396 | 58 | THEN a.purchase_value | 60 | THEN a.value |
1397 | 59 | ELSE 0 | 61 | ELSE 0 |
1398 | 60 | END) as gross_value, | 62 | END) as gross_value, |
1400 | 61 | dl.amount as depreciation_value, | 63 | dl.amount as depreciation_value, |
1401 | 64 | dl.amount as installment_value, | ||
1402 | 62 | (CASE WHEN dl.move_check | 65 | (CASE WHEN dl.move_check |
1403 | 63 | THEN dl.amount | 66 | THEN dl.amount |
1404 | 64 | ELSE 0 | 67 | ELSE 0 |
1405 | @@ -72,14 +75,15 @@ | |||
1406 | 72 | a.category_id as asset_category_id, | 75 | a.category_id as asset_category_id, |
1407 | 73 | a.partner_id as partner_id, | 76 | a.partner_id as partner_id, |
1408 | 74 | a.state as state, | 77 | a.state as state, |
1410 | 75 | count(dl.*) as nbr, | 78 | count(dl.*) as installment_nbr, |
1411 | 79 | count(dl.*) as depreciation_nbr, | ||
1412 | 76 | a.company_id as company_id | 80 | a.company_id as company_id |
1413 | 77 | from account_asset_depreciation_line dl | 81 | from account_asset_depreciation_line dl |
1414 | 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) |
1415 | 79 | group by | 83 | group by |
1416 | 80 | dl.amount,dl.asset_id,dl.depreciation_date,dl.name, | 84 | dl.amount,dl.asset_id,dl.depreciation_date,dl.name, |
1419 | 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, |
1420 | 82 | a.purchase_value, a.id, a.salvage_value | 86 | a.value, a.id, a.salvage_value |
1421 | 83 | )""") | 87 | )""") |
1422 | 84 | 88 | ||
1423 | 85 | 89 | ||
1424 | 86 | 90 | ||
1425 | === modified file 'account_asset/report/account_asset_report_view.xml' | |||
1426 | --- account_asset/report/account_asset_report_view.xml 2014-01-29 16:07:09 +0000 | |||
1427 | +++ account_asset/report/account_asset_report_view.xml 2014-05-28 05:47:51 +0000 | |||
1428 | @@ -8,7 +8,7 @@ | |||
1429 | 8 | <field name="arch" type="xml"> | 8 | <field name="arch" type="xml"> |
1430 | 9 | <graph string="Assets Analysis" type="pivot"> | 9 | <graph string="Assets Analysis" type="pivot"> |
1431 | 10 | <field name="asset_id" type="row"/> | 10 | <field name="asset_id" type="row"/> |
1433 | 11 | <field name="nbr" type="measure"/> | 11 | <field name="depreciation_nbr" type="measure"/> |
1434 | 12 | <field name="gross_value" type="measure"/> | 12 | <field name="gross_value" type="measure"/> |
1435 | 13 | <field name="depreciation_value" type="measure"/> | 13 | <field name="depreciation_value" type="measure"/> |
1436 | 14 | <field name="posted_value" type="measure"/> | 14 | <field name="posted_value" type="measure"/> |
1437 | @@ -16,12 +16,30 @@ | |||
1438 | 16 | </field> | 16 | </field> |
1439 | 17 | </record> | 17 | </record> |
1440 | 18 | 18 | ||
1441 | 19 | <!-- | ||
1442 | 20 | Asset Revenue Recognition Graph | ||
1443 | 21 | --> | ||
1444 | 22 | |||
1445 | 23 | <record model="ir.ui.view" id="action_account_revenue_report_graph"> | ||
1446 | 24 | <field name="name">asset.revenue.report.graph</field> | ||
1447 | 25 | <field name="model">asset.asset.report</field> | ||
1448 | 26 | <field name="arch" type="xml"> | ||
1449 | 27 | <graph string="Revenue Recognition Analysis" type="pivot"> | ||
1450 | 28 | <field name="asset_id" type="row"/> | ||
1451 | 29 | <field name="installment_nbr" type="measure" string="# of Installment Lines"/> | ||
1452 | 30 | <field name="gross_value" type="measure"/> | ||
1453 | 31 | <field name="installment_value" string="Amount of Payment Schedule Line" type="measure"/> | ||
1454 | 32 | <field name="posted_value" type="measure"/> | ||
1455 | 33 | </graph> | ||
1456 | 34 | </field> | ||
1457 | 35 | </record> | ||
1458 | 36 | |||
1459 | 19 | <record id="view_asset_asset_report_search" model="ir.ui.view"> | 37 | <record id="view_asset_asset_report_search" model="ir.ui.view"> |
1460 | 20 | <field name="name">asset.asset.report.search</field> | 38 | <field name="name">asset.asset.report.search</field> |
1461 | 21 | <field name="model">asset.asset.report</field> | 39 | <field name="model">asset.asset.report</field> |
1462 | 22 | <field name="arch" type="xml"> | 40 | <field name="arch" type="xml"> |
1463 | 23 | <search string="Assets Analysis"> | 41 | <search string="Assets Analysis"> |
1465 | 24 | <field name="purchase_date"/> | 42 | <field name="date"/> |
1466 | 25 | <field name="depreciation_date"/> | 43 | <field name="depreciation_date"/> |
1467 | 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"/> |
1468 | 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"/> |
1469 | @@ -38,7 +56,7 @@ | |||
1470 | 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'}"/> |
1471 | 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"/> |
1472 | 40 | <filter string="Purchase Month" icon="terp-go-month" | 58 | <filter string="Purchase Month" icon="terp-go-month" |
1474 | 41 | domain="[]" context="{'group_by':'purchase_date'}" help="Date of asset purchase"/> | 59 | domain="[]" context="{'group_by':'date'}" help="Date of asset purchase"/> |
1475 | 42 | <filter string="Depreciation Month" icon="terp-go-today" | 60 | <filter string="Depreciation Month" icon="terp-go-today" |
1476 | 43 | domain="[]" context="{'group_by':'depreciation_date'}" help="Date of depreciation"/> | 61 | domain="[]" context="{'group_by':'depreciation_date'}" help="Date of depreciation"/> |
1477 | 44 | </group> | 62 | </group> |
1478 | @@ -46,12 +64,47 @@ | |||
1479 | 46 | </field> | 64 | </field> |
1480 | 47 | </record> | 65 | </record> |
1481 | 48 | 66 | ||
1482 | 67 | <!-- | ||
1483 | 68 | Asset Revenue Recognition Serach | ||
1484 | 69 | --> | ||
1485 | 70 | |||
1486 | 71 | <record id="view_asset_revenue_report_search" model="ir.ui.view"> | ||
1487 | 72 | <field name="name">asset.revenue.report.search</field> | ||
1488 | 73 | <field name="model">asset.asset.report</field> | ||
1489 | 74 | <field name="arch" type="xml"> | ||
1490 | 75 | <search string="Revenue Recognition Analysis"> | ||
1491 | 76 | <field name="date"/> | ||
1492 | 77 | <field name="depreciation_date"/> | ||
1493 | 78 | <filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Assets in draft state"/> | ||
1494 | 79 | <filter string="Running" icon="terp-check" domain="[('state','=','open')]" help="Assets in running state"/> | ||
1495 | 80 | <separator/> | ||
1496 | 81 | <filter string="Posted" name="posted" icon="terp-camera_test" domain="[('move_check','=',True)]" help="Posted depreciation lines" context="{'unposted_value_visible': 0}"/> | ||
1497 | 82 | <field name="asset_id"/> | ||
1498 | 83 | <field name="asset_category_id"/> | ||
1499 | 84 | <group expand="0" string="Extended Filters..."> | ||
1500 | 85 | <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/> | ||
1501 | 86 | <field name="company_id" groups="base.group_multi_company"/> | ||
1502 | 87 | </group> | ||
1503 | 88 | <group expand="1" string="Group By..."> | ||
1504 | 89 | <filter string="Revenue Recognition" name="revenue" context="{'group_by':'asset_id'}"/> | ||
1505 | 90 | <filter string="Category" name="category" context="{'group_by':'asset_category_id'}"/> | ||
1506 | 91 | <filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/> | ||
1507 | 92 | <filter string="Sales Month" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]" context="{'group_by':'date'}" help="Date of Revenue Sales"/> | ||
1508 | 93 | <filter string="Revenue Month" icon="terp-go-month" name='rev_month' | ||
1509 | 94 | context="{'group_by':'depreciation_date'}" help="Revenue Month"/> | ||
1510 | 95 | </group> | ||
1511 | 96 | </search> | ||
1512 | 97 | </field> | ||
1513 | 98 | </record> | ||
1514 | 99 | |||
1515 | 49 | <record model="ir.actions.act_window" id="action_asset_asset_report"> | 100 | <record model="ir.actions.act_window" id="action_asset_asset_report"> |
1517 | 50 | <field name="name">Assets Analysis</field> | 101 | <field name="name">Assets</field> |
1518 | 51 | <field name="res_model">asset.asset.report</field> | 102 | <field name="res_model">asset.asset.report</field> |
1519 | 52 | <field name="view_type">form</field> | 103 | <field name="view_type">form</field> |
1520 | 53 | <field name="view_mode">graph</field> | 104 | <field name="view_mode">graph</field> |
1521 | 54 | <field name="search_view_id" ref="view_asset_asset_report_search"/> | 105 | <field name="search_view_id" ref="view_asset_asset_report_search"/> |
1522 | 106 | <field name="view_id" ref="action_account_asset_report_graph"/> | ||
1523 | 107 | <field name="domain">[('asset_category_id.type', '=', 'purchase')]</field> | ||
1524 | 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> |
1525 | 56 | <field name="help" type="html"> | 109 | <field name="help" type="html"> |
1526 | 57 | <p> | 110 | <p> |
1527 | @@ -62,8 +115,38 @@ | |||
1528 | 62 | </field> | 115 | </field> |
1529 | 63 | </record> | 116 | </record> |
1530 | 64 | 117 | ||
1531 | 118 | <!-- | ||
1532 | 119 | Asset Revenue Recognition Action | ||
1533 | 120 | --> | ||
1534 | 121 | |||
1535 | 122 | <record model="ir.actions.act_window" id="action_asset_revenue_report"> | ||
1536 | 123 | <field name="name">Revenues Recognitions</field> | ||
1537 | 124 | <field name="res_model">asset.asset.report</field> | ||
1538 | 125 | <field name="view_type">form</field> | ||
1539 | 126 | <field name="view_mode">graph</field> | ||
1540 | 127 | <field name="search_view_id" ref="view_asset_revenue_report_search"/> | ||
1541 | 128 | <field name="view_id" ref="action_account_revenue_report_graph"/> | ||
1542 | 129 | <field name="domain">[('asset_category_id.type', '=', 'sales')]</field> | ||
1543 | 130 | <field name="context">{'search_default_asset_category':2,'search_default_posted':1,'group_by':[],'group_by_no_leaf':1}</field> | ||
1544 | 131 | <field name="help" type="html"> | ||
1545 | 132 | <p> | ||
1546 | 133 | From this report, you can have an overview on all depreciation. The | ||
1547 | 134 | tool search can also be used to personalise your Revenue Recognition reports and | ||
1548 | 135 | so, match this analysis to your needs; | ||
1549 | 136 | </p> | ||
1550 | 137 | </field> | ||
1551 | 138 | </record> | ||
1552 | 139 | |||
1553 | 65 | <menuitem action="action_asset_asset_report" | 140 | <menuitem action="action_asset_asset_report" |
1554 | 66 | id="menu_action_asset_asset_report" | 141 | id="menu_action_asset_asset_report" |
1556 | 67 | parent="account.menu_finance_reporting"/> | 142 | parent="account.menu_finance_reporting" sequence="21"/> |
1557 | 143 | |||
1558 | 144 | <!-- | ||
1559 | 145 | Asset Revenue Recognition Manu | ||
1560 | 146 | --> | ||
1561 | 147 | |||
1562 | 148 | <menuitem action="action_asset_revenue_report" | ||
1563 | 149 | id="menu_action_asset_revenue_report" | ||
1564 | 150 | parent="account.menu_finance_reporting" sequence="20"/> | ||
1565 | 68 | </data> | 151 | </data> |
1566 | 69 | </openerp> | 152 | </openerp> |
1567 | 70 | 153 | ||
1568 | === added directory 'account_asset/static/src/js' | |||
1569 | === added file 'account_asset/static/src/js/account_asset.js' | |||
1570 | --- account_asset/static/src/js/account_asset.js 1970-01-01 00:00:00 +0000 | |||
1571 | +++ account_asset/static/src/js/account_asset.js 2014-05-28 05:47:51 +0000 | |||
1572 | @@ -0,0 +1,22 @@ | |||
1573 | 1 | openerp.account_asset = function (instance) { | ||
1574 | 2 | var _t = instance.web._t, | ||
1575 | 3 | _lt = instance.web._lt; | ||
1576 | 4 | var QWeb = instance.web.qweb; | ||
1577 | 5 | instance.web.list.WidgetOnButton = instance.web.list.Column.extend({ | ||
1578 | 6 | format: function (row_data, options) { | ||
1579 | 7 | this._super(row_data, options); | ||
1580 | 8 | this.has_value = !!row_data.move_check.value; | ||
1581 | 9 | this.parent_state = row_data.parent_state.value; | ||
1582 | 10 | this.icon = this.has_value ? 'gtk-yes' : 'gtk-no'; | ||
1583 | 11 | this.string = this.has_value ? 'Posted' : 'Unposted' | ||
1584 | 12 | var template = this.icon && 'ListView.row.buttonwidget'; | ||
1585 | 13 | return QWeb.render(template, { | ||
1586 | 14 | widget: this, | ||
1587 | 15 | prefix: instance.session.prefix, | ||
1588 | 16 | disabled: this.has_value, | ||
1589 | 17 | invisible : 'true' ? this.parent_state !== 'open' : 'false' | ||
1590 | 18 | }); | ||
1591 | 19 | }, | ||
1592 | 20 | }); | ||
1593 | 21 | instance.web.list.columns.add("button.widgetonbutton", "instance.web.list.WidgetOnButton"); | ||
1594 | 22 | }; | ||
1595 | 0 | \ No newline at end of file | 23 | \ No newline at end of file |
1596 | 1 | 24 | ||
1597 | === modified file 'account_asset/test/account_asset_demo.yml' | |||
1598 | --- account_asset/test/account_asset_demo.yml 2011-12-20 10:08:42 +0000 | |||
1599 | +++ account_asset/test/account_asset_demo.yml 2014-05-28 05:47:51 +0000 | |||
1600 | @@ -6,4 +6,4 @@ | |||
1601 | 6 | category_id: account_asset_category_sale | 6 | category_id: account_asset_category_sale |
1602 | 7 | - | 7 | - |
1603 | 8 | !record {model: account.asset.asset, id: account_asset_asset_vehicles0}: | 8 | !record {model: account.asset.asset, id: account_asset_asset_vehicles0}: |
1605 | 9 | method_number: 10 | 9 | method_number: 1 |
1606 | 10 | 10 | ||
1607 | === added file 'account_asset/test/account_revenue_recognition.yml' | |||
1608 | --- account_asset/test/account_revenue_recognition.yml 1970-01-01 00:00:00 +0000 | |||
1609 | +++ account_asset/test/account_revenue_recognition.yml 2014-05-28 05:47:51 +0000 | |||
1610 | @@ -0,0 +1,54 @@ | |||
1611 | 1 | - | ||
1612 | 2 | In order to test the process of revenue recognition from customer invoice, I create customer invoice. | ||
1613 | 3 | - | ||
1614 | 4 | !record {model: account.invoice, id: account_invoice_insurance}: | ||
1615 | 5 | partner_id: base.res_partner_12 | ||
1616 | 6 | invoice_line: | ||
1617 | 7 | - price_unit: 450.0 | ||
1618 | 8 | quantity: 1.0 | ||
1619 | 9 | name: 'Insurance claim' | ||
1620 | 10 | recongnition_date: !eval "'%s-01-01' %(datetime.now().year)" | ||
1621 | 11 | asset_category_id: account_asset_category_sale1 | ||
1622 | 12 | |||
1623 | 13 | - | ||
1624 | 14 | I create revenue recognition by validating invoice. | ||
1625 | 15 | - | ||
1626 | 16 | !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_insurance} | ||
1627 | 17 | - | ||
1628 | 18 | Test the process of revenue recognition. | ||
1629 | 19 | - | ||
1630 | 20 | !python {model: account.asset.asset}: | | ||
1631 | 21 | from datetime import datetime | ||
1632 | 22 | from dateutil.relativedelta import relativedelta | ||
1633 | 23 | line_obj = self.pool.get('account.asset.depreciation.line') | ||
1634 | 24 | invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_insurance")) | ||
1635 | 25 | recognition_ids = self.search(cr, uid, [('code', '=', invoice.number)]) | ||
1636 | 26 | assert recognition_ids, 'Revenue recognition has been not created from invoice.' | ||
1637 | 27 | |||
1638 | 28 | #I confirm revenue recognition. | ||
1639 | 29 | self.validate(cr, uid, recognition_ids) | ||
1640 | 30 | recognition = self.browse(cr, uid, recognition_ids[0]) | ||
1641 | 31 | first_invoice_line = invoice.invoice_line[0] | ||
1642 | 32 | assert recognition.state == 'open', 'Recognition should be in Open state' | ||
1643 | 33 | assert recognition.value == first_invoice_line.price_subtotal, 'Recognition value is not same as invoice line.' | ||
1644 | 34 | assert recognition.date == first_invoice_line.recongnition_date, 'Recognition date is not same as invoice line.' | ||
1645 | 35 | |||
1646 | 36 | #I post installment lines. | ||
1647 | 37 | line_ids = [rec.id for rec in recognition.depreciation_line_ids] | ||
1648 | 38 | line_obj.create_move(cr, uid, line_ids) | ||
1649 | 39 | |||
1650 | 40 | #I check that move line is created from posted installment lines. | ||
1651 | 41 | assert len(recognition.depreciation_line_ids) == len(recognition.account_move_line_ids), 'Move lines not created correctly.' | ||
1652 | 42 | |||
1653 | 43 | #I check data in move line and installment line. | ||
1654 | 44 | first_installment_line = recognition.depreciation_line_ids[0] | ||
1655 | 45 | first_move_line = recognition.account_move_line_ids[0] | ||
1656 | 46 | assert first_installment_line.amount == first_move_line.credit, 'First installment line amount is incorrect.' | ||
1657 | 47 | assert recognition.category_id.account_income_recognition_id == first_move_line.account_id, 'Move line account and recognition category account is not same.' | ||
1658 | 48 | remaining_value = recognition.value - first_installment_line.amount | ||
1659 | 49 | assert first_installment_line.remaining_value == recognition.value - first_installment_line.amount, 'Remaining value is incorrect.' | ||
1660 | 50 | |||
1661 | 51 | #I check next installment date. | ||
1662 | 52 | last_installment_date = datetime.strptime(first_installment_line.depreciation_date, '%Y-%m-%d') | ||
1663 | 53 | installment_date = (last_installment_date+relativedelta(months=+recognition.method_period)) | ||
1664 | 54 | assert recognition.depreciation_line_ids[1].depreciation_date == str(installment_date.date()), 'Installment date is incorrect.' | ||
1665 | 0 | \ No newline at end of file | 55 | \ No newline at end of file |
1666 | 1 | 56 | ||
1667 | === added file 'account_asset/test/account_revenue_recognition_demo.yml' | |||
1668 | --- account_asset/test/account_revenue_recognition_demo.yml 1970-01-01 00:00:00 +0000 | |||
1669 | +++ account_asset/test/account_revenue_recognition_demo.yml 2014-05-28 05:47:51 +0000 | |||
1670 | @@ -0,0 +1,9 @@ | |||
1671 | 1 | - | ||
1672 | 2 | !record {model: account.asset.category, id: account_asset_category_sale1}: | ||
1673 | 3 | account_asset_id: account.xfa | ||
1674 | 4 | - | ||
1675 | 5 | !record {model: account.asset.asset, id: account_asset_asset_pc}: | ||
1676 | 6 | category_id: account_asset_category_sale | ||
1677 | 7 | - | ||
1678 | 8 | !record {model: account.asset.asset, id: account_asset_asset_pc}: | ||
1679 | 9 | method_number: 12 | ||
1680 | 0 | \ No newline at end of file | 10 | \ No newline at end of file |
1681 | 1 | 11 | ||
1682 | === modified file 'account_asset/wizard/account_asset_change_duration.py' | |||
1683 | --- account_asset/wizard/account_asset_change_duration.py 2013-10-27 12:31:04 +0000 | |||
1684 | +++ account_asset/wizard/account_asset_change_duration.py 2014-05-28 05:47:51 +0000 | |||
1685 | @@ -22,6 +22,7 @@ | |||
1686 | 22 | from lxml import etree | 22 | from lxml import etree |
1687 | 23 | 23 | ||
1688 | 24 | from openerp.osv import fields, osv | 24 | from openerp.osv import fields, osv |
1689 | 25 | from openerp.osv.orm import setup_modifiers | ||
1690 | 25 | 26 | ||
1691 | 26 | class asset_modify(osv.osv_memory): | 27 | class asset_modify(osv.osv_memory): |
1692 | 27 | _name = 'asset.modify' | 28 | _name = 'asset.modify' |
1693 | @@ -51,16 +52,18 @@ | |||
1694 | 51 | asset_obj = self.pool.get('account.asset.asset') | 52 | asset_obj = self.pool.get('account.asset.asset') |
1695 | 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) |
1696 | 53 | asset_id = context.get('active_id', False) | 54 | asset_id = context.get('active_id', False) |
1698 | 54 | active_model = context.get('active_model', '') | 55 | active_model = context.get('active_model') |
1699 | 55 | if active_model == 'account.asset.asset' and asset_id: | 56 | if active_model == 'account.asset.asset' and asset_id: |
1700 | 56 | asset = asset_obj.browse(cr, uid, asset_id, context=context) | 57 | asset = asset_obj.browse(cr, uid, asset_id, context=context) |
1701 | 57 | doc = etree.XML(result['arch']) | 58 | doc = etree.XML(result['arch']) |
1703 | 58 | if asset.method_time == 'number': | 59 | if asset.method_time == 'number' and doc.xpath("//field[@name='method_end']"): |
1704 | 59 | node = doc.xpath("//field[@name='method_end']")[0] | 60 | node = doc.xpath("//field[@name='method_end']")[0] |
1705 | 60 | node.set('invisible', '1') | 61 | node.set('invisible', '1') |
1707 | 61 | elif asset.method_time == 'end': | 62 | setup_modifiers(node, result['fields']['method_end']) |
1708 | 63 | elif asset.method_time == 'end' and doc.xpath("//field[@name='method_number']"): | ||
1709 | 62 | node = doc.xpath("//field[@name='method_number']")[0] | 64 | node = doc.xpath("//field[@name='method_number']")[0] |
1710 | 63 | node.set('invisible', '1') | 65 | node.set('invisible', '1') |
1711 | 66 | setup_modifiers(node, result['fields']['method_number']) | ||
1712 | 64 | result['arch'] = etree.tostring(doc) | 67 | result['arch'] = etree.tostring(doc) |
1713 | 65 | return result | 68 | return result |
1714 | 66 | 69 | ||
1715 | 67 | 70 | ||
1716 | === modified file 'account_asset/wizard/wizard_asset_compute.py' | |||
1717 | --- account_asset/wizard/wizard_asset_compute.py 2013-10-27 12:31:04 +0000 | |||
1718 | +++ account_asset/wizard/wizard_asset_compute.py 2014-05-28 05:47:51 +0000 | |||
1719 | @@ -41,12 +41,15 @@ | |||
1720 | 41 | 41 | ||
1721 | 42 | def asset_compute(self, cr, uid, ids, context): | 42 | def asset_compute(self, cr, uid, ids, context): |
1722 | 43 | ass_obj = self.pool.get('account.asset.asset') | 43 | ass_obj = self.pool.get('account.asset.asset') |
1724 | 44 | asset_ids = ass_obj.search(cr, uid, [('state','=','open')], context=context) | 44 | asset_ids = ass_obj.search(cr, uid, [('state', '=', 'open'), |
1725 | 45 | ('category_id.type', '=', context.get('type',False))], | ||
1726 | 46 | context=context) | ||
1727 | 45 | data = self.browse(cr, uid, ids, context=context) | 47 | data = self.browse(cr, uid, ids, context=context) |
1728 | 46 | period_id = data[0].period_id.id | 48 | period_id = data[0].period_id.id |
1729 | 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) |
1730 | 50 | asset_type = 'Asset' if context.get('type', False) == 'purchase' else 'Recognition' | ||
1731 | 48 | return { | 51 | return { |
1733 | 49 | 'name': _('Created Asset Moves'), | 52 | 'name': _('Created %s Moves') % asset_type, |
1734 | 50 | 'view_type': 'form', | 53 | 'view_type': 'form', |
1735 | 51 | 'view_mode': 'tree,form', | 54 | 'view_mode': 'tree,form', |
1736 | 52 | 'res_model': 'account.move', | 55 | 'res_model': 'account.move', |
1737 | 53 | 56 | ||
1738 | === modified file 'account_asset/wizard/wizard_asset_compute_view.xml' | |||
1739 | --- account_asset/wizard/wizard_asset_compute_view.xml 2012-11-29 22:26:45 +0000 | |||
1740 | +++ account_asset/wizard/wizard_asset_compute_view.xml 2014-05-28 05:47:51 +0000 | |||
1741 | @@ -5,12 +5,18 @@ | |||
1742 | 5 | <field name="name">asset.depreciation.confirmation.wizard</field> | 5 | <field name="name">asset.depreciation.confirmation.wizard</field> |
1743 | 6 | <field name="model">asset.depreciation.confirmation.wizard</field> | 6 | <field name="model">asset.depreciation.confirmation.wizard</field> |
1744 | 7 | <field name="arch" type="xml"> | 7 | <field name="arch" type="xml"> |
1746 | 8 | <form string="Compute Asset" version="7.0"> | 8 | <form string="Compute Assets" version="7.0"> |
1747 | 9 | <div> | ||
1748 | 10 | <p> | ||
1749 | 11 | This wizard will post installment/depreciation lines of selected month.<br/> | ||
1750 | 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. | ||
1751 | 13 | </p> | ||
1752 | 14 | </div> | ||
1753 | 9 | <group> | 15 | <group> |
1754 | 10 | <field name="period_id"/> | 16 | <field name="period_id"/> |
1755 | 11 | </group> | 17 | </group> |
1756 | 12 | <footer> | 18 | <footer> |
1758 | 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"/> |
1759 | 14 | or | 20 | or |
1760 | 15 | <button string="Cancel" class="oe_link" special="cancel"/> | 21 | <button string="Cancel" class="oe_link" special="cancel"/> |
1761 | 16 | </footer> | 22 | </footer> |
1762 | @@ -19,17 +25,33 @@ | |||
1763 | 19 | </record> | 25 | </record> |
1764 | 20 | 26 | ||
1765 | 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"> |
1767 | 22 | <field name="name">Compute Assets</field> | 28 | <field name="name">Post Depreciation Lines</field> |
1768 | 23 | <field name="res_model">asset.depreciation.confirmation.wizard</field> | 29 | <field name="res_model">asset.depreciation.confirmation.wizard</field> |
1769 | 24 | <field name="view_type">form</field> | 30 | <field name="view_type">form</field> |
1770 | 25 | <field name="view_mode">tree,form</field> | 31 | <field name="view_mode">tree,form</field> |
1771 | 26 | <field name="view_id" ref="view_asset_depreciation_confirmation_wizard"/> | 32 | <field name="view_id" ref="view_asset_depreciation_confirmation_wizard"/> |
1772 | 27 | <field name="target">new</field> | 33 | <field name="target">new</field> |
1773 | 34 | <field name="context">{'type':'purchase'}</field> | ||
1774 | 28 | </record> | 35 | </record> |
1775 | 29 | 36 | ||
1777 | 30 | <menuitem action="action_asset_depreciation_confirmation_wizard" | 37 | <menuitem name="Generate Monthly Assets Entries" action="action_asset_depreciation_confirmation_wizard" |
1778 | 31 | id="menu_asset_depreciation_confirmation_wizard" | 38 | id="menu_asset_depreciation_confirmation_wizard" |
1780 | 32 | parent="account.menu_finance_recurrent_entries" /> | 39 | parent="account.menu_finance_recurrent_entries" sequence="2"/> |
1781 | 40 | |||
1782 | 41 | |||
1783 | 42 | <record id="action_recognition_depreciation_confirmation_wizard" model="ir.actions.act_window"> | ||
1784 | 43 | <field name="name">Post Installment Lines</field> | ||
1785 | 44 | <field name="res_model">asset.depreciation.confirmation.wizard</field> | ||
1786 | 45 | <field name="view_type">form</field> | ||
1787 | 46 | <field name="view_mode">tree,form</field> | ||
1788 | 47 | <field name="view_id" ref="view_asset_depreciation_confirmation_wizard"/> | ||
1789 | 48 | <field name="target">new</field> | ||
1790 | 49 | <field name="context">{'type':'sales'}</field> | ||
1791 | 50 | </record> | ||
1792 | 51 | |||
1793 | 52 | <menuitem name="Generate Monthly Recognition Entries" action="action_recognition_depreciation_confirmation_wizard" | ||
1794 | 53 | id="menu_recognition_depreciation_confirmation_wizard" | ||
1795 | 54 | parent="account.menu_finance_recurrent_entries" sequence="1"/> | ||
1796 | 33 | 55 | ||
1797 | 34 | </data> | 56 | </data> |
1798 | 35 | </openerp> | 57 | </openerp> |