On 2017-03-03 13:56, Vincent Bastos wrote: > On Sun, Feb 19, 2017 at 9:40 AM, Cédric Krier <cedric.kr...@b2ck.com> wrote: > I tried this module, but it's not what I am trying to achieve. In my module > I have a function which automatically sends parties invoices by email > or/and post depending on what the party has selected. The module is setup > to automatically charge a party a fee if they have selected to receive an > invoice by post. > > At the moment the way I am solving this is by using a couple of fields on > the configuration of the module: > > lease_postage_notice_fee_amount = fields.Numeric( > 'Postage Notice Fee Amount', > digits=(16, Eval('currency_digits', 2)), > depends=['currency_digits'] > ) > lease_postage_notice_fee_account = fields.Many2One( > 'account.account', 'Postage Notice Fee Account', > required=False > ) > > When the module creates the invoice it checks on the party if they have > selected to receive by post and adds an invoice line to reflect this.
This sounds good. You could also use a link to a service product and store use the revenue account and the list price. This will replace the two fields by a single one. > PS I tested the module sale_shipment_cost and the field "Sale Shipment Cost > Method" on the sale configuration is set to "On Order", but I noticed in > the code that the function default_sale_shipment_cost returns 'shipment'. > Can you explain why this is? The default method is for the configuration but the sale default method use the configured value. -- 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/20170303141849.GP36856%40tetsuo.