On 2016-02-01 07:03, Oscar Alvarez wrote: > > > El 01/02/16 a las 03:48, Cédric Krier escribió: > >On 2016-01-31 23:06, Oscar Alvarez wrote: > >> > >>El 31/01/16 a las 14:15, Cédric Krier escribió: > >>>On 2016-01-31 09:33, Oscar Alvarez wrote: > >>>>El 30/01/16 a las 18:08, Cédric Krier escribió: > >>>>>On 2016-01-30 12:51, Oscar Andres Alvarez Montero wrote: > >>>>>>Hi, devs > >>>>>>I am working 3.6, but de om a new module I need overload get_context > >>>>>>from > >>>>>>trytond core, not for a simple report, else for all reports, without > >>>>>>create > >>>>>>new Class as CompanyReport, it this possible? > >>>>>We don't have a way to extend base classes. For now, you have to extend > >>>>>every report you need or you could try to ugly way by monkey-patching > >>>>>the Report class. > >>>>> > >>>>>But maybe there is a better way to achieve your goal if you could give > >>>>>more detail on the needs. > >>>>> > >>>>I am starting the develop of new module [1] for Management System (ISO) > >>>>[2], > >>>>for now is only little module, but a of first model is related with > >>>>Documents and Records formats, for example purchase report on quality > >>>>systems is a controlled record, so this need the following values on head > >>>>document: code, version of document, approved by (person), etc, of course > >>>>this values change between documents/records formats, and could be many > >>>>formats, the idea is to define this values on a unique model without to > >>>>call > >>>>each model report and overload get_context, just using a field M2O, in > >>>>this > >>>>model: > >>>>something like as: > >>>> > >>>>https://bitbucket.org/presik/trytonpsk_ims/src/679891616c125f013d13db965b8d20a23f5c1d19/document_record.py?fileviewer=file-view-default > >>>> > >>>>next, overload Class Report, that add new values to report context if data > >>>>of DocumentReport if on context. > >>>> > >>>> @classmethod > >>>> def get_context(cls, records, data): > >>>> report_context = super(Report, cls).get_context(records, data) > >>>> ims_report = cls._get_report_ims_data() > >>>> report_context['ims_name'] = ims_report.ims_name > >>>> report_context['code'] = ims_report.code > >>>> report_context['version'] = ims_report.version > >>>> report_context['approved_date'] = ims_report.approved_date > >>>> return report_context > >>>I personally don't understand what you try to achieve. I don't know what > >>>you call "purchase report", I don't see the link between your > >>>requirements and the reports. I don't understand why you define a > >>>"unique model". > >>I want extending ActionReport with three fields to ir.action.report ("code > >>or number", "revision/version", "approved/release date"), and see them > >>printed on reports, (sale order, purchase order, etc, see attached), it > >>print these fields on reports are necessary for all companies that has > >>quality management systems [1][2], because they are important controlled > >>documents/records, not anything else document, and for example "revision" > >>field change constantly, so thats why is better change "revision" value > >>from a record on model, and not set as a constant in a format report. > >For me, you are mixing record history with printed document history. > >By just activating the history on the Purchase and PurchaseLine, you > >have all the tracking information you need. > >And if you need more field on the Report, you have to add them to the > >Purchase Model. > > > this has nothing to do with it content or data of purchase or purchase > lines, not is about history of > document content but if is history of format (report), definied on > ir.action.report, It is there where > the information "code or number", "revision/version", "approved date" (not > purchase workflow), must > be setting, here there is information that I talking about: > > [1] http://www.qualitysystems.com/support/pages/control-of-documents > > Purchase order is just an example, in a company shipment order (report), > some staff reports, sale (report), > quality control (reports), not just one document (format), is for many > documents/formats could be require > this feature., on quality systems. Please read the link [1] specially this > part: > > Number Title Revision Number Revision Date Document Owner > Status > MSP-01 General Requirements 2.0 13 March 2013 Jill Jones > Released > FORM-01 Purchase Order 1.0 6 Sept 2008 Bookkeeper Released > POL-03 Health and Safety Policy 3.0 22 June 2011 WHSO > Released > POL-04 Drugs and Alcohol Policy 0.6 5 May 2013 Michael > Draft
Still it is not clear if you talk about the result document or about the template or about the record. I think the only think that matter is data and so it is the record. And as the template is also a record the same apply to this object. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- You received this message because you are subscribed to the Google Groups "tryton-dev" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/20160201135804.GG20880%40tetsuo.