~lertech-a/+junk/localization-7.0-trunk

« back to all changes in this revision

Viewing changes to l10n_ve_fiscal_book/model/invoice.py

  • Committer: Francisco Lercari
  • Date: 2014-08-15 00:10:06 UTC
  • mfrom: (890.1.116 vx_ovl70_trunk)
  • Revision ID: flercari@lertech.com.ve-20140815001006-jg35xvgmli5ho8fi
[MERGE] revision 1006 official

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                  "the book to Cancel. Then you could be able to cancel the "
55
55
                  "invoice." % (inv_brw.fb_id.state,)))
56
56
        return True
 
57
 
 
58
    def copy(self, cur, uid, id, default=None, context=None):
 
59
        """
 
60
        Overwrite the copy orm method to blank the fiscal book field when
 
61
        a invoice is copy. Also if a invoice have benn remove from a fiscal
 
62
        book the issue_fb_id is add, if a duplicate this invoice that info os
 
63
        issue will be garbage so I clean it too.
 
64
        """
 
65
        context = context or {}
 
66
        default = default or {}
 
67
        default.update(fb_id=False)
 
68
        if default.get('issue_fb_id', False):
 
69
            default.update(issue_fb_id=False)
 
70
        res = super(account_invoice, self).copy(
 
71
            cur, uid, id, default=default, context=context)
 
72
        return res